Skip to content

Commit

Permalink
cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
HanSolo committed Sep 27, 2021
1 parent ec329a5 commit 795614a
Showing 1 changed file with 33 additions and 10 deletions.
43 changes: 33 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ dependencies {
implementation "org.openjfx:javafx-media:${javafxVersion}:${platform}"
}

mainClassName = "$moduleName/eu.hansolo.spacefx.SpaceFX"
ext.moduleName = 'eu.hansolo.spacefx'
mainClassName = '$moduleName/eu.hansolo.spacefx.Launcher'

jar {
from {
Expand All @@ -46,25 +47,22 @@ jar {
exclude "META-INF/*.RSA"
}
manifest {
attributes ('Implementation-Title': 'SpaceFX',
'Class-Path': 'SpaceFX-17.0.0.jar ',
'Main-Class': 'eu.hansolo.spacefx.Launcher')
attributes(
'Implementation-Title': 'SpaceFX',
'Class-Path': 'SpaceFX-17.0.0.jar',
'Main-Class': 'eu.hansolo.spacefx.Launcher'
)
}
}


jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = 'eu.hansolo.spacefx'
}
}

// start the from gradle
task Main(type: JavaExec) {
main = "eu.hansolo.spacefx.Launcher"
classpath = sourceSets.main.runtimeClasspath
}

tasks.withType(JavaCompile) {
options.compilerArgs += "--enable-preview"
}
Expand All @@ -74,3 +72,28 @@ tasks.withType(Test) {
tasks.withType(JavaExec) {
jvmArgs += "--enable-preview"
}

// start the from gradle
task Main(type: JavaExec) {
main = "eu.hansolo.spacefx.Launcher"
classpath = sourceSets.main.runtimeClasspath
}

sourceSets {
main {
//output.setResourcesDir(java.outputDir)
output.resourcesDir = file('build/classes/java/main')
java.destinationDirectory.set(file('build/classes/java/main'))
}
}

run {
inputs.property("moduleName", moduleName)
doFirst {
jvmArgs = [
'--module-path', classpath.asPath,
'--module', mainClassName
]
classpath = files()
}
}

0 comments on commit 795614a

Please sign in to comment.