-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
134 lines (114 loc) · 4.39 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.8'
id "io.freefair.lombok" version "5.0.0-rc6"
}
repositories {
mavenCentral()
maven {
url = 'https://artifactory.cronapp.io/public-release/'
}
maven {
url = 'https://jitpack.io'
}
}
if (javafxPlatform == "unspecified") {
switch (org.gradle.internal.os.OperatingSystem.current()) {
case org.gradle.internal.os.OperatingSystem.LINUX:
project.ext.javafxPlatform = "linux"
break
case org.gradle.internal.os.OperatingSystem.MAC_OS:
project.ext.javafxPlatform = "mac"
break
case org.gradle.internal.os.OperatingSystem.WINDOWS:
project.ext.javafxPlatform = "win"
break
}
}
println "Platform is: ${javafxPlatform}"
dependencies {
testCompileOnly 'org.projectlombok:lombok:1.18.10'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.10'
implementation 'org.jetbrains:annotations:13.0'
implementation 'org.locationtech.jts:jts-core:1.16.1'
implementation 'ch.qos.logback:logback-core:1.2.3'
implementation 'ch.qos.logback:logback-classic:1.2.3'
implementation 'org.slf4j:slf4j-api:1.7.8'
implementation 'org.jfree:fxgraphics2d:1.7'
implementation 'org.reflections:reflections:0.9.11'
implementation 'com.esotericsoftware:kryo:4.0.2'
implementation 'com.github.Fylipp:easy-events:v1.1.0'
implementation 'org.decimal4j:decimal4j:1.0.3'
implementation 'info.picocli:picocli:4.1.4'
implementation 'me.tongfei:progressbar:0.8.0'
implementation 'com.opencsv:opencsv:4.1'
implementation 'org.javatuples:javatuples:1.2'
testCompile 'org.mockito:mockito-core:3.0.0'
testCompile group: 'org.testfx', name: 'testfx-junit', version: '4.0.8-alpha'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2'
testCompile("org.junit.jupiter:junit-jupiter-params:5.4.2")
compile("org.openjfx:javafx-base:${javafxVersion}:${javafxPlatform}")
compile("org.openjfx:javafx-controls:${javafxVersion}:${javafxPlatform}")
compile("org.openjfx:javafx-graphics:${javafxVersion}:${javafxPlatform}")
compile("org.openjfx:javafx-fxml:${javafxVersion}:${javafxPlatform}")
compile("org.openjfx:javafx-swing:${javafxVersion}:${javafxPlatform}")
}
project.version = project.projVersion.replace('v', '')
distZip {
archiveName "${project.name}-v${project.version}-${javafxPlatform}.zip"
}
distTar {
archiveName "${project.name}-v${project.version}-${javafxPlatform}.tar"
}
test {
useJUnitPlatform()
}
javadoc{
options.addBooleanOption "-no-module-directories", true
}
lombok {
version = "1.18.10"
}
generateLombokConfig.enabled = false
javafx {
version = "${javafxVersion}"
modules = ['javafx.base', 'javafx.controls', 'javafx.fxml', 'javafx.graphics', 'javafx.swing']
/**
* https://github.com/openjfx/javafx-gradle-plugin
* JavaFX modules require native binaries for each platform. The plugin only includes binaries for the platform
* running the build. By declaring the dependency configuration compileOnly, the native binaries will not be
* included. You will need to provide those separately during deployment for each target platform.
*/
configuration = 'compileOnly'
}
mainClassName = 'com.treasure.hunt.Main'
group = 'com.treasure'
description = 'hunt'
sourceCompatibility = '11'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
jar {
manifest {
attributes 'Main-Class': 'com.treasure.hunt.Main',
'Implementation-Version': project.version
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
// This fixes signature issues by removing all signatures
doFirst {
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
}
exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
}
// This fixes the "line too long" error when running the .bat with windows CLI
tasks.withType(CreateStartScripts).each { task ->
task.doLast {
String text = task.windowsScript.text
// Replaces the per file classpath (which are all jars in "lib") with a wildcard on lib
text = text.replaceFirst(/(set CLASSPATH=%APP_HOME%\\lib\\).*/, { "${it[1]}*" })
task.windowsScript.write text
}
}