gregwhitaker / gradle-gitignore

Gradle plugin for generating .gitignore files.

Home Page:https://gregwhitaker.github.io/gradle-gitignore/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gradle-gitignore-plugin

Gradle plugin for generating .gitignore files using gitignore.io.

Features

  • Templates supplied by gitignore.io, so they are always up-to-date.

  • Automatic generation of the gitignore file based on the following project facets:

    • Programming Languages
    • Development Environment
    • Operating System
  • Generation of the gitignore file is completely configurable.

  • Support for pulling gitignore templates from locations other than gitignore.io.

Usage

The plugin can be applied with either the plugin or legacy buildscript DSL. For more information on applying the plugin and available plugin versions please refer to the Gradle Plugin Portal.

Applying the Plugin with Plugin DSL

plugins {
    id "com.github.gregwhitaker.gitignore"    version "2.2.0"
}

Applying the Plugin with Legacy Buildscript DSL

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.com.github.gregwhitaker:gradle-gitignore-plugin:2.2.0"
  }
}

apply plugin: "com.github.gregwhitaker.gitignore"

Simple Configuration

When using the plugin with automatic configuration there is no need for a configuration block. Simply apply the plugin, as detailed above, and a .gitignore file will be automatically generated.

Advanced Configuration

The plugin uses "facets" to describe what rules to add to the .gitignore file. These facets correspond to the technology selections on the gitignore.io website.

When using advanced configuration the plugin will continue to automatically discover project facets, but you are also able to add your own facets to the generation process by using the facets configuration parameter.

gitignore {
    facets = [
        'linux',
        'eclipse'
    ]
}   

Manual Configuration

Automatic discovery of project facets can be disabled allowing you to configure all facets that will be used for generation of the .gitignore file by calling the noAutoDetect() configuration method.

gitignore {
    noAutoDetect()
    facets = [
        'java',
        'idea',
        'gradle'
    ]
}   

External Configuration

In the event that you do not want to use gitignore.io to generate the .gitignore file you can insert any hosted document using the url configuration parameter.

gitignore {
    url = 'https://raw.githubusercontent.com/gregwhitaker/gradle-gitignore-plugin/master/src/test/templates/template-gitignore?token=AFw8vOxtg_dhIKrIKO1-aKjhpcvuxB6Kks5YhFcIwA%3D%3D'
}   

Documentation

For detailed documentation on this plugin and its features please refer to the GitIgnore Gradle Plugin User Guide.

Bugs and Feedback

For bugs, questions, and discussions please use the Github Issues.

License

Copyright 2017-Present Greg Whitaker

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Gradle plugin for generating .gitignore files.

https://gregwhitaker.github.io/gradle-gitignore/

License:Apache License 2.0


Languages

Language:Java 75.3%Language:Groovy 24.5%Language:Shell 0.2%