problem: jar and zip miss the version file
This commit is contained in:
@@ -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")
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user