plugins { id 'com.github.johnrengelman.shadow' version '7.1.2' id 'java' id 'checkstyle' id 'org.javamodularity.moduleplugin' version '1.8.14' id 'application' } 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' } // 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")*/ modularity.patchModule("java.scripting", "script-api-1.0.jar") } test { useJUnitPlatform() testLogging { events 'PASSED', 'FAILED', 'SKIPPED', 'STANDARD_OUT' stackTraceFilters = [] } } // Common dependencies 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.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' } } //tasks.register('serializeEngines') { // dependsOn ':core:serializeEngines' //} jar { archiveBaseName.set('OpenRocket') manifest { attributes ( 'Description': 'Model-rocketry aerodynamics and trajectory simulation software', 'SplashScreen-Image': 'pix/splashscreen.png', // Versioning 'Implementation-Version': props['build.version'], // Vendor Details 'Implementation-Vendor': 'OpenRocket', 'Implementation-Vendor-Id': 'info.openrocket', 'Implementation-URL': 'https://openrocket.info/', ) } } dependencies { implementation(project(":core")) implementation(project(":swing")) } shadowJar { archiveBaseName.set('OpenRocket') archiveClassifier.set('') archiveVersion.set(props['build.version']) } shadowJar.dependsOn(['jar']) //shadowJar.dependsOn([':core:serializeEngines']) // Packages the application for distribution. tasks.register('dist') { group = 'info.openrocket' dependsOn 'shadowJar' doLast { println "Completed the deployable jar in './build/libs" } }