forked from bardsoftware/ganttproject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.gradle
55 lines (48 loc) · 1.78 KB
/
package.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Open Source Software published under the Apache Licence, Version 2.0.
*/
import org.gradle.internal.os.OperatingSystem
plugins {
id "de.undercouch.download" version "3.4.3"
}
ext {
currentOs = OperatingSystem.current()
}
task downloadZipFile(type: Download) {
def srcFile = ""
if (project.ext.currentOs.isWindows()) {
srcFile = 'https://gluonhq.com/download/javafx-11-0-2-jmods-windows/'
} else if (currentOs.isLinux()) {
srcFile = 'https://gluonhq.com/download/javafx-11-0-2-jmods-linux/'
} else if (currentOs.isMacOsX()) {
srcFile = 'https://gluonhq.com/download/javafx-11-0-2-jmods-mac/'
}
println("Downloading JavaFX mods for $currentOs from $srcFile")
src srcFile
dest new File(buildDir, 'javafx-jmods-11.zip')
}
task installJavafxJmods(dependsOn: downloadZipFile, type: Copy) {
from zipTree(downloadZipFile.dest)
into buildDir
}
task build(dependsOn: installJavafxJmods) {
doLast {
if (project.ext.currentOs.isLinux()) {
exec {
workingDir '.'
commandLine 'build-bin/package-lin.sh', 'build', 'ganttproject-builder/dist-bin', '2.99.0', 'build/javafx-jmods-11.0.2'
}
} else if (project.ext.currentOs.isWindows()) {
exec {
workingDir '.'
environment("PWD", System.getProperty("user.dir"))
commandLine 'build-bin\\package-win.bat', 'build', 'ganttproject-builder\\dist-bin', '2.99.0', 'build\\javafx-jmods-11.0.2'
}
} else if (project.ext.currentOs.isMacOsX()) {
exec {
workingDir '.'
commandLine 'build-bin/package-mac.sh', 'build', 'ganttproject-builder/dist-bin', '2.99.0', 'build/javafx-jmods-11.0.2'
}
}
}
}