-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
104 lines (84 loc) · 2.93 KB
/
build.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/4.10/userguide/tutorial_java_projects.html
*/
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building an application
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.11'
//id 'com.dua3.javafxgradle7plugin' version '0.0.9'
id 'org.beryx.jlink' version '2.23.1'
}
sourceCompatibility = 11
targetCompatibility = 11
// Define the main class for the application
mainClassName = 'dk.aau.cs.ds306e18.tournament.Main'
version = '1.8.3'
applicationDefaultJvmArgs = [
'--add-opens=java.base/java.io=com.google.gson',
'--add-opens=java.base/java.util=com.google.gson',
]
dependencies {
// This dependency is found on compile classpath of this component and consumers.
implementation 'com.google.guava:guava:26.0-jre'
// Using GSON for serializing objects for transfer and storage
implementation 'com.google.code.gson:gson:2.8.9'
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
implementation('org.controlsfx:controlsfx:11.0.3') {
exclude group: 'org.openjfx'
}
}
application {
mainModule = 'cleopetra'
}
javafx {
version = '11'
modules = ['javafx.controls', 'javafx.fxml']
}
// In this section you declare where to find the dependencies of your project
repositories {
mavenCentral()
}
jlink {
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
launcher {
name = 'CleoPetra'
jvmArgs = [
'--add-opens=java.base/java.io=com.google.gson',
'--add-opens=java.base/java.util=com.google.gson',
]
}
// A lot of this stuff was borrowed from the example at https://github.com/beryx-gist/badass-jlink-example-richtextfx/blob/master/build.gradle
jpackage {
skipInstaller = false
installerType = 'msi'
icon = 'src/main/resources/cleopetra.ico'
installerOptions = ['--win-menu', '--win-shortcut', '--win-dir-chooser', '--win-per-user-install',
'--file-associations', 'src/main/resources/associations.properties',
'--app-version', version]
}
}
// Setup modules
sourceSets {
main.resources.srcDirs = ['src/main/java']
test.resources.srcDirs = ['src/test/java']
}
// Build a fat/uber jar
task fatJar(type: Jar) {
manifest {
attributes 'Main-Class': 'dk.aau.cs.ds306e18.tournament.Main'
}
archiveClassifier = 'fat'
from sourceSets.main.output
dependsOn configurations.runtimeClasspath
duplicatesStrategy(DuplicatesStrategy.INCLUDE)
from {
configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
}
}