You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
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.
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)
The text was updated successfully, but these errors were encountered:
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
The current config "gitPropertiesDir" has some limitations:
I suggest to have 2 new config keys (while still supporting the old key gitPropertiesDir).
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.
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)
The text was updated successfully, but these errors were encountered: