Skip to content

Commit

Permalink
Some more gradle debugging...
Browse files Browse the repository at this point in the history
  • Loading branch information
SiboVG committed Feb 27, 2024
1 parent 1835cbc commit 5e315c5
Show file tree
Hide file tree
Showing 13 changed files with 265 additions and 62 deletions.
18 changes: 18 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ subprojects {
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'
Expand All @@ -72,11 +70,6 @@ subprojects {
}
}

dependencies {
implementation project(':core')
implementation project(':swing')
}

//tasks.register('serializeEngines') {
// dependsOn ':core:serializeEngines'
//}
Expand All @@ -92,6 +85,11 @@ jar {
}
}

dependencies {
implementation(project(":core"))
implementation(project(":swing"))
}

shadowJar {
archiveBaseName.set('OpenRocket')
archiveClassifier.set(null)
Expand All @@ -101,7 +99,7 @@ shadowJar {

// Packages the application for distribution.
tasks.register('dist') {
group = 'openrocket'
group = 'info.openrocket'
dependsOn 'shadowJar'
doLast {
println "Completed the deployable jar in './build/libs"
Expand Down
39 changes: 8 additions & 31 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ dependencies {
implementation group: 'org.graalvm.sdk', name: 'graal-sdk', version: '23.0.3'
implementation group: 'org.graalvm.js', name: 'js-scriptengine', version: '23.0.3'
implementation group: 'org.graalvm.js', name: 'js', version: '23.0.3'
//implementation group: 'javax.script', name: 'script-api', version: '1.0-osgi'
implementation group: 'org.graalvm.truffle', name: 'truffle-api', version: '23.0.3'
implementation group: 'com.ibm.icu', name: 'icu4j', version: '71.1' // 72.1
implementation group: 'com.sun.istack', name: 'istack-commons-tools', version: '4.1.1' // TODO: Should be gotten rid of?
implementation group: 'com.sun.istack', name: 'istack-commons-runtime', version: '4.1.1' // TODO: Should be gotten rid of?
//implementation group: 'com.sun.istack', name: 'istack-commons-tools', version: '4.1.1' // TODO: Should be gotten rid of?
//implementation group: 'com.sun.istack', name: 'istack-commons-runtime', version: '4.1.1' // TODO: Should be gotten rid of?
implementation group: 'io.github.classgraph', name: 'classgraph', version: '4.8.165'

implementation 'de.javagl:obj:0.4.0'
Expand All @@ -67,17 +66,17 @@ def serializedEnginesPath = './src/main/resources/datafiles/thrustcurves/thrustc
def serializedEnginesPathDist = './build/resources/main/datafiles/thrustcurves/thrustcurves.ser'
// Executes the serialization of engines from ThrustCurve for a build.
tasks.register('serializeEngines') {
group = 'openrocket'
group = 'info.openrocket'
dependsOn serializeEnginesDelete
dependsOn serializeEnginesExecute
}
tasks.register('serializeEnginesDist') {
group = 'openrocket'
group = 'info.openrocket'
dependsOn serializeEnginesExecuteDist
}
// Deletes the serialize engine file if it exists.
tasks.register('serializeEnginesDelete', Delete) {
group = 'openrocket'
group = 'info.openrocket'
delete fileTree(serializedEnginesPath)

doFirst {
Expand All @@ -89,7 +88,7 @@ tasks.register('serializeEnginesDelete', Delete) {
}
// Executes the Java serialization program to fetch ThrustCurve rocket data and serialize it.
tasks.register('serializeEnginesExecute', JavaExec) {
group = 'openrocket'
group = 'info.openrocket'
dependsOn serializeEnginesDelete
workingDir new File(projectDir, 'build/tmp')
classpath = sourceSets.main.runtimeClasspath
Expand All @@ -108,7 +107,7 @@ tasks.register('serializeEnginesExecute', JavaExec) {
// TODO: Shouldn't need a seperate task, but the args are not changing when dynamically updating
// the variable.
tasks.register('serializeEnginesExecuteDist', JavaExec) {
group = 'openrocket'
group = 'info.openrocket'
dependsOn serializeEnginesDelete
workingDir new File(projectDir, 'build/tmp')
classpath = sourceSets.main.runtimeClasspath
Expand All @@ -124,7 +123,7 @@ tasks.register('serializeEnginesExecuteDist', JavaExec) {
}
// Validates that the serialize engines file exists.
tasks.register('serializeEnginesValidate') {
group = 'openrocket'
group = 'info.openrocket'
if (!project.file(serializedEnginesPath).exists()) {
def message = "The serialized engine file does not exist at the following location:\n${project.file(serializedEnginesPath)}.\n" +
"You will need to run the following from the command line in order to generate the serialized engine file:\n"
Expand All @@ -149,25 +148,3 @@ tasks.register('copyReadmeMain', Copy) {

processResources.dependsOn([copyReadmeMain])
//processResources.dependsOn([serializeEnginesValidate])

// https://docs.gradle.org/7.4/userguide/cross_project_publications.html
tasks.register('testCoreArtifactsJar', Jar) {
archiveClassifier.set("tests")
from sourceSets.test.output
exclude "**/META-INF", "**/pix", "**/arch", "**/communication", "**/database", "**/file", "**/l10n", "**/models", "**/motor", "**/optimization", "**/plugin", "**/preset", "**/rocketcomponent", "**/simulation", "**/startup", "**/unit"
include "**/ServicesForTesting.class", "**/util/BaseTestCase.class"
}

// https://docs.gradle.org/7.4/userguide/cross_project_publications.html
configurations {
testArtifacts {
canBeConsumed = true
canBeResolved = false
extendsFrom testImplementation
}
}

// https://docs.gradle.org/7.4/userguide/cross_project_publications.html
artifacts {
testArtifacts(testCoreArtifactsJar)
}
Binary file removed core/libs/script-api-1.0.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion core/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open module openrocket.core {
open module info.openrocket.core {
uses javax.script.ScriptEngineFactory;
uses javax.script.ScriptEngine;
uses javax.script.Bindings;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ private void compareSims(Simulation simExpected, Simulation simActual, double de
Assertions.fail("Simulation failed: " + e);
}
}

private static double calculateDelta(double value, double delta) {
return Double.isNaN(value) ? 0 : value * delta;
}
Expand Down
6 changes: 3 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pluginManagement {
id("com.github.johnrengelman.shadow") version "7.1.2"
}
}
rootProject.name = 'OpenRocket'
rootProject.name = 'info.openrocket'

include 'core'
include 'swing'
include ':core'
include ':swing'
19 changes: 6 additions & 13 deletions swing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ java {
modularity.inferModulePath = false
}

jar { from('resources') { include 'META-INF/services/*.*' } }

Properties props = new Properties()
try {
props.load(file('../core/src/main/resources/build.properties').newDataInputStream())
Expand Down Expand Up @@ -93,25 +91,20 @@ dependencies {

// implementation 'com.github.oshi:oshi-core:6.4.4'

implementation group: 'com.yuvimasory', name: 'orange-extensions', version: '1.3.0'
implementation group: 'ch.qos.logback', name: 'logback-core', version: '1.5.0'
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.5.0'
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'

implementation group: 'org.jogamp.gluegen', name: 'gluegen-rt-main', version:'2.5.0'
implementation group: 'org.jogamp.jogl', name: 'jogl-all-main', version: '2.5.0'

// TODO: Including output from coreotherwise NoClassDefFound issue with BaseTestCase
// The Cross Project Publications should work, but not seeming too.
testImplementation project(':core').sourceSets.test.output
testImplementation project (path: ':core', configuration: 'testArtifacts')
testImplementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
testImplementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.5.0'
}

def externalComponentsPath = './src/main/resources/datafiles/components'
// Copies the external components to the Swing resource folder.
tasks.register('externalComponentsCopy', Copy) {
group = 'openrocket'
group = 'info.openrocket'
dependsOn 'externalComponentsValidate'
// gradle always performs up-to-date check which causes copying be skipped.
from('./resources-src/datafiles/components-openrocket') {
Expand All @@ -127,13 +120,13 @@ tasks.register('externalComponentsCopy', Copy) {
}
// Deletes the external components resource folder.
tasks.register('externalComponentsDelete', Delete) {
group = 'openrocket'
group = 'info.openrocket'
delete fileTree(externalComponentsPath)
}
// Validates the external components resource folder. If it is a Git project, then
// calls the submodule updates to fetch the latest submodules.
tasks.register('externalComponentsValidate') {
group = 'openrocket'
group = 'info.openrocket'
def externalResourceComponents = './resources-src/datafiles/components-dbcook/orc';
def git = '../.git';
if (!project.file(externalResourceComponents).exists()) {
Expand Down Expand Up @@ -164,7 +157,7 @@ tasks.register('externalComponentsValidate') {

// Initializes the submodules in Git.
tasks.register('submoduleInit') {
group = 'openrocket'
group = 'info.openrocket'
doLast {
exec {
workingDir "../"
Expand All @@ -176,7 +169,7 @@ tasks.register('submoduleInit') {
}
// Updates the initialized submodules in Git.
tasks.register('subModuleUpdate') {
group = 'openrocket'
group = 'info.openrocket'
dependsOn 'submoduleInit'
doLast {
exec {
Expand Down
4 changes: 2 additions & 2 deletions swing/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
open module openrocket.swing {
requires transitive openrocket.core;
open module info.openrocket.swing {
requires transitive info.openrocket.core;

uses javax.script.ScriptEngineFactory;
uses javax.script.ScriptEngine;
Expand Down
Loading

0 comments on commit 5e315c5

Please sign in to comment.