Skip to content

Commit

Permalink
fix Gradle 8.12 deprecations before moving to Gradle 9
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed Jan 20, 2025
1 parent 4849cf4 commit f72cadf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ subprojects {
}

signing {
required { !isSnapshot }
required = { !isSnapshot }
sign publishing.publications.mavenJava
}

Expand Down
21 changes: 14 additions & 7 deletions jpos/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,16 @@ artifacts {
task dist (type: Tar) {
dependsOn 'jar', 'assemble', 'sourceJar'
compression = Compression.GZIP
includeEmptyDirs true
includeEmptyDirs=true
with jposCopySpec
into "jpos-$project.version"
archiveExtension="tar.gz"
}

task zip (type: Zip) {
dependsOn 'q2jar', 'assemble', 'sourceJar'
includeEmptyDirs true
includeEmptyDirs true
includeEmptyDirs=true
includeEmptyDirs=true
with jposCopySpec
into "jpos-$project.version"
}
Expand Down Expand Up @@ -257,11 +257,14 @@ class BuildTimestampTask extends DefaultTask {
@OutputFile
File outputFile

@Input
String version

@TaskAction
public void writeFile() {
new File(outputFile.parent).mkdirs()
Properties props=new Properties()
props.put("version", project.version);
props.put("version", version);
props.put("buildTimestamp", new Date().format("yyyy-MM-dd HH:mm:ss z"));
props.store(new FileOutputStream(outputFile),"Revision Properties")
}
Expand All @@ -277,16 +280,20 @@ task createRevisionPropertyFile(type: GitRevisionTask) {

task createBuildTimestampPropertyFile(type: BuildTimestampTask) {
outputFile = "$sourceSets.main.output.resourcesDir/org/jpos/q2/buildinfo.properties" as File
version = project.version
}

processResources.dependsOn createBuildTimestampPropertyFile, createRevisionPropertyFile
processResources.outputs.upToDateWhen{ false } // issue with Gradle 2.4 confused about UP-TO-DATE (works OK with 2.3)

task installApp(type: Sync) {
dependsOn q2jar
delete "${project.buildDir}/install/${project.name}/cfg"
description 'Installs jPOS based application'
into { file("${project.buildDir}/install/${project.name}") }
def buildDir = project.buildDir
def projectName = project.name

delete "${buildDir}/install/${projectName}/cfg"
description = 'Installs jPOS based application'
into { file("${buildDir}/install/${projectName}") }
with jposCopySpec
}

Expand Down

0 comments on commit f72cadf

Please sign in to comment.