diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 132d87a51..c1ea64ec8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,11 +24,13 @@ jobs: distribution: 'adopt' - name: Setup Gradle uses: gradle/gradle-build-action@v2 -# Not sure why this is needed, per a support issue (https://github.com/gradle/gradle-build-action/issues/517) it should not +# Not sure why this is needed, per a support issue (https://github.com/gradle/gradle-build-action/issues/517) it should not - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Execute Gradle build - run: ./gradlew clean serializeEnginesDist build dist + run: ./gradlew clean build dist +# If wanting to serialize all the engines during build +# run: ./gradlew clean serializeEnginesDist build dist - name: Upload build reports uses: actions/upload-artifact@v3 with: diff --git a/.gitignore b/.gitignore index 2f3d9a9c3..6aea691e3 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,6 @@ /core/build /core/tmp /core/misc -/core/src/main/resources/datafiles/thrustcurves/thrustcurves.ser /core/src/main/resources/ReleaseNotes.md /core/src/test/resources/ReleaseNotes.md diff --git a/.travis.yml b/.travis.yml index 550b4586a..0b32c4af7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ jdk: - oraclejdk13 script: - - gradlew clean serializeEnginesDist build dist + - gradlew clean build dist notifications: webhooks: https://www.travisbuddy.com/ diff --git a/core/build.gradle b/core/build.gradle index 34ac64462..cf9bc413a 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -112,6 +112,21 @@ tasks.register('serializeEnginesExecuteDist', JavaExec) { println "...serializeEnginesExecuteDist Completed" } } +// Validates that the serialize engines file exists. +tasks.register('serializeEnginesValidate') { + group = '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" + "% ./gradlew serializeEngines\n" + + "\n"; + println message + throw new GradleException('Invalid serialized engine file.') + } else { + def message = "Serialized engine file found.\n\n"; + println message + } +} tasks.register('copyReadmeMain', Copy) { doLast { @@ -122,9 +137,8 @@ tasks.register('copyReadmeMain', Copy) { } } -//clean.dependsOn([serializeEnginesDelete]) processResources.dependsOn([copyReadmeMain]) -//jar.dependsOn([serializeEnginesExecute]) +processResources.dependsOn([serializeEnginesValidate]) // https://docs.gradle.org/7.4/userguide/cross_project_publications.html tasks.register('testCoreArtifactsJar', Jar) { diff --git a/core/src/main/resources/datafiles/thrustcurves/thrustcurves.ser b/core/src/main/resources/datafiles/thrustcurves/thrustcurves.ser new file mode 100644 index 000000000..f32e4c69d Binary files /dev/null and b/core/src/main/resources/datafiles/thrustcurves/thrustcurves.ser differ diff --git a/swing/build.gradle b/swing/build.gradle index 66eee7923..62f6cd245 100644 --- a/swing/build.gradle +++ b/swing/build.gradle @@ -92,30 +92,25 @@ tasks.register('externalComponentsValidate') { def externalResourceComponents = './resources-src/datafiles/components-dbcook/orc'; def git = '../.git'; if (!project.file(externalResourceComponents).exists()) { - println "found: ${project.file(externalResourceComponents)}" - def message = "The component database is now a submodule, and must be included into\n" + - "this project to compile and run the app.\n" + - "\n"; +// println "found: ${project.file(externalResourceComponents)}" + def message = "The component database is now a submodule, and must be included into " + + "this project to compile and run the app.\n" + + "\n"; if (project.file(git).exists()) { - message += - "If you retrieved this code by cloning the openrocket repository, \n" + - "the Gradle build will initialize the submodule if missing.\n" + - "\n" + - "You can also manually initialize and update the submodule from the \n" + - "command line\n" + - "% git submodule init\n" + - "% git submodule update --remote\n" + - "\n"; + message +="If you retrieved this code by cloning the openrocket repository, " + + "the Gradle build will initialize the submodule if missing.\n" + + "\n" + + "You can also manually initialize and update the submodule from the command line\n" + + "% git submodule init\n" + + "% git submodule update --remote\n" + + "\n"; println message dependsOn subModuleUpdate } else { - message += - "If you retrieved this code by downloading and uncompressing a zip file,\n" + - "Download the code\n" + - "from https://github.com/dbcook/openrocket-database and uncompress it.\n" + - "Copy the files and directories under openrocket-database-master\n" + - "into ''./swing/${externalResourceComponents}''\n" + - "\n"; + message += "If you retrieved this code by downloading and uncompressing a zip file,\n" + + "Download the code from https://github.com/dbcook/openrocket-database and uncompress it.\n" + + "Copy the files and directories under openrocket-database-master into ''./swing/${externalResourceComponents}''\n" + + "\n"; println message throw new GradleException('Invalid external component resources.') }