Revert "FINERACT-2181: Some tweaks in the gradle build to ensure correct task processing"
This reverts commit 6cb60f48
This commit is contained in:
committed by
Arnold Gálovics
parent
1ebfad230c
commit
a76c189a04
+21
-29
@@ -21,35 +21,23 @@ description = 'Fineract Rates'
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
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'
|
||||
compileJava.doLast {
|
||||
def mainSS = sourceSets.main
|
||||
def source = mainSS.java.classesDirectory.get()
|
||||
copy {
|
||||
from file("src/main/resources/jpa/rates/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"
|
||||
}
|
||||
}
|
||||
|
||||
// Configuration for Swagger documentation generation task
|
||||
@@ -103,6 +91,10 @@ eclipse {
|
||||
}
|
||||
}
|
||||
|
||||
/* http://stackoverflow.com/questions/19653311/jpa-repository-works-in-idea-and-production-but-not-in-gradle */
|
||||
sourceSets.main.output.resourcesDir = sourceSets.main.java.classesDirectory
|
||||
sourceSets.test.output.resourcesDir = sourceSets.test.java.classesDirectory
|
||||
|
||||
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
|
||||
sourceSets {
|
||||
test {
|
||||
|
||||
Reference in New Issue
Block a user