Skip to content

Commit

Permalink
update deprecated variable $buildDir
Browse files Browse the repository at this point in the history
  • Loading branch information
astrapisixtynine committed Jun 12, 2024
1 parent d40fd13 commit 8b9098b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
6 changes: 4 additions & 2 deletions gradle/izpack.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

izpack {
baseDir = file("$buildDir")
DirectoryProperty buildDirectoryProperty = layout.buildDirectory
String buildDirectory = buildDirectoryProperty.get()
baseDir = file("$buildDirectory")
installFile = file("src/main/izpack/install.xml")
outputFile = file("$buildDir/distributions/$rootProject.name-${projectVersion}-installer.jar")
outputFile = file("$buildDirectory/distributions/$rootProject.name-${projectVersion}-installer.jar")
compression = "deflate"
compressionLevel = 9
appProperties = ["app.group": "$groupPackage",
Expand Down
35 changes: 32 additions & 3 deletions gradle/packaging.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jar {
}

jar.doLast {
DirectoryProperty buildDirectoryProperty = layout.buildDirectory
String buildDirectory = buildDirectoryProperty.get()
def createIzPackInstallerStringProperty = project.property('createIzPackInstaller')
def createIzPackInstaller = createIzPackInstallerStringProperty.toBoolean()
if (releaseVersion || createIzPackInstaller) {
Expand All @@ -29,20 +31,21 @@ jar.doLast {
def storePassword = project.property("$mysticCryptStorePassword")
def keyPassword = project.property("$mysticCryptKeyPassword")
def keystoreType = project.property("$mysticCryptStoreType")
def libsFilePath = "$buildDir/libs"
def libsFilePath = "$buildDirectory/libs"
def libFiles = files { file(libsFilePath).listFiles() }
def destDir = "$buildDir/signed"
def destDir = "$buildDirectory/signed"
def signedDir = new File(destDir)
signedDir.mkdirs()
libFiles.each {
ant.signjar(
jar: it,
jar: 'build/libs/*.jar',
destDir: "$destDir",
alias: "$pkAlias",
storetype: "$keystoreType",
keystore: "$keystoreFileName",
storepass: "$storePassword",
keypass: "$keyPassword",
verbose: true,
preservelastmodified: "true"
)
}
Expand All @@ -52,6 +55,32 @@ jar.doLast {
}
}

////Signing
//// def jarsignerskip = false
//def keystoreFile = new File('urkeystore.jks')
//def keystorepass = 'keystoreP@@S'
//def keyalias = 'selfSigned'
//
//task signJar(dependsOn: 'jar',description: 'to Sign JAR.',group: 'Build'){
//
// doLast{
// println ":$project.name:${name}"
// def signdir = new File("$buildDir/jars/signed")
// signdir.mkdirs()
// ant.signjar(
// destDir: "${signdir.absolutePath}",
// jar: 'build/jars/*.jar',
// alias:keyalias,
// storetype:"jks",
// keystore:"${keystoreFile.absolutePath}",
// storepass:keystorepass,
// verbose:true,
// preservelastmodified:"true"
// )
// }
//
//}

task withAllDependendiesJar(type: Jar) {
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
manifest.from jar.manifest
Expand Down

0 comments on commit 8b9098b

Please sign in to comment.