109 lines
3.3 KiB
Groovy
109 lines
3.3 KiB
Groovy
//// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
|
|
plugins {
|
|
id 'com.github.johnrengelman.shadow' version '7.1.2'
|
|
id 'java'
|
|
id 'checkstyle'
|
|
id 'org.javamodularity.moduleplugin' version '1.8.14'
|
|
}
|
|
|
|
java {
|
|
// Must be disabled in order to use the gradle-modules-plugin
|
|
modularity.inferModulePath = false
|
|
}
|
|
|
|
/*moduleOptions {
|
|
addModules = ['java.scripting']
|
|
}*/
|
|
|
|
// Fetch the build version from the build.properties file
|
|
Properties props = new Properties()
|
|
try {
|
|
props.load(file('./core/src/main/resources/build.properties').newDataInputStream())
|
|
} catch (Exception ex) {
|
|
throw new Exception("Missing build.properties. file: " + ex.getMessage())
|
|
}
|
|
|
|
allprojects {
|
|
group 'info.openrocket'
|
|
version = props['build.version']
|
|
|
|
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("hamcrest", "hamcrest-2.2.jar")
|
|
modularity.patchModule("hamcrest.core", "hamcrest-core-2.2.jar")
|
|
modularity.patchModule("hamcrest.library", "hamcrest-library-2.2.jar")
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
|
|
testLogging {
|
|
events 'PASSED', 'FAILED', 'SKIPPED', 'STANDARD_OUT'
|
|
stackTraceFilters = []
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// Common dependencies
|
|
testImplementation group: 'org.hamcrest', name: 'hamcrest', version: '2.2'
|
|
testImplementation group: 'org.hamcrest', name: 'hamcrest-core', version: '2.2'
|
|
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.2'
|
|
//testImplementation group: 'org.hamcrest', name: 'hamcrest-internal', version: '2.2'
|
|
//testImplementation group: 'org.hamcrest', name: 'hamcrest-xml', version: '2.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.mockito', name: 'mockito-core', version: '5.10.0'
|
|
testImplementation group: 'org.mockito', name: 'mockito-junit-jupiter', version: '5.10.0'
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation project(':core')
|
|
implementation project(':swing')
|
|
}
|
|
|
|
//tasks.register('serializeEngines') {
|
|
// dependsOn ':core:serializeEngines'
|
|
//}
|
|
|
|
jar {
|
|
archiveBaseName.set('OpenRocket')
|
|
|
|
manifest {
|
|
attributes (
|
|
'Main-Class': 'info.openrocket.swing.startup.OpenRocket',
|
|
'SplashScreen-Image': 'pix/splashscreen.png'
|
|
)
|
|
}
|
|
}
|
|
|
|
shadowJar {
|
|
archiveBaseName.set('OpenRocket')
|
|
archiveClassifier.set(null)
|
|
}
|
|
|
|
//shadowJar.dependsOn([':core:serializeEngines'])
|
|
|
|
// Packages the application for distribution.
|
|
tasks.register('dist') {
|
|
group = 'openrocket'
|
|
dependsOn 'shadowJar'
|
|
doLast {
|
|
println "Completed the deployable jar in './build/libs"
|
|
}
|
|
} |