FINERACT-2181: Some tweaks in the gradle build to ensure correct task processing

This commit is contained in:
Adam Saghy
2025-05-25 22:12:22 +02:00
parent 25ef93a30b
commit 6cb60f48fc
36 changed files with 522 additions and 393 deletions
+29 -17
View File
@@ -21,23 +21,35 @@ description = 'Fineract Document'
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/document/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, '-classpath', sourceSets.main.runtimeClasspath, 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
def classesDir = file("$buildDir/classes/java/main")
mainClass.set('org.eclipse.persistence.tools.weaving.jpa.StaticWeave')
classpath = sourceSets.main.runtimeClasspath
args '-persistenceinfo', classesDir.absolutePath, classesDir.absolutePath, classesDir.absolutePath
}
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 }
}
compileJava {
dependsOn ':fineract-avro-schemas:buildJavaSdk'
}
configurations {