ReadyTalk / gradle-projectinfo-plugin

[ARCHIVED]
3 stars 1 forks source link

gradle-projectinfo-plugin

Build Status

This project provides a file called project.properties on your classpath (sourceSets.main.output.resourcesDir) that contains git and project information.

Usage

apply plugin: 'projectInfo'

The plugin will ensure that the jar or war plugin has already been applied.

Then inject the generateProjectPropertiesFile task into your build

war.dependsOn generateProjectPropertiesFile

Optionally, you may configure the name of the project injected into the project.properties file, or set the git repository URL using the projectInfo configuration Closure.

projectInfo {
  projectName = 'my-custom-project-name'
  repoUrl = 'custom-project.git'
}

Details

The following properties are placed in the project.properties file:

This project will only re-generate the properties file if the latest commit hash to the repo differs from the one that already exists in the build directory. This allows UP-TO-DATE checking on your builds.

Contributing

If you find this useful and would like to make it more generic or add additional functionality, please submit a pull request, or open an issue!