@@ -10,7 +10,7 @@ plugins {
10
10
id(" edu.sc.seis.launch4j" ) version " 2.5.1"
11
11
}
12
12
13
- version = " 0 .0.2 "
13
+ version = " 1 .0.0 "
14
14
15
15
val packageName = " ${name} -${version} "
16
16
@@ -22,8 +22,8 @@ repositories {
22
22
maven {
23
23
url = uri(" https://maven.pkg.github.com/SleipnirGroup/TrajoptLib" )
24
24
credentials {
25
- username = " jlbabilino "
26
- password = " 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 "
25
+ username = project.properties[ " mvnUsername " ].toString()
26
+ password = project.properties[ " mvnPassword " ].toString()
27
27
}
28
28
}
29
29
}
@@ -51,41 +51,32 @@ javafx {
51
51
modules = listOf (" javafx.controls" )
52
52
}
53
53
54
- // shadowJar {
55
- // // minimize( )
54
+ tasks.register( " jpackage " ) {
55
+ dependsOn( " shadowJar " )
56
56
57
- // // archiveClassifier.set("")
58
- // }
57
+ val os = System .getProperty(" os.name" ).toLowerCase();
59
58
60
- // launch4j {
61
- // mainClassName = project.mainClassName
62
- // version = project.version
63
- // outfile = "${packageName}.exe"
64
- // bundledJrePath = "C:\\Program Files\\Java\\jdk-17.0.2\\bin"
65
- // jarTask = project.tasks.shadowJar
66
- // }
59
+ var packType = " " ;
67
60
68
- tasks.register(" jpackage" ) {
69
- dependsOn(" shadowJar" )
61
+ if (os.startsWith(" linux" )) {
62
+ packType = " deb" ;
63
+ } else if (os.startsWith(" mac" )) {
64
+ packType = " dmg"
65
+ } else { // windows
66
+ packType = " msi"
67
+ }
70
68
71
69
doLast {
72
- val jarDir = " ${buildDir} /libs"
73
- val jarName = " ${packageName} -all.jar"
74
- val jarFile = " ${buildDir} /libs/${jarName} "
75
- val javaOptions = " -Djava.library.path=\$ APPDIR"
76
- val javaMainClass = " java"
77
- val dest = " ${buildDir} /package"
78
- val iconFile = " ${buildDir} /resources/main/icon.icns"
79
70
project.exec {
80
71
commandLine(" jpackage" ,
81
- " --input" , jarDir,
82
- " --java-options" , javaOptions,
83
- " --main-jar" , jarName,
72
+ " --input" , " ${buildDir} /libs" ,
73
+ " --main-jar" , " ${packageName} -all.jar" ,
84
74
" --main-class" , " org.team2363.helixnavigator.Main" ,
85
- " --dest" , dest,
86
- " --name" , project.name,
87
- " --type" , " dmg" ,
88
- " --icon" , iconFile,
75
+ " --type" , packType,
76
+ " --dest" , " ${buildDir} /package" ,
77
+ " --name" , rootProject.name,
78
+ " --app-version" , version,
79
+ " --icon" , " ${buildDir} /resources/main/icon.icns" ,
89
80
)
90
81
}
91
82
}
0 commit comments