update for build

This commit is contained in:
thzero 2023-05-09 07:28:34 -05:00
parent ff134c6d51
commit 5fec236aa4
6 changed files with 36 additions and 26 deletions

View File

@ -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:

1
.gitignore vendored
View File

@ -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

View File

@ -9,7 +9,7 @@ jdk:
- oraclejdk13
script:
- gradlew clean serializeEnginesDist build dist
- gradlew clean build dist
notifications:
webhooks: https://www.travisbuddy.com/

View File

@ -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) {

View File

@ -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.')
}