openrocket/build.gradle

114 lines
3.3 KiB
Groovy
Raw Normal View History

2023-04-18 21:48:26 -05:00
plugins {
2024-02-21 15:41:22 +01:00
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'java'
id 'checkstyle'
2024-02-25 04:11:37 +01:00
id 'org.javamodularity.moduleplugin' version '1.8.14'
2024-02-29 23:10:04 +01:00
id 'application'
2023-04-18 21:48:26 -05:00
}
2024-03-23 02:04:40 +01:00
// Java settings
2024-02-22 19:49:55 +01:00
java {
2024-02-25 04:11:37 +01:00
// Must be disabled in order to use the gradle-modules-plugin
modularity.inferModulePath = false
2024-02-22 19:49:55 +01:00
}
2024-02-29 23:10:04 +01:00
application {
mainModule = 'info.openrocket.swing'
mainClass = 'info.openrocket.swing.startup.OpenRocket'
}
2024-02-25 04:11:37 +01:00
// Fetch the build version from the build.properties file
2024-03-23 02:04:40 +01:00
def buildProperties = new Properties()
file('core/src/main/resources/build.properties').withInputStream { buildProperties.load(it) }
group = 'info.openrocket'
version = buildProperties['build.version']
2023-04-18 21:48:26 -05:00
2024-03-23 02:04:40 +01:00
// Common project configuration
2023-04-18 21:48:26 -05:00
allprojects {
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
2024-02-22 19:49:55 +01:00
maven { url "https://jogamp.org/deployment/maven/" }
2023-04-18 21:48:26 -05:00
}
}
2024-02-25 04:11:37 +01:00
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")
2024-02-25 04:11:37 +01:00
}
test {
useJUnitPlatform()
testLogging {
events 'PASSED', 'FAILED', 'SKIPPED', 'STANDARD_OUT'
2024-03-23 02:04:40 +01:00
exceptionFormat = 'full'
showStackTraces = true
2024-02-25 04:11:37 +01:00
stackTraceFilters = []
}
}
2024-02-27 02:53:28 +01:00
// Common dependencies
2024-02-25 04:11:37 +01:00
dependencies {
2024-03-23 02:04:40 +01:00
implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '4.0.2'
2024-02-25 04:11:37 +01:00
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.mockito', name: 'mockito-core', version: '5.10.0'
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.10.0'
}
}
2023-04-18 21:48:26 -05:00
//tasks.register('serializeEngines') {
// dependsOn ':core:serializeEngines'
//}
2024-03-23 02:04:40 +01:00
// JAR config
2023-04-18 21:48:26 -05:00
jar {
2024-02-25 04:11:37 +01:00
archiveBaseName.set('OpenRocket')
2023-04-18 21:48:26 -05:00
manifest {
attributes (
'Description': 'Model-rocketry aerodynamics and trajectory simulation software',
'SplashScreen-Image': 'pix/splashscreen.png',
// Versioning
2024-03-23 02:04:40 +01:00
'Implementation-Version': buildProperties['build.version'],
// Vendor Details
'Implementation-Vendor': 'OpenRocket',
'Implementation-Vendor-Id': 'info.openrocket',
'Implementation-URL': 'https://openrocket.info/',
2023-04-18 21:48:26 -05:00
)
}
}
2024-03-23 02:04:40 +01:00
// Project dependencies
2024-02-27 05:43:34 +01:00
dependencies {
implementation(project(":core"))
implementation(project(":swing"))
}
2023-04-18 21:48:26 -05:00
shadowJar {
2024-02-25 04:11:37 +01:00
archiveBaseName.set('OpenRocket')
2024-03-23 02:04:40 +01:00
archiveVersion.set(buildProperties['build.version'])
archiveClassifier.set('')
2023-04-18 21:48:26 -05:00
}
//shadowJar.dependsOn([':core:serializeEngines'])
2024-03-23 02:04:40 +01:00
// Package the application for distribution.
2023-05-06 11:18:35 -05:00
tasks.register('dist') {
2024-02-27 05:43:34 +01:00
group = 'info.openrocket'
2023-04-18 21:48:26 -05:00
dependsOn 'shadowJar'
doLast {
println "Completed the deployable jar in './build/libs"
}
}