Clean up gradle build
This commit is contained in:
parent
d32faea6c6
commit
dbf2838cae
@ -100,10 +100,9 @@ shadowJar {
|
|||||||
archiveBaseName.set('OpenRocket')
|
archiveBaseName.set('OpenRocket')
|
||||||
archiveVersion.set(buildProperties['build.version'])
|
archiveVersion.set(buildProperties['build.version'])
|
||||||
archiveClassifier.set('')
|
archiveClassifier.set('')
|
||||||
|
dependsOn(distTar, distZip)
|
||||||
}
|
}
|
||||||
|
|
||||||
//shadowJar.dependsOn([':core:serializeEngines'])
|
|
||||||
|
|
||||||
// Package the application for distribution.
|
// Package the application for distribution.
|
||||||
tasks.register('dist') {
|
tasks.register('dist') {
|
||||||
group = 'info.openrocket'
|
group = 'info.openrocket'
|
||||||
|
@ -11,13 +11,10 @@ java {
|
|||||||
modularity.inferModulePath = false
|
modularity.inferModulePath = false
|
||||||
}
|
}
|
||||||
|
|
||||||
Properties props = new Properties()
|
def buildProperties = new Properties()
|
||||||
try {
|
file('./src/main/resources/build.properties').withInputStream { buildProperties.load(it) }
|
||||||
props.load(file('./src/main/resources/build.properties').newDataInputStream())
|
group = 'info.openrocket'
|
||||||
} catch (Exception ex) {
|
version = buildProperties['build.version']
|
||||||
throw new Exception("Missing build.properties. file: " + ex.getMessage())
|
|
||||||
}
|
|
||||||
version = props['build.version']
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@ -62,17 +59,14 @@ def serializedEnginesPath = './src/main/resources/datafiles/thrustcurves/thrustc
|
|||||||
def serializedEnginesPathDist = './build/resources/main/datafiles/thrustcurves/thrustcurves.ser'
|
def serializedEnginesPathDist = './build/resources/main/datafiles/thrustcurves/thrustcurves.ser'
|
||||||
// Executes the serialization of engines from ThrustCurve for a build.
|
// Executes the serialization of engines from ThrustCurve for a build.
|
||||||
tasks.register('serializeEngines') {
|
tasks.register('serializeEngines') {
|
||||||
group = 'info.openrocket'
|
|
||||||
dependsOn serializeEnginesDelete
|
dependsOn serializeEnginesDelete
|
||||||
dependsOn serializeEnginesExecute
|
dependsOn serializeEnginesExecute
|
||||||
}
|
}
|
||||||
tasks.register('serializeEnginesDist') {
|
tasks.register('serializeEnginesDist') {
|
||||||
group = 'info.openrocket'
|
|
||||||
dependsOn serializeEnginesExecuteDist
|
dependsOn serializeEnginesExecuteDist
|
||||||
}
|
}
|
||||||
// Deletes the serialize engine file if it exists.
|
// Deletes the serialize engine file if it exists.
|
||||||
tasks.register('serializeEnginesDelete', Delete) {
|
tasks.register('serializeEnginesDelete', Delete) {
|
||||||
group = 'info.openrocket'
|
|
||||||
delete fileTree(serializedEnginesPath)
|
delete fileTree(serializedEnginesPath)
|
||||||
|
|
||||||
doFirst {
|
doFirst {
|
||||||
@ -84,7 +78,6 @@ tasks.register('serializeEnginesDelete', Delete) {
|
|||||||
}
|
}
|
||||||
// Executes the Java serialization program to fetch ThrustCurve rocket data and serialize it.
|
// Executes the Java serialization program to fetch ThrustCurve rocket data and serialize it.
|
||||||
tasks.register('serializeEnginesExecute', JavaExec) {
|
tasks.register('serializeEnginesExecute', JavaExec) {
|
||||||
group = 'info.openrocket'
|
|
||||||
dependsOn serializeEnginesDelete
|
dependsOn serializeEnginesDelete
|
||||||
workingDir new File(projectDir, 'build/tmp')
|
workingDir new File(projectDir, 'build/tmp')
|
||||||
classpath = sourceSets.main.runtimeClasspath
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
@ -103,7 +96,6 @@ tasks.register('serializeEnginesExecute', JavaExec) {
|
|||||||
// TODO: Shouldn't need a seperate task, but the args are not changing when dynamically updating
|
// TODO: Shouldn't need a seperate task, but the args are not changing when dynamically updating
|
||||||
// the variable.
|
// the variable.
|
||||||
tasks.register('serializeEnginesExecuteDist', JavaExec) {
|
tasks.register('serializeEnginesExecuteDist', JavaExec) {
|
||||||
group = 'info.openrocket'
|
|
||||||
dependsOn serializeEnginesDelete
|
dependsOn serializeEnginesDelete
|
||||||
workingDir new File(projectDir, 'build/tmp')
|
workingDir new File(projectDir, 'build/tmp')
|
||||||
classpath = sourceSets.main.runtimeClasspath
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
@ -119,7 +111,6 @@ tasks.register('serializeEnginesExecuteDist', JavaExec) {
|
|||||||
}
|
}
|
||||||
// Validates that the serialize engines file exists.
|
// Validates that the serialize engines file exists.
|
||||||
tasks.register('serializeEnginesValidate') {
|
tasks.register('serializeEnginesValidate') {
|
||||||
group = 'info.openrocket'
|
|
||||||
if (!project.file(serializedEnginesPath).exists()) {
|
if (!project.file(serializedEnginesPath).exists()) {
|
||||||
def message = "The serialized engine file does not exist at the following location:\n${project.file(serializedEnginesPath)}.\n" +
|
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"
|
"You will need to run the following from the command line in order to generate the serialized engine file:\n"
|
||||||
@ -147,7 +138,6 @@ def externalResourceComponents = './resources-src/datafiles/openrocket-database'
|
|||||||
|
|
||||||
// Initializes the submodules in Git.
|
// Initializes the submodules in Git.
|
||||||
tasks.register('submoduleInit') {
|
tasks.register('submoduleInit') {
|
||||||
group = 'info.openrocket'
|
|
||||||
doLast {
|
doLast {
|
||||||
exec {
|
exec {
|
||||||
workingDir "../"
|
workingDir "../"
|
||||||
@ -159,7 +149,6 @@ tasks.register('submoduleInit') {
|
|||||||
}
|
}
|
||||||
// Updates the initialized submodules in Git.
|
// Updates the initialized submodules in Git.
|
||||||
tasks.register('subModuleUpdate') {
|
tasks.register('subModuleUpdate') {
|
||||||
group = 'info.openrocket'
|
|
||||||
dependsOn 'submoduleInit'
|
dependsOn 'submoduleInit'
|
||||||
doLast {
|
doLast {
|
||||||
exec {
|
exec {
|
||||||
@ -173,7 +162,6 @@ tasks.register('subModuleUpdate') {
|
|||||||
|
|
||||||
// Copies the external components to the Core resource folder.
|
// Copies the external components to the Core resource folder.
|
||||||
tasks.register('externalComponentsCopy', Copy) {
|
tasks.register('externalComponentsCopy', Copy) {
|
||||||
group = 'info.openrocket'
|
|
||||||
dependsOn 'externalComponentsValidate'
|
dependsOn 'externalComponentsValidate'
|
||||||
from(externalResourceComponents + '/orc') {
|
from(externalResourceComponents + '/orc') {
|
||||||
include '**/*'
|
include '**/*'
|
||||||
@ -187,13 +175,11 @@ tasks.register('externalComponentsCopy', Copy) {
|
|||||||
}
|
}
|
||||||
// Deletes the external components resource folder.
|
// Deletes the external components resource folder.
|
||||||
tasks.register('externalComponentsDelete', Delete) {
|
tasks.register('externalComponentsDelete', Delete) {
|
||||||
group = 'info.openrocket'
|
|
||||||
delete fileTree(externalComponentsPath)
|
delete fileTree(externalComponentsPath)
|
||||||
}
|
}
|
||||||
// Validates the external components resource folder. If it is a Git project, then
|
// Validates the external components resource folder. If it is a Git project, then
|
||||||
// calls the submodule updates to fetch the latest submodules.
|
// calls the submodule updates to fetch the latest submodules.
|
||||||
tasks.register('externalComponentsValidate') {
|
tasks.register('externalComponentsValidate') {
|
||||||
group = 'info.openrocket'
|
|
||||||
File dir = project.file(externalResourceComponents + '/orc') as File
|
File dir = project.file(externalResourceComponents + '/orc') as File
|
||||||
println "Validating external components at ${dir}..."
|
println "Validating external components at ${dir}..."
|
||||||
File gitDir = project.file('../.git') as File
|
File gitDir = project.file('../.git') as File
|
||||||
|
@ -11,13 +11,10 @@ java {
|
|||||||
modularity.inferModulePath = false
|
modularity.inferModulePath = false
|
||||||
}
|
}
|
||||||
|
|
||||||
Properties props = new Properties()
|
def buildProperties = new Properties()
|
||||||
try {
|
file('../core/src/main/resources/build.properties').withInputStream { buildProperties.load(it) }
|
||||||
props.load(file('../core/src/main/resources/build.properties').newDataInputStream())
|
group = 'info.openrocket'
|
||||||
} catch (Exception ex) {
|
version = buildProperties['build.version']
|
||||||
throw new Exception("Missing build.properties. file: " + ex.getMessage())
|
|
||||||
}
|
|
||||||
version = props['build.version']
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@ -71,7 +68,7 @@ dependencies {
|
|||||||
|
|
||||||
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.12'
|
implementation group: 'org.slf4j', name: 'slf4j-api', version: '2.0.12'
|
||||||
implementation 'org.apache.commons:commons-lang3:3.12.0'
|
implementation 'org.apache.commons:commons-lang3:3.12.0'
|
||||||
implementation group: 'org.commonmark', name: 'commonmark', version: '0.19.0' // 0.21.0
|
implementation group: 'org.commonmark', name: 'commonmark', version: '0.21.0'
|
||||||
implementation group: 'com.google.inject', name: 'guice', version: '7.0.0'
|
implementation group: 'com.google.inject', name: 'guice', version: '7.0.0'
|
||||||
implementation group: 'com.itextpdf', name: 'itextpdf', version: '5.5.13.3'
|
implementation group: 'com.itextpdf', name: 'itextpdf', version: '5.5.13.3'
|
||||||
implementation group: 'org.jfree', name: 'jcommon', version: '1.0.24'
|
implementation group: 'org.jfree', name: 'jcommon', version: '1.0.24'
|
||||||
@ -87,12 +84,6 @@ dependencies {
|
|||||||
implementation group: 'com.formdev', name: 'flatlaf-extras', version: '3.4'
|
implementation group: 'com.formdev', name: 'flatlaf-extras', version: '3.4'
|
||||||
implementation group: 'com.formdev', name: 'flatlaf-intellij-themes', version: '3.4'
|
implementation group: 'com.formdev', name: 'flatlaf-intellij-themes', version: '3.4'
|
||||||
|
|
||||||
// implementation 'net.java.dev.jna:jna:5.13.0'
|
|
||||||
// implementation 'net.java.dev.jna:jna-platform:5.13.0'
|
|
||||||
// implementation 'de.jangassen:jfa:1.2.0'
|
|
||||||
|
|
||||||
// implementation 'com.github.oshi:oshi-core:6.4.4'
|
|
||||||
|
|
||||||
implementation group: 'ch.qos.logback', name: 'logback-core', version: '1.5.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: 'ch.qos.logback', name: 'logback-classic', version: '1.5.0'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user