-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
229 lines (208 loc) · 6.43 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
import java.util.zip.ZipFile
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java library project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/8.1.1/userguide/building_java_projects.html
*/
buildscript {
repositories {
gradlePluginPortal()
mavenCentral()
}
}
plugins {
id 'java'
id 'application'
id 'eclipse'
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
id 'org.openjfx.javafxplugin' version '0.0.13'apply false
}
// Only apply to the root project
if (project == rootProject) {
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'org.openjfx.javafxplugin'
}
allprojects {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'eclipse'
sourceCompatibility = 1.8
targetCompatibility = 1.8
eclipse {
classpath {
downloadSources = true
downloadJavadoc = true
file {
whenMerged {
entries.forEach { entry ->
if (entry.kind == 'lib') {
entry.entryAttributes['module'] = 'true'
}
}
}
}
}
jdt {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:deprecation' << '-Xlint:unchecked'
}
}
subprojects { subproject ->
subproject.afterEvaluate {
if (subproject.plugins.hasPlugin('com.github.johnrengelman.shadow')) {
subproject.tasks.matching { it.name == 'shadowJar' }.all {
System.out.println("Disabling Shadowjar for "+it)
it.enabled = false
}
}
}
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
maven {
url "https://repository.ow2.org/nexus/content/repositories/public/"
allowInsecureProtocol = true
}
maven {
url 'https://commonwealthrobotics.com/jcenter-mirror/'
allowInsecureProtocol = true
}
}
java {
//modularity.inferModulePath.set(true)
}
dependencies {
implementation project(':BowlerStudio:libraries:bowler-script-kernel:java-bowler')
implementation project(':BowlerStudio:libraries:bowler-script-kernel:GithubPasswordManager:GithubPasswordManager')
implementation project(':BowlerStudio:libraries:bowler-script-kernel')
implementation project(':BowlerStudio:libraries:dockfx')
implementation project(':BowlerStudio')
// Use JUnit Jupiter for testing.
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:31.1-jre'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'org.openjfx:javafx-controls:17'
implementation 'org.openjfx:javafx-fxml:17'
implementation 'org.openjfx:javafx-graphics:17'
// Jaxb moved out of system path in Java 9
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'org.glassfish.jaxb:jaxb-runtime:2.3.1'
implementation('org.fxyz3d:fxyz3d:0.6.0') {
exclude group: 'eu.mihosoft.vrl.jcsg', module: 'jcsg'
//eu.mihosoft.vvecmath:vvecmath
exclude group: 'eu.mihosoft.vvecmath', module: 'vvecmath'
}
// Zip and unzip, tar and untar
implementation 'org.apache.commons:commons-compress:1.26.2'
}
javafx {
version = '17' // or whichever version you're using
modules = [
'javafx.controls',
'javafx.fxml',
'javafx.graphics'] // add other modules as needed
}
tasks.withType(Test) {
useJUnitPlatform()
jvmArgs '--add-opens', 'java.base/java.lang=ALL-UNNAMED'
}
def javafxOptions = [
'--add-exports', 'javafx.graphics/com.sun.javafx.css=ALL-UNNAMED',
'--add-exports', 'javafx.controls/com.sun.javafx.scene.control.behavior=ALL-UNNAMED',
'--add-exports', 'javafx.controls/com.sun.javafx.scene.control=ALL-UNNAMED',
'--add-exports', 'javafx.base/com.sun.javafx.event=ALL-UNNAMED',
'--add-exports', 'javafx.controls/com.sun.javafx.scene.control.skin.resources=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.util=ALL-UNNAMED',
'--add-exports', 'javafx.graphics/com.sun.javafx.scene.input=ALL-UNNAMED',
'--add-opens','javafx.graphics/javafx.scene=ALL-UNNAMED',
'--add-opens','java.base/java.io=ALL-UNNAMED',
'--add-opens','java.base/java.lang=ALL-UNNAMED'
]
run {
jvmArgs = javafxOptions
}
application {
// Define the main class for the application.
mainClass = 'com.commonwealthrobotics.Main'
applicationDefaultJvmArgs =javafxOptions
}
tasks.withType(JavaCompile) {
options.compilerArgs += [
'--add-modules', 'ALL-MODULE-PATH',
'--add-opens', 'java.base/java.lang=ALL-UNNAMED',
'--add-opens', 'java.base/java.io=ALL-UNNAMED'
]+javafxOptions
}
tasks.named('test') {
// Use JUnit Platform for unit tests.
useJUnitPlatform()
}
shadowJar {
archiveBaseName.set('CaDoodle-Application')
archiveClassifier.set('')
archiveVersion.set('')
zip64 true
mergeServiceFiles()
}
jar {
jar.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes 'Implementation-Title': 'CaDoodle-Application',
'Implementation-Version': '0.0.1',
'Main-Class': 'com.commonwealthrobotics.Main'
}
}
tasks.withType(Copy) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
compileJava {
options.compilerArgs += javafxOptions
}
eclipse {
classpath {
downloadSources = true
downloadJavadoc = true
file {
whenMerged { classpath ->
classpath.entries.removeAll { it.kind == "con" && it.path.contains("org.eclipse.jdt.launching.JRE_CONTAINER") }
classpath.entries.add(new org.gradle.plugins.ide.eclipse.model.Container("org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17/"))
classpath.entries.findAll { it.kind == 'con' && it.path.startsWith('org.eclipse.jdt.launching.JRE_CONTAINER') }.each {
it.entryAttributes['module'] = 'true'
def addExports = []
def addOpens = []
for(int i=0; i<javafxOptions.size(); i++) {
if(javafxOptions.get(i).contains("add-opens"))
addOpens << javafxOptions.get(i+1)
if(javafxOptions.get(i).contains("add-exports"))
addExports << javafxOptions.get(i+1)
}
it.entryAttributes['add-exports'] = addExports.join(':')
it.entryAttributes['add-opens'] = addOpens.join(':')
}
}
}
}
jdt {
sourceCompatibility = 1.8
targetCompatibility = 1.8
file {
withProperties { properties ->
properties.setProperty('org.eclipse.jdt.core.compiler.problem.forbiddenReference', 'ignore')
}
}
}
}