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
+8 -6
View File
@@ -365,12 +365,12 @@ configure(project.fineractJavaProjects) {
withJavadocJar()
}
tasks.withType(ProcessResources) {
tasks.withType(ProcessResources).configureEach {
destinationDir = layout.buildDirectory.dir('classes/java/main').get().asFile
}
// Add performance optimizations
configurations.all {
configurations.configureEach {
resolutionStrategy {
cacheChangingModulesFor 0, 'seconds'
cacheDynamicVersionsFor 0, 'seconds'
@@ -422,10 +422,10 @@ configure(project.fineractJavaProjects) {
configurations {
api.setCanBeResolved(true)
}
tasks.withType(Copy) {
tasks.withType(Copy).configureEach {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.compilerArgs += [
"-Xlint:cast",
"-Xlint:auxiliaryclass",
@@ -738,13 +738,15 @@ configure(project.fineractJavaProjects) {
]
}
tasks.withType(Javadoc) {
tasks.withType(Javadoc).tap {
configureEach {
options.addStringOption('Xdoclint:none', '-quiet')
options.encoding = 'UTF-8'
// Ignore any errors during javadoc generation
failOnError = false
}
}
}
configure(project.fineractCustomProjects) {
compileJava {
@@ -868,7 +870,7 @@ configure(project.fineractPublishProjects) {
}
}
task printSourceSetInformation() {
tasks.register('printSourceSetInformation') {
doLast {
sourceSets.each { srcSet ->
println "[" + srcSet.name + "]"
+26 -18
View File
@@ -21,23 +21,35 @@ description = 'Fineract Accounting'
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/accounting/persistence.xml")
into "${source}/META-INF/"
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
}
javaexec {
description = 'Performs EclipseLink static weaving of entity classes'
def target = source
mainClass = 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
args '-persistenceinfo', source, source, target
classpath sourceSets.main.runtimeClasspath
staticWeaveJpa.doLast {
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
}
delete {
delete "${source}/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 {
@@ -85,10 +97,6 @@ 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 {
+11 -5
View File
@@ -57,9 +57,11 @@ tasks.register('preprocessAvroSchemas', PreprocessAvroSchemasTask) {
inputDir = file("$projectDir/src/main/avro")
bigDecimalTemplate = file("$projectDir/src/main/resources/avro-templates/bigdecimal.avsc")
outputDir = file("$buildDir/generated/avro/src/main/avro")
finalizedBy buildJavaSdk
}
task buildJavaSdk(type: GenerateAvroJavaTask) {
tasks.register('buildJavaSdk', GenerateAvroJavaTask) {
dependsOn preprocessAvroSchemas, spotlessJsonApply
source("$buildDir/generated/avro/src/main/avro")
outputDir = file("$buildDir/generated/java/src/main/java")
templateDirectory = "$projectDir/src/main/resources/avro-generator-templates/"
@@ -73,12 +75,10 @@ spotless {
}
}
buildJavaSdk.dependsOn(preprocessAvroSchemas, spotlessJsonApply)
sourceSets {
main {
java {
srcDir file("$buildDir/generated/java/src/main/java")
srcDirs += "$buildDir/generated/java/src/main/java"
}
resources {
srcDir file("$projectDir/src/main/resources")
@@ -97,7 +97,7 @@ jar {
}
compileJava {
dependsOn buildJavaSdk
dependsOn buildJavaSdk, processResources
source = sourceSets.main.java.srcDirs
options.compilerArgs += ['-parameters']
}
@@ -131,3 +131,9 @@ tasks.named('sourcesJar') {
dependsOn tasks.named('buildJavaSdk')
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
tasks.named('processResources') {
from('src/main/resources')
into sourceSets.main.java.classesDirectory
outputs.upToDateWhen { false }
}
+26 -18
View File
@@ -21,23 +21,35 @@ description = 'Fineract Branch'
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/branch/persistence.xml")
into "${source}/META-INF/"
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
}
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
staticWeaveJpa.doLast {
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
}
delete {
delete "${source}/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'
}
// Configuration for Swagger documentation generation task
@@ -91,10 +103,6 @@ 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 {
+26 -18
View File
@@ -21,23 +21,35 @@ description = 'Fineract Charge'
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/charge/persistence.xml")
into "${source}/META-INF/"
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
}
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
staticWeaveJpa.doLast {
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
}
delete {
delete "${source}/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'
}
// Configuration for Swagger documentation generation task
@@ -91,10 +103,6 @@ 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 {
+6 -4
View File
@@ -1,3 +1,5 @@
import org.openapitools.generator.gradle.plugin.tasks.GenerateTask
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -35,7 +37,7 @@ openApiValidate {
recommend = true
}
task buildJavaSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
tasks.register('buildJavaSdk', GenerateTask) {
generatorName = 'java'
verbose = false
validateSpec = false
@@ -60,7 +62,7 @@ task buildJavaSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateT
dependsOn(':fineract-provider:resolve')
}
task buildTypescriptAngularSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
tasks.register('buildTypescriptAngularSdk', GenerateTask) {
generatorName = 'typescript-angular'
verbose = false
validateSpec = false
@@ -80,7 +82,7 @@ task buildTypescriptAngularSdk(type: org.openapitools.generator.gradle.plugin.ta
dependsOn(':fineract-provider:resolve')
}
task buildAsciidoc(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
tasks.register('buildAsciidoc', GenerateTask) {
generatorName = 'asciidoc'
verbose = false
validateSpec = false
@@ -131,7 +133,7 @@ tasks.withType(Jar).configureEach {
}
// Improve the cleanup task to track inputs and outputs
task cleanupGeneratedJavaFiles() {
tasks.register('cleanupGeneratedJavaFiles') {
def tempDir = file("$buildDir/generated/temp-java")
def targetDir = file("$buildDir/generated/java")
+23 -15
View File
@@ -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/"
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
}
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
staticWeaveJpa.doLast {
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
}
delete {
delete "${source}/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']
}
+3 -3
View File
@@ -60,12 +60,12 @@ asciidoctor {
dependsOn(':fineract-client:clean', ':fineract-client:buildAsciidoc')
}
task copyImages(type: Copy) {
tasks.register('copyImages', Copy) {
from "${projectDir}/src/docs/en/images"
into "${buildDir}/generated/images"
}
task copyDiagrams(type: Copy) {
tasks.register('copyDiagrams', Copy) {
from "${projectDir}/src/docs/en/diagrams"
into "${buildDir}/generated/diagrams"
}
@@ -95,7 +95,7 @@ asciidoctorPdf {
dependsOn(':fineract-client:clean', ':fineract-client:buildAsciidoc')
}
task doc(type: Zip) {
tasks.register('doc', Zip) {
dependsOn(asciidoctor, asciidoctorPdf)
into("fineract-${project.version}/html") {
+26 -14
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/"
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
}
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
staticWeaveJpa.doLast {
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
}
delete {
delete "${source}/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 {
+26 -18
View File
@@ -21,23 +21,35 @@ description = 'Fineract Investor'
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/investor/persistence.xml")
into "${source}/META-INF/"
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
}
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
staticWeaveJpa.doLast {
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
}
delete {
delete "${source}/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 {
@@ -85,10 +97,6 @@ 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 {
+32 -17
View File
@@ -21,23 +21,36 @@ description = 'Fineract Loan'
apply plugin: 'java'
apply plugin: 'eclipse'
compileJava.doLast {
def mainSS = sourceSets.main
def source = mainSS.java.classesDirectory.get()
tasks.register('staticWeaveJpa', JavaExec) {
group = "build"
description = "Performs EclipseLink static weaving of entity classes"
dependsOn classes
def classesDir = file("$buildDir/classes/java/main")
def metaInf = new File(classesDir, "META-INF")
metaInf.mkdirs()
copy {
from file("src/main/resources/jpa/loan/persistence.xml")
into "${source}/META-INF/"
from "src/main/resources/jpa/loan/persistence.xml"
into "$buildDir/classes/java/main/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
mainClass.set('org.eclipse.persistence.tools.weaving.jpa.StaticWeave')
classpath = sourceSets.main.runtimeClasspath
args '-persistenceinfo', classesDir.absolutePath, classesDir.absolutePath, classesDir.absolutePath
}
delete {
delete "${source}/META-INF/persistence.xml"
staticWeaveJpa.doLast {
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
}
tasks.named('classes') {
finalizedBy staticWeaveJpa
}
compileJava {
dependsOn ':fineract-avro-schemas:buildJavaSdk'
}
// Configuration for Swagger documentation generation task
@@ -91,10 +104,6 @@ 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 {
@@ -104,3 +113,9 @@ if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
}
}
}
tasks.named('processResources') {
from('src/main/resources')
into sourceSets.main.java.classesDirectory
outputs.upToDateWhen { false }
}
+26 -18
View File
@@ -21,23 +21,35 @@ description = 'Fineract Progressive Loan'
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/progressiveloan/persistence.xml")
into "${source}/META-INF/"
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
}
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
staticWeaveJpa.doLast {
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
}
delete {
delete "${source}/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 {
@@ -85,10 +97,6 @@ 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 {
+40 -28
View File
@@ -30,30 +30,46 @@ apply plugin: 'se.thinkcode.cucumber-runner'
check.dependsOn('cucumber')
compileJava.doLast {
def mainSS = sourceSets.main
def source = mainSS.java.classesDirectory.get()
copy {
from file("src/main/resources/jpa/persistence.xml")
into "${source}/META-INF/"
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
}
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
staticWeaveJpa.doLast {
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
}
delete {
delete "${source}/META-INF/persistence.xml"
tasks.named('classes') {
finalizedBy staticWeaveJpa
}
tasks.named('processResources') {
from('src/main/resources')
into sourceSets.main.java.classesDirectory
outputs.upToDateWhen { false }
}
tasks.named('staticWeaveJpa') {
mustRunAfter tasks.named('resolve')
}
compileJava {
dependsOn ':fineract-avro-schemas:buildJavaSdk'
}
// Configuration for Swagger documentation generation task
// https://github.com/swagger-api/swagger-core/tree/master/modules/swagger-gradle-plugin
import org.apache.tools.ant.filters.ReplaceTokens
task prepareInputYaml {
tasks.register('prepareInputYaml') {
outputs.file("${buildDir}/tmp/swagger/fineract-input.yaml")
doLast {
@@ -139,10 +155,6 @@ 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 {
@@ -176,7 +188,7 @@ configurations.driver.each {File file ->
loader.addURL(file.toURL())
}
task createDB {
tasks.register('createDB') {
description = "Creates the MariaDB Database. Needs database name to be passed (like: -PdbName=someDBname)"
doLast {
def sql = Sql.newInstance('jdbc:mariadb://localhost:3306/', mysqlUser, mysqlPassword, 'org.mariadb.jdbc.Driver')
@@ -184,7 +196,7 @@ task createDB {
}
}
task dropDB {
tasks.register('dropDB') {
description = "Drops the specified MariaDB database. The database name has to be passed (like: -PdbName=someDBname)"
doLast {
def sql = Sql.newInstance('jdbc:mariadb://localhost:3306/', mysqlUser, mysqlPassword, 'org.mariadb.jdbc.Driver')
@@ -192,7 +204,7 @@ task dropDB {
}
}
task createPGDB {
tasks.register('createPGDB') {
description = "Creates the PostgreSQL Database. Needs database name to be passed (like: -PdbName=someDBname)"
doLast {
def sql = Sql.newInstance('jdbc:postgresql://localhost:5432/', pgUser, pgPassword, 'org.postgresql.Driver')
@@ -200,7 +212,7 @@ task createPGDB {
}
}
task dropPGDB {
tasks.register('dropPGDB') {
description = "Drops the specified PostgreSQL database. The database name has to be passed (like: -PdbName=someDBname)"
doLast {
def sql = Sql.newInstance('jdbc:postgresql://localhost:5432/', pgUser, pgPassword, 'org.postgresql.Driver')
@@ -208,7 +220,7 @@ task dropPGDB {
}
}
task createMySQLDB {
tasks.register('createMySQLDB') {
description = "Creates the MySQL Database. Needs database name to be passed (like: -PdbName=someDBname)"
doLast {
def sql = Sql.newInstance('jdbc:mysql://localhost:3306/', mysqlUser, mysqlPassword, 'com.mysql.cj.jdbc.Driver')
@@ -216,7 +228,7 @@ task createMySQLDB {
}
}
task dropMySQLDB {
tasks.register('dropMySQLDB') {
description = "Drops the specified MySQL database. The database name has to be passed (like: -PdbName=someDBname)"
doLast {
def sql = Sql.newInstance('jdbc:mysql://localhost:3306/', mysqlUser, mysqlPassword, 'com.mysql.cj.jdbc.Driver')
@@ -224,7 +236,7 @@ task dropMySQLDB {
}
}
task setBlankPassword {
tasks.register('setBlankPassword') {
doLast {
def sql = Sql.newInstance('jdbc:mariadb://localhost:3306/', mysqlUser, mysqlPassword, 'org.mariadb.jdbc.Driver')
sql.execute('USE `fineract_tenants`')
@@ -311,7 +323,7 @@ jib {
}
}
task migrateDatabase {
tasks.register('migrateDatabase') {
doFirst {
println 'Executing liquibase database migration to version ' + "$dbVersion"
@@ -372,7 +384,7 @@ javadoc {
dependsOn resolve
}
task devRun(type: org.springframework.boot.gradle.tasks.run.BootRun) {
tasks.register('devRun', org.springframework.boot.gradle.tasks.run.BootRun) {
description = 'Runs the application quickly for development by skipping quality checks'
group = 'Application'
@@ -433,7 +433,7 @@ springdoc.pathsToMatch=/api/**
springdoc.use-management-port=${SPRINGDOC_USE_MANAGEMENT_PORT:false}
springdoc.show-actuator=${SPRINGDOC_SHOW_ACTUATOR:false}
spring.web.resources.static-locations=classpath:/static/
spring.web.resources.static-locations=classpath:/static/, /swagger/
spring.main.allow-bean-definition-overriding=true
spring.task.scheduling.pool.size=4
+26 -18
View File
@@ -21,23 +21,35 @@ description = 'Fineract Rates'
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/rates/persistence.xml")
into "${source}/META-INF/"
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
}
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
staticWeaveJpa.doLast {
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
}
delete {
delete "${source}/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'
}
// Configuration for Swagger documentation generation task
@@ -91,10 +103,6 @@ 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 {
+26 -18
View File
@@ -21,23 +21,35 @@ description = 'Fineract Report'
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/report/persistence.xml")
into "${source}/META-INF/"
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
}
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
staticWeaveJpa.doLast {
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
}
delete {
delete "${source}/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'
}
// Configuration for Swagger documentation generation task
@@ -91,10 +103,6 @@ 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 {
+26 -18
View File
@@ -21,23 +21,35 @@ description = 'Fineract Savings'
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/savings/persistence.xml")
into "${source}/META-INF/"
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
}
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
staticWeaveJpa.doLast {
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
}
delete {
delete "${source}/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'
}
// Configuration for Swagger documentation generation task
@@ -91,10 +103,6 @@ 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 {
+26 -18
View File
@@ -21,23 +21,35 @@ description = 'Fineract Taxes'
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/taxes/persistence.xml")
into "${source}/META-INF/"
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
}
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
staticWeaveJpa.doLast {
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
}
delete {
delete "${source}/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'
}
// Configuration for Swagger documentation generation task
@@ -91,10 +103,6 @@ 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 {
+1 -1
View File
@@ -91,7 +91,7 @@ dependencies {
implementation project(':fineract-provider')
}
tasks.withType(Tar) {
tasks.withType(Tar).configureEach {
compression Compression.GZIP
archiveExtension = 'tar.gz'