problem: jar and zip miss the version file

This commit is contained in:
Igor Artamonov
2020-09-24 00:19:26 -04:00
committed by GitHub
parent c1fb2f7142
commit d52b8f3381

View File

@@ -198,13 +198,19 @@ protobuf {
} }
} }
sourceSets {
main {
resources.srcDirs += project.buildDir.absolutePath + "/generated/version"
}
}
task generateVersion() { task generateVersion() {
group = 'Build' group = 'Build'
description = 'Generate project version' description = 'Generate project version'
doLast { doLast {
def version = versionDetails() def version = versionDetails()
def resourcesDir = sourceSets.main.output.resourcesDir def resourcesDir = new File(project.buildDir.absolutePath + "/generated/version")
resourcesDir.mkdirs() resourcesDir.mkdirs()
new File(resourcesDir, "version.properties").text = [ new File(resourcesDir, "version.properties").text = [
"# AUTOMATICALLY GENERATED", "# AUTOMATICALLY GENERATED",
@@ -213,7 +219,6 @@ task generateVersion() {
"version.tag=${version.lastTag}", "version.tag=${version.lastTag}",
"version.date=${DateTimeFormatter.ISO_LOCAL_DATE_TIME.withZone(ZoneId.of('UTC')).format(Instant.now().truncatedTo(ChronoUnit.SECONDS))} UTC" "version.date=${DateTimeFormatter.ISO_LOCAL_DATE_TIME.withZone(ZoneId.of('UTC')).format(Instant.now().truncatedTo(ChronoUnit.SECONDS))} UTC"
].join("\n") ].join("\n")
} }
} }