FINERACT-2181: Some tweaks in the gradle build to ensure correct task processing
This commit is contained in:
+51
-49
@@ -365,12 +365,12 @@ configure(project.fineractJavaProjects) {
|
|||||||
withJavadocJar()
|
withJavadocJar()
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(ProcessResources) {
|
tasks.withType(ProcessResources).configureEach {
|
||||||
destinationDir = layout.buildDirectory.dir('classes/java/main').get().asFile
|
destinationDir = layout.buildDirectory.dir('classes/java/main').get().asFile
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add performance optimizations
|
// Add performance optimizations
|
||||||
configurations.all {
|
configurations.configureEach {
|
||||||
resolutionStrategy {
|
resolutionStrategy {
|
||||||
cacheChangingModulesFor 0, 'seconds'
|
cacheChangingModulesFor 0, 'seconds'
|
||||||
cacheDynamicVersionsFor 0, 'seconds'
|
cacheDynamicVersionsFor 0, 'seconds'
|
||||||
@@ -422,40 +422,40 @@ configure(project.fineractJavaProjects) {
|
|||||||
configurations {
|
configurations {
|
||||||
api.setCanBeResolved(true)
|
api.setCanBeResolved(true)
|
||||||
}
|
}
|
||||||
tasks.withType(Copy) {
|
tasks.withType(Copy).configureEach {
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
}
|
}
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile).configureEach {
|
||||||
options.compilerArgs += [
|
options.compilerArgs += [
|
||||||
"-Xlint:cast",
|
"-Xlint:cast",
|
||||||
"-Xlint:auxiliaryclass",
|
"-Xlint:auxiliaryclass",
|
||||||
"-Xlint:dep-ann",
|
"-Xlint:dep-ann",
|
||||||
"-Xlint:divzero",
|
"-Xlint:divzero",
|
||||||
"-Xlint:empty",
|
"-Xlint:empty",
|
||||||
"-Xlint:exports",
|
"-Xlint:exports",
|
||||||
"-Xlint:fallthrough",
|
"-Xlint:fallthrough",
|
||||||
"-Xlint:finally",
|
"-Xlint:finally",
|
||||||
"-Xlint:module",
|
"-Xlint:module",
|
||||||
"-Xlint:opens",
|
"-Xlint:opens",
|
||||||
"-Xlint:options",
|
"-Xlint:options",
|
||||||
"-Xlint:overloads",
|
"-Xlint:overloads",
|
||||||
"-Xlint:overrides",
|
"-Xlint:overrides",
|
||||||
"-Xlint:path",
|
"-Xlint:path",
|
||||||
"-Xlint:processing",
|
"-Xlint:processing",
|
||||||
"-Xlint:removal",
|
"-Xlint:removal",
|
||||||
"-Xlint:requires-automatic",
|
"-Xlint:requires-automatic",
|
||||||
"-Xlint:requires-transitive-automatic",
|
"-Xlint:requires-transitive-automatic",
|
||||||
"-Xlint:try",
|
"-Xlint:try",
|
||||||
"-Xlint:varargs",
|
"-Xlint:varargs",
|
||||||
"-Xlint:preview",
|
"-Xlint:preview",
|
||||||
"-Xlint:static",
|
"-Xlint:static",
|
||||||
// -Werror needs to be disabled because EclipseLink's static weaving doesn't generate warning-free code
|
// -Werror needs to be disabled because EclipseLink's static weaving doesn't generate warning-free code
|
||||||
// and during an IntelliJ recompilation, it fails
|
// and during an IntelliJ recompilation, it fails
|
||||||
//"-Werror",
|
//"-Werror",
|
||||||
"-Xmaxwarns",
|
"-Xmaxwarns",
|
||||||
"1500",
|
"1500",
|
||||||
"-Xmaxerrs",
|
"-Xmaxerrs",
|
||||||
"1500"
|
"1500"
|
||||||
]
|
]
|
||||||
// TODO FINERACT-959 (gradually) enable -Xlint:all (see "javac -help -X")
|
// TODO FINERACT-959 (gradually) enable -Xlint:all (see "javac -help -X")
|
||||||
|
|
||||||
@@ -738,11 +738,13 @@ configure(project.fineractJavaProjects) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(Javadoc) {
|
tasks.withType(Javadoc).tap {
|
||||||
options.addStringOption('Xdoclint:none', '-quiet')
|
configureEach {
|
||||||
options.encoding = 'UTF-8'
|
options.addStringOption('Xdoclint:none', '-quiet')
|
||||||
// Ignore any errors during javadoc generation
|
options.encoding = 'UTF-8'
|
||||||
failOnError = false
|
// Ignore any errors during javadoc generation
|
||||||
|
failOnError = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -868,17 +870,17 @@ configure(project.fineractPublishProjects) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task printSourceSetInformation() {
|
tasks.register('printSourceSetInformation') {
|
||||||
doLast{
|
doLast {
|
||||||
sourceSets.each { srcSet ->
|
sourceSets.each { srcSet ->
|
||||||
println "["+srcSet.name+"]"
|
println "[" + srcSet.name + "]"
|
||||||
print "-->Source directories: "+srcSet.allJava.srcDirs+"\n"
|
print "-->Source directories: " + srcSet.allJava.srcDirs + "\n"
|
||||||
print "-->Output directories: "+srcSet.output.classesDirs.files+"\n"
|
print "-->Output directories: " + srcSet.output.classesDirs.files + "\n"
|
||||||
print "-->Compile classpath:\n"
|
print "-->Compile classpath:\n"
|
||||||
srcSet.compileClasspath.files.each {
|
srcSet.compileClasspath.files.each {
|
||||||
print " "+it.path+"\n"
|
print " " + it.path + "\n"
|
||||||
|
}
|
||||||
|
println ""
|
||||||
}
|
}
|
||||||
println ""
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -21,23 +21,35 @@ description = 'Fineract Accounting'
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
compileJava.doLast {
|
tasks.register('staticWeaveJpa', JavaExec) {
|
||||||
def mainSS = sourceSets.main
|
group = "build"
|
||||||
def source = mainSS.java.classesDirectory.get()
|
description = "Performs EclipseLink static weaving of entity classes"
|
||||||
copy {
|
|
||||||
from file("src/main/resources/jpa/accounting/persistence.xml")
|
dependsOn classes
|
||||||
into "${source}/META-INF/"
|
|
||||||
}
|
def classesDir = file("$buildDir/classes/java/main")
|
||||||
javaexec {
|
|
||||||
description = 'Performs EclipseLink static weaving of entity classes'
|
mainClass.set('org.eclipse.persistence.tools.weaving.jpa.StaticWeave')
|
||||||
def target = source
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
mainClass = 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
|
args '-persistenceinfo', classesDir.absolutePath, classesDir.absolutePath, classesDir.absolutePath
|
||||||
args '-persistenceinfo', source, source, target
|
}
|
||||||
classpath sourceSets.main.runtimeClasspath
|
|
||||||
}
|
staticWeaveJpa.doLast {
|
||||||
delete {
|
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
|
||||||
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 {
|
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')) {
|
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
test {
|
test {
|
||||||
|
|||||||
@@ -57,9 +57,11 @@ tasks.register('preprocessAvroSchemas', PreprocessAvroSchemasTask) {
|
|||||||
inputDir = file("$projectDir/src/main/avro")
|
inputDir = file("$projectDir/src/main/avro")
|
||||||
bigDecimalTemplate = file("$projectDir/src/main/resources/avro-templates/bigdecimal.avsc")
|
bigDecimalTemplate = file("$projectDir/src/main/resources/avro-templates/bigdecimal.avsc")
|
||||||
outputDir = file("$buildDir/generated/avro/src/main/avro")
|
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")
|
source("$buildDir/generated/avro/src/main/avro")
|
||||||
outputDir = file("$buildDir/generated/java/src/main/java")
|
outputDir = file("$buildDir/generated/java/src/main/java")
|
||||||
templateDirectory = "$projectDir/src/main/resources/avro-generator-templates/"
|
templateDirectory = "$projectDir/src/main/resources/avro-generator-templates/"
|
||||||
@@ -73,12 +75,10 @@ spotless {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildJavaSdk.dependsOn(preprocessAvroSchemas, spotlessJsonApply)
|
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
java {
|
java {
|
||||||
srcDir file("$buildDir/generated/java/src/main/java")
|
srcDirs += "$buildDir/generated/java/src/main/java"
|
||||||
}
|
}
|
||||||
resources {
|
resources {
|
||||||
srcDir file("$projectDir/src/main/resources")
|
srcDir file("$projectDir/src/main/resources")
|
||||||
@@ -97,7 +97,7 @@ jar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileJava {
|
compileJava {
|
||||||
dependsOn buildJavaSdk
|
dependsOn buildJavaSdk, processResources
|
||||||
source = sourceSets.main.java.srcDirs
|
source = sourceSets.main.java.srcDirs
|
||||||
options.compilerArgs += ['-parameters']
|
options.compilerArgs += ['-parameters']
|
||||||
}
|
}
|
||||||
@@ -131,3 +131,9 @@ tasks.named('sourcesJar') {
|
|||||||
dependsOn tasks.named('buildJavaSdk')
|
dependsOn tasks.named('buildJavaSdk')
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.named('processResources') {
|
||||||
|
from('src/main/resources')
|
||||||
|
into sourceSets.main.java.classesDirectory
|
||||||
|
outputs.upToDateWhen { false }
|
||||||
|
}
|
||||||
|
|||||||
@@ -21,23 +21,35 @@ description = 'Fineract Branch'
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
compileJava.doLast {
|
tasks.register('staticWeaveJpa', JavaExec) {
|
||||||
def mainSS = sourceSets.main
|
group = "build"
|
||||||
def source = mainSS.java.classesDirectory.get()
|
description = "Performs EclipseLink static weaving of entity classes"
|
||||||
copy {
|
|
||||||
from file("src/main/resources/jpa/branch/persistence.xml")
|
dependsOn classes
|
||||||
into "${source}/META-INF/"
|
|
||||||
}
|
def classesDir = file("$buildDir/classes/java/main")
|
||||||
javaexec {
|
|
||||||
description = 'Performs EclipseLink static weaving of entity classes'
|
mainClass.set('org.eclipse.persistence.tools.weaving.jpa.StaticWeave')
|
||||||
def target = source
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
main 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
|
args '-persistenceinfo', classesDir.absolutePath, classesDir.absolutePath, classesDir.absolutePath
|
||||||
args '-persistenceinfo', source, source, target
|
}
|
||||||
classpath sourceSets.main.runtimeClasspath
|
|
||||||
}
|
staticWeaveJpa.doLast {
|
||||||
delete {
|
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
|
||||||
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
|
// 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')) {
|
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
test {
|
test {
|
||||||
|
|||||||
@@ -21,23 +21,35 @@ description = 'Fineract Charge'
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
compileJava.doLast {
|
tasks.register('staticWeaveJpa', JavaExec) {
|
||||||
def mainSS = sourceSets.main
|
group = "build"
|
||||||
def source = mainSS.java.classesDirectory.get()
|
description = "Performs EclipseLink static weaving of entity classes"
|
||||||
copy {
|
|
||||||
from file("src/main/resources/jpa/charge/persistence.xml")
|
dependsOn classes
|
||||||
into "${source}/META-INF/"
|
|
||||||
}
|
def classesDir = file("$buildDir/classes/java/main")
|
||||||
javaexec {
|
|
||||||
description = 'Performs EclipseLink static weaving of entity classes'
|
mainClass.set('org.eclipse.persistence.tools.weaving.jpa.StaticWeave')
|
||||||
def target = source
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
main 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
|
args '-persistenceinfo', classesDir.absolutePath, classesDir.absolutePath, classesDir.absolutePath
|
||||||
args '-persistenceinfo', source, source, target
|
}
|
||||||
classpath sourceSets.main.runtimeClasspath
|
|
||||||
}
|
staticWeaveJpa.doLast {
|
||||||
delete {
|
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
|
||||||
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
|
// 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')) {
|
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
test {
|
test {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import org.openapitools.generator.gradle.plugin.tasks.GenerateTask
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
* or more contributor license agreements. See the NOTICE file
|
* or more contributor license agreements. See the NOTICE file
|
||||||
@@ -35,7 +37,7 @@ openApiValidate {
|
|||||||
recommend = true
|
recommend = true
|
||||||
}
|
}
|
||||||
|
|
||||||
task buildJavaSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
|
tasks.register('buildJavaSdk', GenerateTask) {
|
||||||
generatorName = 'java'
|
generatorName = 'java'
|
||||||
verbose = false
|
verbose = false
|
||||||
validateSpec = false
|
validateSpec = false
|
||||||
@@ -48,11 +50,11 @@ task buildJavaSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateT
|
|||||||
invokerPackage = 'org.apache.fineract.client'
|
invokerPackage = 'org.apache.fineract.client'
|
||||||
modelPackage = 'org.apache.fineract.client.models'
|
modelPackage = 'org.apache.fineract.client.models'
|
||||||
configOptions = [
|
configOptions = [
|
||||||
dateLibrary: 'java8',
|
dateLibrary : 'java8',
|
||||||
useRxJava2: 'false',
|
useRxJava2 : 'false',
|
||||||
library: 'retrofit2',
|
library : 'retrofit2',
|
||||||
hideGenerationTimestamp: 'true',
|
hideGenerationTimestamp: 'true',
|
||||||
containerDefaultToNull: 'true'
|
containerDefaultToNull : 'true'
|
||||||
]
|
]
|
||||||
generateModelTests = false
|
generateModelTests = false
|
||||||
generateApiTests = false
|
generateApiTests = false
|
||||||
@@ -60,7 +62,7 @@ task buildJavaSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateT
|
|||||||
dependsOn(':fineract-provider:resolve')
|
dependsOn(':fineract-provider:resolve')
|
||||||
}
|
}
|
||||||
|
|
||||||
task buildTypescriptAngularSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
|
tasks.register('buildTypescriptAngularSdk', GenerateTask) {
|
||||||
generatorName = 'typescript-angular'
|
generatorName = 'typescript-angular'
|
||||||
verbose = false
|
verbose = false
|
||||||
validateSpec = false
|
validateSpec = false
|
||||||
@@ -71,16 +73,16 @@ task buildTypescriptAngularSdk(type: org.openapitools.generator.gradle.plugin.ta
|
|||||||
invokerPackage = 'apache-fineract-client/invoker'
|
invokerPackage = 'apache-fineract-client/invoker'
|
||||||
modelPackage = 'apache-fineract-client/models'
|
modelPackage = 'apache-fineract-client/models'
|
||||||
configOptions = [
|
configOptions = [
|
||||||
apiModulePrefix: 'apacheFineractClient',
|
apiModulePrefix : 'apacheFineractClient',
|
||||||
configurationPrefix: 'apacheFineractClient',
|
configurationPrefix: 'apacheFineractClient',
|
||||||
ngVersion: '12.0.0',
|
ngVersion : '12.0.0',
|
||||||
npmName: '@apache/fineract-client',
|
npmName : '@apache/fineract-client',
|
||||||
npmRepository: "${npmRepository}"
|
npmRepository : "${npmRepository}"
|
||||||
]
|
]
|
||||||
dependsOn(':fineract-provider:resolve')
|
dependsOn(':fineract-provider:resolve')
|
||||||
}
|
}
|
||||||
|
|
||||||
task buildAsciidoc(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
|
tasks.register('buildAsciidoc', GenerateTask) {
|
||||||
generatorName = 'asciidoc'
|
generatorName = 'asciidoc'
|
||||||
verbose = false
|
verbose = false
|
||||||
validateSpec = false
|
validateSpec = false
|
||||||
@@ -91,18 +93,18 @@ task buildAsciidoc(type: org.openapitools.generator.gradle.plugin.tasks.Generate
|
|||||||
invokerPackage = 'org.apache.fineract.client'
|
invokerPackage = 'org.apache.fineract.client'
|
||||||
modelPackage = 'org.apache.fineract.client.models'
|
modelPackage = 'org.apache.fineract.client.models'
|
||||||
configOptions = [
|
configOptions = [
|
||||||
appName: 'Apache Fineract REST API',
|
appName : 'Apache Fineract REST API',
|
||||||
appDescription: '''Apache Fineract is a secure, multi-tenanted microfinance platform.
|
appDescription : '''Apache Fineract is a secure, multi-tenanted microfinance platform.
|
||||||
The goal of the Apache Fineract API is to empower developers to build apps on top of the Apache Fineract Platform.
|
The goal of the Apache Fineract API is to empower developers to build apps on top of the Apache Fineract Platform.
|
||||||
The https://cui.fineract.dev[reference app] (username: mifos, password: password) works on the same demo tenant as the interactive links in this documentation.
|
The https://cui.fineract.dev[reference app] (username: mifos, password: password) works on the same demo tenant as the interactive links in this documentation.
|
||||||
Until we complete the new REST API documentation you still have the legacy documentation available https://fineract.apache.org/legacy-docs/apiLive.htm[here].
|
Until we complete the new REST API documentation you still have the legacy documentation available https://fineract.apache.org/legacy-docs/apiLive.htm[here].
|
||||||
Please check https://fineract.apache.org/docs/current[the Fineract documentation] for more information.''',
|
Please check https://fineract.apache.org/docs/current[the Fineract documentation] for more information.''',
|
||||||
headerAttributes: 'false',
|
headerAttributes: 'false',
|
||||||
infoEmail: 'dev@fineract.apache.org',
|
infoEmail : 'dev@fineract.apache.org',
|
||||||
infoUrl: 'https://fineract.apache.org',
|
infoUrl : 'https://fineract.apache.org',
|
||||||
licenseInfo: 'Apache 2.0',
|
licenseInfo : 'Apache 2.0',
|
||||||
licenseUrl: 'http://www.apache.org/licenses/LICENSE-2.0.html',
|
licenseUrl : 'http://www.apache.org/licenses/LICENSE-2.0.html',
|
||||||
useMethodAndPath: 'true'
|
useMethodAndPath: 'true'
|
||||||
]
|
]
|
||||||
dependsOn(':fineract-provider:resolve')
|
dependsOn(':fineract-provider:resolve')
|
||||||
}
|
}
|
||||||
@@ -131,23 +133,23 @@ tasks.withType(Jar).configureEach {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Improve the cleanup task to track inputs and outputs
|
// Improve the cleanup task to track inputs and outputs
|
||||||
task cleanupGeneratedJavaFiles() {
|
tasks.register('cleanupGeneratedJavaFiles') {
|
||||||
def tempDir = file("$buildDir/generated/temp-java")
|
def tempDir = file("$buildDir/generated/temp-java")
|
||||||
def targetDir = file("$buildDir/generated/java")
|
def targetDir = file("$buildDir/generated/java")
|
||||||
|
|
||||||
inputs.dir(tempDir)
|
inputs.dir(tempDir)
|
||||||
outputs.dir(targetDir)
|
outputs.dir(targetDir)
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
copy {
|
copy {
|
||||||
from tempDir
|
from tempDir
|
||||||
into targetDir
|
into targetDir
|
||||||
filter { line ->
|
filter { line ->
|
||||||
line
|
line
|
||||||
.replaceAll("import org\\.joda\\.time\\.\\*;", "")
|
.replaceAll("import org\\.joda\\.time\\.\\*;", "")
|
||||||
.replaceAll(", \\)", ")")
|
.replaceAll(", \\)", ")")
|
||||||
.replaceAll(", , @HeaderMap", ", @HeaderMap")
|
.replaceAll(", , @HeaderMap", ", @HeaderMap")
|
||||||
.replaceAll("\\(, ", "(")
|
.replaceAll("\\(, ", "(")
|
||||||
}
|
}
|
||||||
// Also set duplicates strategy for the copy task
|
// Also set duplicates strategy for the copy task
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
|||||||
@@ -79,4 +79,4 @@ jmh {
|
|||||||
fork = 1 // Number of forks
|
fork = 1 // Number of forks
|
||||||
timeOnIteration = '2s' // Time per iteration
|
timeOnIteration = '2s' // Time per iteration
|
||||||
benchmarkMode = ['thrpt'] // Default benchmark mode
|
benchmarkMode = ['thrpt'] // Default benchmark mode
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-18
@@ -21,23 +21,31 @@ description = 'Fineract Core'
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
compileJava.doLast {
|
tasks.register('staticWeaveJpa', JavaExec) {
|
||||||
def mainSS = sourceSets.main
|
group = "build"
|
||||||
def source = mainSS.java.classesDirectory.get()
|
description = "Performs EclipseLink static weaving of entity classes"
|
||||||
copy {
|
|
||||||
from file("src/main/resources/jpa/core/persistence.xml")
|
dependsOn classes, processResources
|
||||||
into "${source}/META-INF/"
|
|
||||||
}
|
def classesDir = file(sourceSets.main.output.classesDirs.asPath)
|
||||||
javaexec {
|
|
||||||
description = 'Performs EclipseLink static weaving of entity classes'
|
mainClass.set('org.eclipse.persistence.tools.weaving.jpa.StaticWeave')
|
||||||
def target = source
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
main = 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
|
args '-persistenceinfo', classesDir, classesDir, classesDir
|
||||||
args '-persistenceinfo', source, source, target
|
}
|
||||||
classpath sourceSets.main.runtimeClasspath
|
|
||||||
}
|
staticWeaveJpa.doLast {
|
||||||
delete {
|
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
|
||||||
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 {
|
configurations {
|
||||||
@@ -64,7 +72,7 @@ configurations {
|
|||||||
apply from: 'dependencies.gradle'
|
apply from: 'dependencies.gradle'
|
||||||
|
|
||||||
compileJava {
|
compileJava {
|
||||||
dependsOn ':fineract-avro-schemas:jar'
|
dependsOn ':fineract-avro-schemas:compileJava', processResources
|
||||||
options.compilerArgs += ['-parameters']
|
options.compilerArgs += ['-parameters']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,12 +60,12 @@ asciidoctor {
|
|||||||
dependsOn(':fineract-client:clean', ':fineract-client:buildAsciidoc')
|
dependsOn(':fineract-client:clean', ':fineract-client:buildAsciidoc')
|
||||||
}
|
}
|
||||||
|
|
||||||
task copyImages(type: Copy) {
|
tasks.register('copyImages', Copy) {
|
||||||
from "${projectDir}/src/docs/en/images"
|
from "${projectDir}/src/docs/en/images"
|
||||||
into "${buildDir}/generated/images"
|
into "${buildDir}/generated/images"
|
||||||
}
|
}
|
||||||
|
|
||||||
task copyDiagrams(type: Copy) {
|
tasks.register('copyDiagrams', Copy) {
|
||||||
from "${projectDir}/src/docs/en/diagrams"
|
from "${projectDir}/src/docs/en/diagrams"
|
||||||
into "${buildDir}/generated/diagrams"
|
into "${buildDir}/generated/diagrams"
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ asciidoctorPdf {
|
|||||||
dependsOn(':fineract-client:clean', ':fineract-client:buildAsciidoc')
|
dependsOn(':fineract-client:clean', ':fineract-client:buildAsciidoc')
|
||||||
}
|
}
|
||||||
|
|
||||||
task doc(type: Zip) {
|
tasks.register('doc', Zip) {
|
||||||
dependsOn(asciidoctor, asciidoctorPdf)
|
dependsOn(asciidoctor, asciidoctorPdf)
|
||||||
|
|
||||||
into("fineract-${project.version}/html") {
|
into("fineract-${project.version}/html") {
|
||||||
|
|||||||
@@ -21,23 +21,35 @@ description = 'Fineract Document'
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
compileJava.doLast {
|
tasks.register('staticWeaveJpa', JavaExec) {
|
||||||
def mainSS = sourceSets.main
|
group = "build"
|
||||||
def source = mainSS.java.classesDirectory.get()
|
description = "Performs EclipseLink static weaving of entity classes"
|
||||||
copy {
|
|
||||||
from file("src/main/resources/jpa/document/persistence.xml")
|
dependsOn classes
|
||||||
into "${source}/META-INF/"
|
|
||||||
}
|
def classesDir = file("$buildDir/classes/java/main")
|
||||||
javaexec {
|
|
||||||
description = 'Performs EclipseLink static weaving of entity classes'
|
mainClass.set('org.eclipse.persistence.tools.weaving.jpa.StaticWeave')
|
||||||
def target = source
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
main 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
|
args '-persistenceinfo', classesDir.absolutePath, classesDir.absolutePath, classesDir.absolutePath
|
||||||
args '-persistenceinfo', source, '-classpath', sourceSets.main.runtimeClasspath, source, target
|
}
|
||||||
classpath sourceSets.main.runtimeClasspath
|
|
||||||
}
|
staticWeaveJpa.doLast {
|
||||||
delete {
|
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
|
||||||
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 {
|
configurations {
|
||||||
|
|||||||
@@ -21,23 +21,35 @@ description = 'Fineract Investor'
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
compileJava.doLast {
|
tasks.register('staticWeaveJpa', JavaExec) {
|
||||||
def mainSS = sourceSets.main
|
group = "build"
|
||||||
def source = mainSS.java.classesDirectory.get()
|
description = "Performs EclipseLink static weaving of entity classes"
|
||||||
copy {
|
|
||||||
from file("src/main/resources/jpa/investor/persistence.xml")
|
dependsOn classes
|
||||||
into "${source}/META-INF/"
|
|
||||||
}
|
def classesDir = file("$buildDir/classes/java/main")
|
||||||
javaexec {
|
|
||||||
description = 'Performs EclipseLink static weaving of entity classes'
|
mainClass.set('org.eclipse.persistence.tools.weaving.jpa.StaticWeave')
|
||||||
def target = source
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
main 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
|
args '-persistenceinfo', classesDir.absolutePath, classesDir.absolutePath, classesDir.absolutePath
|
||||||
args '-persistenceinfo', source, source, target
|
}
|
||||||
classpath sourceSets.main.runtimeClasspath
|
|
||||||
}
|
staticWeaveJpa.doLast {
|
||||||
delete {
|
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
|
||||||
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 {
|
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')) {
|
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
test {
|
test {
|
||||||
|
|||||||
+34
-19
@@ -21,23 +21,36 @@ description = 'Fineract Loan'
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
compileJava.doLast {
|
tasks.register('staticWeaveJpa', JavaExec) {
|
||||||
def mainSS = sourceSets.main
|
group = "build"
|
||||||
def source = mainSS.java.classesDirectory.get()
|
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 {
|
copy {
|
||||||
from file("src/main/resources/jpa/loan/persistence.xml")
|
from "src/main/resources/jpa/loan/persistence.xml"
|
||||||
into "${source}/META-INF/"
|
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
|
|
||||||
}
|
|
||||||
delete {
|
|
||||||
delete "${source}/META-INF/persistence.xml"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
compileJava {
|
||||||
|
dependsOn ':fineract-avro-schemas:buildJavaSdk'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configuration for Swagger documentation generation task
|
// 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')) {
|
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
test {
|
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 }
|
||||||
|
}
|
||||||
|
|||||||
@@ -21,23 +21,35 @@ description = 'Fineract Progressive Loan'
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
compileJava.doLast {
|
tasks.register('staticWeaveJpa', JavaExec) {
|
||||||
def mainSS = sourceSets.main
|
group = "build"
|
||||||
def source = mainSS.java.classesDirectory.get()
|
description = "Performs EclipseLink static weaving of entity classes"
|
||||||
copy {
|
|
||||||
from file("src/main/resources/jpa/progressiveloan/persistence.xml")
|
dependsOn classes
|
||||||
into "${source}/META-INF/"
|
|
||||||
}
|
def classesDir = file("$buildDir/classes/java/main")
|
||||||
javaexec {
|
|
||||||
description = 'Performs EclipseLink static weaving of entity classes'
|
mainClass.set('org.eclipse.persistence.tools.weaving.jpa.StaticWeave')
|
||||||
def target = source
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
main 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
|
args '-persistenceinfo', classesDir.absolutePath, classesDir.absolutePath, classesDir.absolutePath
|
||||||
args '-persistenceinfo', source, source, target
|
}
|
||||||
classpath sourceSets.main.runtimeClasspath
|
|
||||||
}
|
staticWeaveJpa.doLast {
|
||||||
delete {
|
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
|
||||||
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 {
|
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')) {
|
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
test {
|
test {
|
||||||
|
|||||||
@@ -30,30 +30,46 @@ apply plugin: 'se.thinkcode.cucumber-runner'
|
|||||||
|
|
||||||
check.dependsOn('cucumber')
|
check.dependsOn('cucumber')
|
||||||
|
|
||||||
compileJava.doLast {
|
tasks.register('staticWeaveJpa', JavaExec) {
|
||||||
def mainSS = sourceSets.main
|
group = "build"
|
||||||
def source = mainSS.java.classesDirectory.get()
|
description = "Performs EclipseLink static weaving of entity classes"
|
||||||
copy {
|
|
||||||
from file("src/main/resources/jpa/persistence.xml")
|
dependsOn classes
|
||||||
into "${source}/META-INF/"
|
|
||||||
}
|
def classesDir = file("$buildDir/classes/java/main")
|
||||||
javaexec {
|
|
||||||
description = 'Performs EclipseLink static weaving of entity classes'
|
mainClass.set('org.eclipse.persistence.tools.weaving.jpa.StaticWeave')
|
||||||
def target = source
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
main 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
|
args '-persistenceinfo', classesDir.absolutePath, classesDir.absolutePath, classesDir.absolutePath
|
||||||
args '-persistenceinfo', source, source, target
|
}
|
||||||
classpath sourceSets.main.runtimeClasspath
|
|
||||||
}
|
staticWeaveJpa.doLast {
|
||||||
delete {
|
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
|
||||||
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
|
// Configuration for Swagger documentation generation task
|
||||||
// https://github.com/swagger-api/swagger-core/tree/master/modules/swagger-gradle-plugin
|
// https://github.com/swagger-api/swagger-core/tree/master/modules/swagger-gradle-plugin
|
||||||
import org.apache.tools.ant.filters.ReplaceTokens
|
import org.apache.tools.ant.filters.ReplaceTokens
|
||||||
|
|
||||||
task prepareInputYaml {
|
tasks.register('prepareInputYaml') {
|
||||||
outputs.file("${buildDir}/tmp/swagger/fineract-input.yaml")
|
outputs.file("${buildDir}/tmp/swagger/fineract-input.yaml")
|
||||||
|
|
||||||
doLast {
|
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')) {
|
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
test {
|
test {
|
||||||
@@ -176,57 +188,57 @@ configurations.driver.each {File file ->
|
|||||||
loader.addURL(file.toURL())
|
loader.addURL(file.toURL())
|
||||||
}
|
}
|
||||||
|
|
||||||
task createDB {
|
tasks.register('createDB') {
|
||||||
description= "Creates the MariaDB Database. Needs database name to be passed (like: -PdbName=someDBname)"
|
description = "Creates the MariaDB Database. Needs database name to be passed (like: -PdbName=someDBname)"
|
||||||
doLast {
|
doLast {
|
||||||
def sql = Sql.newInstance( 'jdbc:mariadb://localhost:3306/', mysqlUser, mysqlPassword, 'org.mariadb.jdbc.Driver' )
|
def sql = Sql.newInstance('jdbc:mariadb://localhost:3306/', mysqlUser, mysqlPassword, 'org.mariadb.jdbc.Driver')
|
||||||
sql.execute( 'CREATE DATABASE '+"`$dbName` CHARACTER SET utf8mb4" )
|
sql.execute('CREATE DATABASE ' + "`$dbName` CHARACTER SET utf8mb4")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task dropDB {
|
tasks.register('dropDB') {
|
||||||
description= "Drops the specified MariaDB database. The database name has to be passed (like: -PdbName=someDBname)"
|
description = "Drops the specified MariaDB database. The database name has to be passed (like: -PdbName=someDBname)"
|
||||||
doLast {
|
doLast {
|
||||||
def sql = Sql.newInstance( 'jdbc:mariadb://localhost:3306/', mysqlUser, mysqlPassword, 'org.mariadb.jdbc.Driver' )
|
def sql = Sql.newInstance('jdbc:mariadb://localhost:3306/', mysqlUser, mysqlPassword, 'org.mariadb.jdbc.Driver')
|
||||||
sql.execute( 'DROP DATABASE '+"`$dbName`")
|
sql.execute('DROP DATABASE ' + "`$dbName`")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task createPGDB {
|
tasks.register('createPGDB') {
|
||||||
description= "Creates the PostgreSQL Database. Needs database name to be passed (like: -PdbName=someDBname)"
|
description = "Creates the PostgreSQL Database. Needs database name to be passed (like: -PdbName=someDBname)"
|
||||||
doLast {
|
doLast {
|
||||||
def sql = Sql.newInstance( 'jdbc:postgresql://localhost:5432/', pgUser, pgPassword, 'org.postgresql.Driver' )
|
def sql = Sql.newInstance('jdbc:postgresql://localhost:5432/', pgUser, pgPassword, 'org.postgresql.Driver')
|
||||||
sql.execute( 'create database '+"$dbName" )
|
sql.execute('create database ' + "$dbName")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task dropPGDB {
|
tasks.register('dropPGDB') {
|
||||||
description= "Drops the specified PostgreSQL database. The database name has to be passed (like: -PdbName=someDBname)"
|
description = "Drops the specified PostgreSQL database. The database name has to be passed (like: -PdbName=someDBname)"
|
||||||
doLast {
|
doLast {
|
||||||
def sql = Sql.newInstance( 'jdbc:postgresql://localhost:5432/', pgUser, pgPassword, 'org.postgresql.Driver' )
|
def sql = Sql.newInstance('jdbc:postgresql://localhost:5432/', pgUser, pgPassword, 'org.postgresql.Driver')
|
||||||
sql.execute( 'DROP DATABASE '+ "$dbName")
|
sql.execute('DROP DATABASE ' + "$dbName")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task createMySQLDB {
|
tasks.register('createMySQLDB') {
|
||||||
description= "Creates the MySQL Database. Needs database name to be passed (like: -PdbName=someDBname)"
|
description = "Creates the MySQL Database. Needs database name to be passed (like: -PdbName=someDBname)"
|
||||||
doLast {
|
doLast {
|
||||||
def sql = Sql.newInstance( 'jdbc:mysql://localhost:3306/', mysqlUser, mysqlPassword, 'com.mysql.cj.jdbc.Driver' )
|
def sql = Sql.newInstance('jdbc:mysql://localhost:3306/', mysqlUser, mysqlPassword, 'com.mysql.cj.jdbc.Driver')
|
||||||
sql.execute( 'CREATE DATABASE '+"`$dbName` CHARACTER SET utf8mb4" )
|
sql.execute('CREATE DATABASE ' + "`$dbName` CHARACTER SET utf8mb4")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task dropMySQLDB {
|
tasks.register('dropMySQLDB') {
|
||||||
description= "Drops the specified MySQL database. The database name has to be passed (like: -PdbName=someDBname)"
|
description = "Drops the specified MySQL database. The database name has to be passed (like: -PdbName=someDBname)"
|
||||||
doLast {
|
doLast {
|
||||||
def sql = Sql.newInstance( 'jdbc:mysql://localhost:3306/', mysqlUser, mysqlPassword, 'com.mysql.cj.jdbc.Driver' )
|
def sql = Sql.newInstance('jdbc:mysql://localhost:3306/', mysqlUser, mysqlPassword, 'com.mysql.cj.jdbc.Driver')
|
||||||
sql.execute( 'DROP DATABASE '+"`$dbName`")
|
sql.execute('DROP DATABASE ' + "`$dbName`")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task setBlankPassword {
|
tasks.register('setBlankPassword') {
|
||||||
doLast {
|
doLast {
|
||||||
def sql = Sql.newInstance( 'jdbc:mariadb://localhost:3306/', mysqlUser, mysqlPassword, 'org.mariadb.jdbc.Driver' )
|
def sql = Sql.newInstance('jdbc:mariadb://localhost:3306/', mysqlUser, mysqlPassword, 'org.mariadb.jdbc.Driver')
|
||||||
sql.execute('USE `fineract_tenants`')
|
sql.execute('USE `fineract_tenants`')
|
||||||
sql.execute('UPDATE fineract_tenants.tenants SET schema_server = \'localhost\', schema_server_port = \'3306\', schema_username = \'mifos\', schema_password = \'mysql\' WHERE id=1;')
|
sql.execute('UPDATE fineract_tenants.tenants SET schema_server = \'localhost\', schema_server_port = \'3306\', schema_username = \'mifos\', schema_password = \'mysql\' WHERE id=1;')
|
||||||
}
|
}
|
||||||
@@ -311,12 +323,12 @@ jib {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task migrateDatabase {
|
tasks.register('migrateDatabase') {
|
||||||
doFirst {
|
doFirst {
|
||||||
println 'Executing liquibase database migration to version '+"$dbVersion"
|
println 'Executing liquibase database migration to version ' + "$dbVersion"
|
||||||
|
|
||||||
def dbUrl='jdbc:'+"$dbType"+'://'+"$dbHost"+':'+"$dbPort"+'/'+"$dbName"
|
def dbUrl = 'jdbc:' + "$dbType" + '://' + "$dbHost" + ':' + "$dbPort" + '/' + "$dbName"
|
||||||
def changeLogFilePath='fineract-provider/src/main/resources/db/changelog/tenant/upgrades/0000_upgrade_to_'+"$dbVersion"+'.xml'
|
def changeLogFilePath = 'fineract-provider/src/main/resources/db/changelog/tenant/upgrades/0000_upgrade_to_' + "$dbVersion" + '.xml'
|
||||||
|
|
||||||
liquibase {
|
liquibase {
|
||||||
activities {
|
activities {
|
||||||
@@ -372,20 +384,20 @@ javadoc {
|
|||||||
dependsOn resolve
|
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'
|
description = 'Runs the application quickly for development by skipping quality checks'
|
||||||
group = 'Application'
|
group = 'Application'
|
||||||
|
|
||||||
// Configure the build to skip quality checks
|
// Configure the build to skip quality checks
|
||||||
gradle.taskGraph.whenReady { graph ->
|
gradle.taskGraph.whenReady { graph ->
|
||||||
if (graph.hasTask(devRun)) {
|
if (graph.hasTask(devRun)) {
|
||||||
tasks.matching { task ->
|
tasks.matching { task ->
|
||||||
task.name in ['checkstyle', 'checkstyleMain', 'checkstyleTest',
|
task.name in ['checkstyle', 'checkstyleMain', 'checkstyleTest',
|
||||||
'spotlessCheck', 'spotlessApply',
|
'spotlessCheck', 'spotlessApply',
|
||||||
'spotbugsMain', 'spotbugsTest',
|
'spotbugsMain', 'spotbugsTest',
|
||||||
'javadoc', 'javadocJar',
|
'javadoc', 'javadocJar',
|
||||||
'modernizer',
|
'modernizer',
|
||||||
'testClasses']
|
'testClasses']
|
||||||
}.configureEach {
|
}.configureEach {
|
||||||
enabled = false
|
enabled = false
|
||||||
}
|
}
|
||||||
@@ -400,7 +412,7 @@ task devRun(type: org.springframework.boot.gradle.tasks.run.BootRun) {
|
|||||||
classpath = bootRun.classpath
|
classpath = bootRun.classpath
|
||||||
mainClass = bootRun.mainClass
|
mainClass = bootRun.mainClass
|
||||||
jvmArgs = bootRun.jvmArgs
|
jvmArgs = bootRun.jvmArgs
|
||||||
|
|
||||||
doFirst {
|
doFirst {
|
||||||
println "Running in development mode - quality checks are disabled"
|
println "Running in development mode - quality checks are disabled"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ springdoc.pathsToMatch=/api/**
|
|||||||
springdoc.use-management-port=${SPRINGDOC_USE_MANAGEMENT_PORT:false}
|
springdoc.use-management-port=${SPRINGDOC_USE_MANAGEMENT_PORT:false}
|
||||||
springdoc.show-actuator=${SPRINGDOC_SHOW_ACTUATOR: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.main.allow-bean-definition-overriding=true
|
||||||
spring.task.scheduling.pool.size=4
|
spring.task.scheduling.pool.size=4
|
||||||
|
|||||||
+29
-21
@@ -21,23 +21,35 @@ description = 'Fineract Rates'
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
compileJava.doLast {
|
tasks.register('staticWeaveJpa', JavaExec) {
|
||||||
def mainSS = sourceSets.main
|
group = "build"
|
||||||
def source = mainSS.java.classesDirectory.get()
|
description = "Performs EclipseLink static weaving of entity classes"
|
||||||
copy {
|
|
||||||
from file("src/main/resources/jpa/rates/persistence.xml")
|
dependsOn classes
|
||||||
into "${source}/META-INF/"
|
|
||||||
}
|
def classesDir = file("$buildDir/classes/java/main")
|
||||||
javaexec {
|
|
||||||
description = 'Performs EclipseLink static weaving of entity classes'
|
mainClass.set('org.eclipse.persistence.tools.weaving.jpa.StaticWeave')
|
||||||
def target = source
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
main 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
|
args '-persistenceinfo', classesDir.absolutePath, classesDir.absolutePath, classesDir.absolutePath
|
||||||
args '-persistenceinfo', source, source, target
|
}
|
||||||
classpath sourceSets.main.runtimeClasspath
|
|
||||||
}
|
staticWeaveJpa.doLast {
|
||||||
delete {
|
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
|
||||||
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
|
// 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')) {
|
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
test {
|
test {
|
||||||
|
|||||||
@@ -21,23 +21,35 @@ description = 'Fineract Report'
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
compileJava.doLast {
|
tasks.register('staticWeaveJpa', JavaExec) {
|
||||||
def mainSS = sourceSets.main
|
group = "build"
|
||||||
def source = mainSS.java.classesDirectory.get()
|
description = "Performs EclipseLink static weaving of entity classes"
|
||||||
copy {
|
|
||||||
from file("src/main/resources/jpa/report/persistence.xml")
|
dependsOn classes
|
||||||
into "${source}/META-INF/"
|
|
||||||
}
|
def classesDir = file("$buildDir/classes/java/main")
|
||||||
javaexec {
|
|
||||||
description = 'Performs EclipseLink static weaving of entity classes'
|
mainClass.set('org.eclipse.persistence.tools.weaving.jpa.StaticWeave')
|
||||||
def target = source
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
main 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
|
args '-persistenceinfo', classesDir.absolutePath, classesDir.absolutePath, classesDir.absolutePath
|
||||||
args '-persistenceinfo', source, source, target
|
}
|
||||||
classpath sourceSets.main.runtimeClasspath
|
|
||||||
}
|
staticWeaveJpa.doLast {
|
||||||
delete {
|
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
|
||||||
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
|
// 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')) {
|
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
test {
|
test {
|
||||||
|
|||||||
@@ -21,23 +21,35 @@ description = 'Fineract Savings'
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
compileJava.doLast {
|
tasks.register('staticWeaveJpa', JavaExec) {
|
||||||
def mainSS = sourceSets.main
|
group = "build"
|
||||||
def source = mainSS.java.classesDirectory.get()
|
description = "Performs EclipseLink static weaving of entity classes"
|
||||||
copy {
|
|
||||||
from file("src/main/resources/jpa/savings/persistence.xml")
|
dependsOn classes
|
||||||
into "${source}/META-INF/"
|
|
||||||
}
|
def classesDir = file("$buildDir/classes/java/main")
|
||||||
javaexec {
|
|
||||||
description = 'Performs EclipseLink static weaving of entity classes'
|
mainClass.set('org.eclipse.persistence.tools.weaving.jpa.StaticWeave')
|
||||||
def target = source
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
main 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
|
args '-persistenceinfo', classesDir.absolutePath, classesDir.absolutePath, classesDir.absolutePath
|
||||||
args '-persistenceinfo', source, source, target
|
}
|
||||||
classpath sourceSets.main.runtimeClasspath
|
|
||||||
}
|
staticWeaveJpa.doLast {
|
||||||
delete {
|
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
|
||||||
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
|
// 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')) {
|
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
test {
|
test {
|
||||||
|
|||||||
+29
-21
@@ -21,23 +21,35 @@ description = 'Fineract Taxes'
|
|||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
compileJava.doLast {
|
tasks.register('staticWeaveJpa', JavaExec) {
|
||||||
def mainSS = sourceSets.main
|
group = "build"
|
||||||
def source = mainSS.java.classesDirectory.get()
|
description = "Performs EclipseLink static weaving of entity classes"
|
||||||
copy {
|
|
||||||
from file("src/main/resources/jpa/taxes/persistence.xml")
|
dependsOn classes
|
||||||
into "${source}/META-INF/"
|
|
||||||
}
|
def classesDir = file("$buildDir/classes/java/main")
|
||||||
javaexec {
|
|
||||||
description = 'Performs EclipseLink static weaving of entity classes'
|
mainClass.set('org.eclipse.persistence.tools.weaving.jpa.StaticWeave')
|
||||||
def target = source
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
main 'org.eclipse.persistence.tools.weaving.jpa.StaticWeave'
|
args '-persistenceinfo', classesDir.absolutePath, classesDir.absolutePath, classesDir.absolutePath
|
||||||
args '-persistenceinfo', source, source, target
|
}
|
||||||
classpath sourceSets.main.runtimeClasspath
|
|
||||||
}
|
staticWeaveJpa.doLast {
|
||||||
delete {
|
delete "${sourceSets.main.output.classesDirs.asPath}/META-INF/persistence.xml"
|
||||||
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
|
// 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')) {
|
if (!(project.hasProperty('env') && project.getProperty('env') == 'dev')) {
|
||||||
sourceSets {
|
sourceSets {
|
||||||
test {
|
test {
|
||||||
|
|||||||
@@ -91,13 +91,13 @@ dependencies {
|
|||||||
implementation project(':fineract-provider')
|
implementation project(':fineract-provider')
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(Tar) {
|
tasks.withType(Tar).configureEach {
|
||||||
compression Compression.GZIP
|
compression Compression.GZIP
|
||||||
archiveExtension = 'tar.gz'
|
archiveExtension = 'tar.gz'
|
||||||
|
|
||||||
// Enable caching for all tar tasks
|
// Enable caching for all tar tasks
|
||||||
outputs.cacheIf { true }
|
outputs.cacheIf { true }
|
||||||
|
|
||||||
// Ensure reproducible output
|
// Ensure reproducible output
|
||||||
preserveFileTimestamps = false
|
preserveFileTimestamps = false
|
||||||
reproducibleFileOrder = true
|
reproducibleFileOrder = true
|
||||||
|
|||||||
Reference in New Issue
Block a user