@@ -10,7 +10,7 @@ plugins {
1010 id(" edu.sc.seis.launch4j" ) version " 2.5.1"
1111}
1212
13- version = " 0 .0.2 "
13+ version = " 1 .0.0 "
1414
1515val packageName = " ${name} -${version} "
1616
@@ -22,8 +22,8 @@ repositories {
2222 maven {
2323 url = uri(" https://maven.pkg.github.com/SleipnirGroup/TrajoptLib" )
2424 credentials {
25- username = " jlbabilino "
26- password = " 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 "
25+ username = project.properties[ " mvnUsername " ].toString()
26+ password = project.properties[ " mvnPassword " ].toString()
2727 }
2828 }
2929}
@@ -51,41 +51,32 @@ javafx {
5151 modules = listOf (" javafx.controls" )
5252}
5353
54- // shadowJar {
55- // // minimize( )
54+ tasks.register( " jpackage " ) {
55+ dependsOn( " shadowJar " )
5656
57- // // archiveClassifier.set("")
58- // }
57+ val os = System .getProperty(" os.name" ).toLowerCase();
5958
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 = " " ;
6760
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+ }
7068
7169 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"
7970 project.exec {
8071 commandLine(" jpackage" ,
81- " --input" , jarDir,
82- " --java-options" , javaOptions,
83- " --main-jar" , jarName,
72+ " --input" , " ${buildDir} /libs" ,
73+ " --main-jar" , " ${packageName} -all.jar" ,
8474 " --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" ,
8980 )
9081 }
9182 }
0 commit comments