FINERACT-2181: Some tweaks in the gradle build to ensure correct task processing
This commit is contained in:
+26
-18
@@ -21,23 +21,31 @@ description = 'Fineract Core'
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
compileJava.doLast {
|
||||
def mainSS = sourceSets.main
|
||||
def source = mainSS.java.classesDirectory.get()
|
||||
copy {
|
||||
from file("src/main/resources/jpa/core/persistence.xml")
|
||||
into "${source}/META-INF/"
|
||||
}
|
||||
javaexec {
|
||||
description = 'Performs EclipseLink static weaving of entity classes'
|
||||
def target = source
|
||||
main = 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
|
||||
args '-persistenceinfo', source, source, target
|
||||
classpath sourceSets.main.runtimeClasspath
|
||||
}
|
||||
delete {
|
||||
delete "${source}/META-INF/persistence.xml"
|
||||
}
|
||||
tasks.register('staticWeaveJpa', JavaExec) {
|
||||
group = "build"
|
||||
description = "Performs EclipseLink static weaving of entity classes"
|
||||
|
||||
dependsOn classes, processResources
|
||||
|
||||
def classesDir = file(sourceSets.main.output.classesDirs.asPath)
|
||||
|
||||
mainClass.set('org.eclipse.persistence.tools.weaving.jpa.StaticWeave')
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
args '-persistenceinfo', classesDir, classesDir, classesDir
|
||||
}
|
||||
|
||||
staticWeaveJpa.doLast {
|
||||
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
|
||||
}
|
||||
|
||||
tasks.named('classes') {
|
||||
finalizedBy staticWeaveJpa
|
||||
}
|
||||
|
||||
tasks.named('processResources') {
|
||||
from('src/main/resources')
|
||||
into sourceSets.main.java.classesDirectory
|
||||
outputs.upToDateWhen { false }
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -64,7 +72,7 @@ configurations {
|
||||
apply from: 'dependencies.gradle'
|
||||
|
||||
compileJava {
|
||||
dependsOn ':fineract-avro-schemas:jar'
|
||||
dependsOn ':fineract-avro-schemas:compileJava', processResources
|
||||
options.compilerArgs += ['-parameters']
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user