forked from openrocket/openrocket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
146 lines (126 loc) · 4.96 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
plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'java'
id 'checkstyle'
id 'org.javamodularity.moduleplugin' version '1.8.15'
id 'application'
}
// Java settings
java {
// Must be disabled in order to use the gradle-modules-plugin
modularity.inferModulePath = false
}
application {
mainModule = 'info.openrocket.swing'
mainClass = 'info.openrocket.swing.startup.OpenRocket'
/*applicationDefaultJvmArgs = [
// Use the system appearance on macOS for the FlatLaf title bar
'-Dapple.awt.application.appearance=system',
// Fix JOGL 3D importing on Windows
'--add-exports',
'java.base/java.lang=ALL-UNNAMED',
'--add-exports',
'java.desktop/sun.awt=ALL-UNNAMED',
'--add-exports',
'java.desktop/sun.java2d=ALL-UNNAMED',
// Fix Windows window ghosting (issue #1667),
'-Dsun.java2d.noddraw=true',
'-Dsun.java2d.d3d=false',
'-Dsun.java2d.ddforcevram=true',
'-Dsun.java2d.ddblit=false',
'-Dswing.useflipBufferStrategy=True'
]*/
}
// Fetch the build version from the build.properties file
def buildProperties = new Properties()
file('core/src/main/resources/build.properties').withInputStream { buildProperties.load(it) }
group = 'info.openrocket'
version = buildProperties['build.version']
// Common project configuration
allprojects {
repositories {
mavenCentral()
maven { url = "https://jitpack.io" }
maven { url = "https://jogamp.org/deployment/maven/" }
}
}
subprojects {
apply plugin: 'java'
apply plugin: "org.javamodularity.moduleplugin"
// Configure the gradle-modules-plugin
modularity {
standardJavaRelease(17) // For targeting Java 17
modularity.patchModule("java.scripting", "script-api-1.0.jar")
}
test {
useJUnitPlatform()
testLogging {
events 'PASSED', 'FAILED', 'SKIPPED', 'STANDARD_OUT'
exceptionFormat = 'full'
showStackTraces = true
stackTraceFilters = []
}
}
// Common dependencies
dependencies {
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '4.0.2'
testImplementation group: 'org.junit.platform', name: 'junit-platform-runner', version: '1.10.2'
testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: '1.10.2'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.10.0'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.10.0'
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.10.0'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.10.0'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.10.0'
}
}
//tasks.register('serializeEngines') {
// dependsOn ':core:serializeEngines'
//}
// JAR config
jar {
archiveBaseName.set('OpenRocket')
manifest {
attributes (
'Description': 'Model-rocketry aerodynamics and trajectory simulation software',
'SplashScreen-Image': 'pix/splashscreen.png',
// Versioning
'Implementation-Version': buildProperties['build.version'],
// Vendor Details
'Implementation-Vendor': 'OpenRocket',
'Implementation-Vendor-Id': 'info.openrocket',
'Implementation-URL': 'https://openrocket.info/',
)
}
}
// Project dependencies
dependencies {
implementation(project(path: ":core", configuration: "default"))
implementation(project(path: ":swing", configuration: "default"))
}
shadowJar {
archiveBaseName.set('OpenRocket')
archiveVersion.set(buildProperties['build.version'])
archiveClassifier.set('')
dependsOn(distTar, distZip)
manifest {
from jar.manifest
attributes(
'Description': 'Model-rocketry aerodynamics and trajectory simulation software',
'SplashScreen-Image': 'pix/splashscreen.png',
'Implementation-Version': buildProperties['build.version'],
'Implementation-Vendor': 'OpenRocket',
'Implementation-Vendor-Id': 'info.openrocket',
'Implementation-URL': 'https://openrocket.info/',
'Add-Exports': 'java.base/java.lang=ALL-UNNAMED java.desktop/sun.awt=ALL-UNNAMED java.desktop/sun.java2d=ALL-UNNAMED',
'JVM-Args': '-Dapple.awt.application.appearance=system -Dsun.java2d.noddraw=true -Dsun.java2d.d3d=false -Dsun.java2d.ddforcevram=true -Dsun.java2d.ddblit=false -Dswing.useflipBufferStrategy=True'
)
}
}
// Package the application for distribution.
tasks.register('dist') {
group = 'info.openrocket'
dependsOn 'shadowJar'
doLast {
println "Completed the deployable jar in './build/libs"
}
}