Skip to content

Commit bc546b1

Browse files
committed
Add build properties (noCompress, noConsole, installerType)
1 parent 8839ea4 commit bc546b1

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

build.gradle

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,16 @@ test {
9696
}
9797

9898
jlink {
99-
addOptions '--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages', '--strip-native-commands',
100-
'--dedup-legal-notices=error-if-not-same-content'
99+
if (findProperty('noCompress') != 'true') {
100+
addOptions '--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages', '--strip-native-commands',
101+
'--dedup-legal-notices=error-if-not-same-content'
102+
}
101103
launcher {
102104
jvmArgs = [ '-Djar.directory={{BIN_DIR}}' ]
103105
jvmArgs.addAll addExports
104-
noConsole = true
106+
if (findProperty("noConsole") != 'false') {
107+
noConsole = true
108+
}
105109
}
106110
jpackage {
107111
imageOptions = [ '--copyright', copyright, '--description', description]
@@ -123,6 +127,9 @@ jlink {
123127
'--linux-rpm-license-type', 'GPLv3'
124128
icon = "${projectDir}/src/main/resources/airsquared/blobsaver/app/blob_emoji.png"
125129
}
130+
if (findProperty('installerType') != null) {
131+
installerType = findProperty('installerType')
132+
}
126133
}
127134
if (os.isMacOsX()) jpackageImage.doLast {
128135
copy {
@@ -154,9 +161,13 @@ jlink {
154161

155162
}
156163

157-
if (!os.isWindows()) {
164+
if (!os.isWindows() && findProperty('installerType') != "tar.gz") {
158165
assemble.dependsOn jpackage
159166
}
167+
if (findProperty('installerType') == "tar.gz") {
168+
jpackage.enabled = false
169+
assemble.dependsOn createLinuxTargz
170+
}
160171

161172
task createLinuxTargz(type: Tar, dependsOn: jpackageImage) {
162173
archiveFileName = "blobsaver-${project.version}.tar.gz"
@@ -185,7 +196,7 @@ task windowsInstaller(dependsOn: jpackageImage) { // requires inno setup to be i
185196
delete "${buildDir}/jpackage/blobsaver.iss"
186197
}
187198

188-
if (os.isWindows()) {
199+
if (os.isWindows() && findProperty('installerType') != "portable") {
189200
assemble.dependsOn windowsInstaller
190201
}
191202
}

0 commit comments

Comments
 (0)