1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-22 20:32:05 +01:00

Only create version.properties in pgpainless-sop

This commit is contained in:
Paul Schaub 2021-06-24 19:10:48 +02:00
parent 9c8a2a0b29
commit 98609375d1
2 changed files with 20 additions and 20 deletions

View file

@ -178,26 +178,6 @@ subprojects {
required { signingRequired }
sign publishing.publications.mavenJava
}
def generatedVersionDir = "${buildDir}/generated-version"
sourceSets {
main {
output.dir(generatedVersionDir, builtBy: 'generateVersionProperties')
}
}
task generateVersionProperties {
doLast {
def propertiesFile = file "$generatedVersionDir/version.properties"
propertiesFile.parentFile.mkdirs()
propertiesFile.createNewFile()
// Instead of using a Properties object here, we directly write to the file
// since Properties adds a timestamp, ruining reproducibility
propertiesFile.write("version="+rootProject.version.toString())
}
}
processResources.dependsOn generateVersionProperties
}
def getGitCommit() {

View file

@ -23,6 +23,26 @@ dependencies {
mainClassName = 'org.pgpainless.sop.PGPainlessCLI'
def generatedVersionDir = "${buildDir}/generated-version"
sourceSets {
main {
output.dir(generatedVersionDir, builtBy: 'generateVersionProperties')
}
}
task generateVersionProperties {
doLast {
def propertiesFile = file "$generatedVersionDir/version.properties"
propertiesFile.parentFile.mkdirs()
propertiesFile.createNewFile()
// Instead of using a Properties object here, we directly write to the file
// since Properties adds a timestamp, ruining reproducibility
propertiesFile.write("version="+rootProject.version.toString())
}
}
processResources.dependsOn generateVersionProperties
jar {
manifest {
attributes 'Main-Class': "$mainClassName"