Skip to content

Commit 3e6c568

Browse files
committed
Make modular, introduce jlink
1 parent 51fc872 commit 3e6c568

File tree

5 files changed

+31
-2
lines changed

5 files changed

+31
-2
lines changed

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id 'application'
33
id 'org.openjfx.javafxplugin' version '0.0.8'
4+
id 'org.beryx.jlink' version '2.12.0'
45
}
56

67
repositories {
@@ -12,4 +13,18 @@ javafx {
1213
modules = [ 'javafx.controls' ]
1314
}
1415

15-
mainClassName = 'App'
16+
mainClassName = "$moduleName/com.example.pew.App"
17+
18+
jlink {
19+
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
20+
//javaHome = '/Library/Java/JavaVirtualMachines/adoptopenjdk-12.jdk/Contents/Home'
21+
launcher {
22+
name = 'app'
23+
jvmArgs = ['-Xdock:name="Example App"']
24+
}
25+
}
26+
27+
dependencies {
28+
testCompile group: 'junit', name: 'junit', version: '4.12'
29+
implementation fileTree(dir: 'libs', include: ['*.jar'])
30+
}

src/main/java/App.java renamed to src/main/java/com/example/pew/App.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.example.pew;
2+
13
import javafx.application.Application;
24
import javafx.scene.Scene;
35
import javafx.scene.control.Label;
@@ -9,9 +11,9 @@
911
import java.io.File;
1012

1113
public class App extends Application {
12-
1314
/**
1415
* Attempt listening for APP_OPEN_FILE events as soon as possible.
16+
* *ATTENTION:* This does not work with a shell launcher.
1517
*/
1618
static {
1719
if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.APP_OPEN_FILE)) {

src/main/java/Operator.java renamed to src/main/java/com/example/pew/Operator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
package com.example.pew;
2+
13
import javafx.stage.FileChooser;
24

35
import java.io.File;

src/main/java/module-info.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module pew {
2+
requires javafx.controls;
3+
requires java.desktop;
4+
exports com.example.pew;
5+
}

0 commit comments

Comments
 (0)