Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Feature request) Add gitPropertiesResourceDir and gitPropertiesName to specify output file #131

Closed
tha2015 opened this issue Aug 26, 2019 · 1 comment
Milestone

Comments

@tha2015
Copy link
Collaborator

tha2015 commented Aug 26, 2019

The current config "gitPropertiesDir" has some limitations:

  • Cannot specify "git.properties" name
  • When using default value "build/resources/main", it depends on "processResources" task to register "build/resources/main" as a resources folder (to be packaged into output jar file). This is causing some issues in Gradle 5.1 and 5.2 (see issue git.properties is missing when building with gradle 5.1.x, gradle 5.2.x #128 )
  • When using another folder for "gitPropertiesDir" config, the folder will not be registered as a resources folder, so it will not be packaged into final jar file. It means the custom folder will not recognized as a classpath entry (for Gradle/IDEs)

I suggest to have 2 new config keys (while still supporting the old key gitPropertiesDir).

  1. gitPropertiesResourceDir (default=null): The directory for generated properties file as a classpath entry. When it is not null, it will be registered as a main source set output directory so it can be included in generated jar file and can be recognized as a classpath entry for Gradle/IDEs. NOTE: If there is no need to put the properties file in classpath, use "gitPropertiesName" with absolute path instead.

  2. gitPropertiesName (default="git.properties"): the path to generated properties file (can be absolute path or relative to gitPropertiesResourceDir/gitPropertiesDir). When it is not null, it will be used as the path for generated properties file. It can be an absolute path (in this case, gitPropertiesResourceDir and gitPropertiesDir should not be used) or a relative path (to be resolved relatively to gitPropertiesDir/gitPropertiesResourceDir)

@tha2015 tha2015 changed the title (Feature request) Add gitPropertiesResourceDir and gitPropertiesResourceName as an alternative way to specify output location (Feature request) Add gitPropertiesResourceDir and gitPropertiesName to specify output file Aug 26, 2019
@tha2015 tha2015 added this to the v2.2.0 milestone Sep 21, 2019
@tha2015
Copy link
Collaborator Author

tha2015 commented Sep 21, 2019

Published v2.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant