Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public class GenerateGitPropertiesTask extends DefaultTask {
private final FileTree source
private final Property<Object> projectVersion

private final gitProps = new HashMap()

GenerateGitPropertiesTask() {
// Description for the task
description = 'Generate a git.properties file.'
Expand All @@ -50,6 +52,10 @@ public class GenerateGitPropertiesTask extends DefaultTask {
// when extProperty is configured or failOnNoGitDirectory=false always execute the task
return !task.gitProperties.extProperty && task.gitProperties.failOnNoGitDirectory
}

if (gitProperties.extProperty) {
project.ext[gitProperties.extProperty] = gitProps
}
}

@Inject
Expand Down Expand Up @@ -124,7 +130,7 @@ public class GenerateGitPropertiesTask extends DefaultTask {
// Expose generated properties to project.ext[gitProperties.extProperty] if configured
if (gitProperties.extProperty) {
logger.debug("Exposing git properties model to project.ext[${gitProperties.extProperty}]")
project.ext[gitProperties.extProperty] = new HashMap(newMap)
gitProps.putAll(newMap)
}

// Write to git.properties file
Expand Down