cleanup of comments and naming

This commit is contained in:
thzero 2023-05-07 08:12:55 -05:00
parent 0da7515b3a
commit 4f79c3f82b
2 changed files with 28 additions and 20 deletions

View File

@ -54,11 +54,6 @@ dependencies {
}
def serializedEnginesPath = './src/main/resources/datafiles/thrustcurves/thrustcurves.ser'
// Deletes the serialize engine file if it exists.
tasks.register('serializeEnginesDelete', Delete) {
group = 'openrocket'
delete fileTree(serializedEnginesPath)
}
// Executes the serialization of engines from ThrustCurve.
tasks.register('serializeEngines') {
group = 'openrocket'
@ -70,6 +65,12 @@ tasks.register('serializeEngines') {
println "Serialized engines in ${project.file(serializedEnginesPath)} already exist."
}
}
// Deletes the serialize engine file if it exists.
tasks.register('serializeEnginesDelete', Delete) {
group = 'openrocket'
delete fileTree(serializedEnginesPath)
}
// Excutes the Java serialization program to fetch ThrustCurve rocket data and serialize it.
tasks.register('serializeEnginesExecute', JavaExec) {
group = 'openrocket'
workingDir new File(projectDir, 'build/tmp')

View File

@ -64,6 +64,7 @@ dependencies {
}
def externalComponentsPath = './src/main/resources/datafiles/components'
// Copies the external components to the Swing resource folder.
tasks.register('externalComponentsCopy', Copy) {
group = 'openrocket'
dependsOn 'externalComponentsValidate'
@ -79,21 +80,13 @@ tasks.register('externalComponentsCopy', Copy) {
println "Copying $details.sourcePath to $details.path ..."
}
}
// Deletes the external components resource folder.
tasks.register('externalComponentsDelete', Delete) {
group = 'openrocket'
delete fileTree(externalComponentsPath)
}
tasks.register('externalComponentsInit') {
group = 'openrocket'
doLast {
exec {
workingDir "../"
executable 'git'
args 'submodule', 'init'
}
println "Executed externalComponentsInit!"
}
}
// 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'
def externalResourceComponents = './resources-src/datafiles/components-dbcook/orc';
@ -114,7 +107,7 @@ tasks.register('externalComponentsValidate') {
"% git submodule update --remote\n" +
"\n";
println message
dependsOn externalComponentsUpdate
dependsOn subModuleUpdate
} else {
message +=
"If you retrieved this code by downloading and uncompressing a zip file,\n" +
@ -128,16 +121,30 @@ tasks.register('externalComponentsValidate') {
}
}
}
tasks.register('externalComponentsUpdate') {
// Initializes the submodules in Git.
tasks.register('submoduleInit') {
group = 'openrocket'
dependsOn 'externalComponentsInit'
doLast {
exec {
workingDir "../"
executable 'git'
args 'submodule', 'init'
}
println "Executed submoduleInit!"
}
}
// Updates the initialized submodules in Git.
tasks.register('subModuleUpdate') {
group = 'openrocket'
dependsOn 'submoduleInit'
doLast {
exec {
workingDir "../"
executable 'git'
args 'submodule', 'update', '--remote'
}
println "Executed externalComponentsUpdate!"
println "Executed subModuleUpdate!"
}
}