From 7f1a520fd924ff79d7a0b7843556fd0e27e9aa01 Mon Sep 17 00:00:00 2001 From: Kristof Jozsa Date: Mon, 7 Oct 2024 15:41:33 +0200 Subject: [PATCH] fineract-progressive-loan module turned to kts --- build.gradle | 30 +++--- fineract-progressive-loan/build.gradle | 100 ------------------ fineract-progressive-loan/build.gradle.kts | 52 +++++++++ fineract-progressive-loan/build.gradle.off | 77 ++++++++++++++ fineract-progressive-loan/dependencies.gradle | 62 ----------- 5 files changed, 144 insertions(+), 177 deletions(-) delete mode 100644 fineract-progressive-loan/build.gradle create mode 100644 fineract-progressive-loan/build.gradle.kts create mode 100644 fineract-progressive-loan/build.gradle.off diff --git a/build.gradle b/build.gradle index 47f1ee34093..350ae65280a 100644 --- a/build.gradle +++ b/build.gradle @@ -87,32 +87,32 @@ buildscript { } plugins { - id 'me.qoomon.git-versioning' version '6.4.4' + // id 'org.asciidoctor.jvm.gems' version '3.3.2' apply false + // id 'org.asciidoctor.jvm.revealjs' version '3.3.2' apply false + id "com.github.davidmc24.gradle.plugin.avro-base" version "1.9.1" apply false id "org.barfuin.gradle.taskinfo" version "2.2.0" id 'com.adarshr.test-logger' version '4.0.0' id 'com.diffplug.spotless' version '6.25.0' apply false - id 'org.nosphere.apache.rat' version '0.8.1' apply false + id 'com.github.andygoossens.modernizer' version '1.9.3' apply false id 'com.github.hierynomus.license' version '0.16.1' apply false id 'com.github.jk1.dependency-license-report' version '2.9' apply false - id 'org.zeroturnaround.gradle.jrebel' version '1.2.0' apply false - id 'org.springframework.boot' version '3.3.3' apply false - id 'net.ltgt.errorprone' version '3.1.0' apply false - id 'io.swagger.core.v3.swagger-gradle-plugin' version '2.2.23' apply false + id 'com.github.spotbugs' version '6.0.22' apply false + id 'com.google.cloud.tools.jib' version '3.4.3' apply false id 'com.gorylenko.gradle-git-properties' version '2.4.2' apply false + id "io.freefair.lombok" version "8.10.2" + id 'io.swagger.core.v3.swagger-gradle-plugin' version '2.2.23' apply false + id 'me.qoomon.git-versioning' version '6.4.4' + id 'net.ltgt.errorprone' version '3.1.0' apply false id 'org.asciidoctor.jvm.convert' version '3.3.2' apply false - id 'org.asciidoctor.jvm.pdf' version '3.3.2' apply false id 'org.asciidoctor.jvm.epub' version '3.3.2' apply false - // id 'org.asciidoctor.jvm.revealjs' version '3.3.2' apply false - // id 'org.asciidoctor.jvm.gems' version '3.3.2' apply false + id 'org.asciidoctor.jvm.pdf' version '3.3.2' apply false id 'org.asciidoctor.kindlegen.base' version '3.2.0' apply false - id 'com.google.cloud.tools.jib' version '3.4.3' apply false + id 'org.nosphere.apache.rat' version '0.8.1' apply false + id 'org.openapi.generator' version '7.8.0' apply false id 'org.sonarqube' version '4.4.1.3373' apply false - id 'com.github.andygoossens.modernizer' version '1.9.3' apply false - // TODO: upgrade to 6.0.4 - id 'com.github.spotbugs' version '6.0.22' apply false + id 'org.springframework.boot' version '3.3.3' apply false + id 'org.zeroturnaround.gradle.jrebel' version '1.2.0' apply false id 'se.thinkcode.cucumber-runner' version '0.0.11' apply false - id "com.github.davidmc24.gradle.plugin.avro-base" version "1.9.1" apply false - id 'org.openapi.generator' version '7.8.0' apply false } apply from: "${rootDir}/buildSrc/src/main/groovy/org.apache.fineract.release.gradle" diff --git a/fineract-progressive-loan/build.gradle b/fineract-progressive-loan/build.gradle deleted file mode 100644 index 20e9f20b4ba..00000000000 --- a/fineract-progressive-loan/build.gradle +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -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/" - } - 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" - } -} - -configurations { - providedRuntime // needed for Spring Boot executable WAR - providedCompile - compile() { - exclude module: 'hibernate-entitymanager' - exclude module: 'hibernate-validator' - exclude module: 'activation' - exclude module: 'bcmail-jdk14' - exclude module: 'bcprov-jdk14' - exclude module: 'bctsp-jdk14' - exclude module: 'c3p0' - exclude module: 'stax-api' - exclude module: 'jaxb-api' - exclude module: 'jaxb-impl' - exclude module: 'jboss-logging' - exclude module: 'itext-rtf' - exclude module: 'classworlds' - } - runtime -} - -apply from: 'dependencies.gradle' - -// Configuration for the modernizer plugin -// https://github.com/andygoossens/gradle-modernizer-plugin -modernizer { - ignoreClassNamePatterns = [ - '.*AbstractPersistableCustom', - '.*EntityTables', - '.*domain.*' - ] -} - -// If we are running Gradle within Eclipse to enhance classes with OpenJPA, -// set the classes directory to point to Eclipse's default build directory -if (project.hasProperty('env') && project.getProperty('env') == 'eclipse') { - sourceSets.main.java.outputDir = new File(rootProject.projectDir, "fineract-progressive-loan/bin/main") -} - -eclipse { - project { - buildCommand([ LaunchConfigHandle: "/.externalToolBuilders/OpenJPA Enhance Builder.launch" ], 'org.eclipse.ui.externaltools.ExternalToolBuilder') - } -} - -/* 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 { - java { - exclude '**/core/boot/tests/**' - } - } - } -} diff --git a/fineract-progressive-loan/build.gradle.kts b/fineract-progressive-loan/build.gradle.kts new file mode 100644 index 00000000000..eb31f69f35a --- /dev/null +++ b/fineract-progressive-loan/build.gradle.kts @@ -0,0 +1,52 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +description = "Fineract Progressive Loan" + +dependencies { + implementation(project(":fineract-accounting")) + implementation(project(":fineract-charge")) + implementation(project(":fineract-core")) + implementation(project(":fineract-loan")) + implementation(project(":fineract-avro-schemas")) + + implementation("com.github.spotbugs:spotbugs-annotations") + implementation("com.google.code.gson:gson") + implementation("com.google.guava:guava") + implementation("com.jayway.jsonpath:json-path") + implementation("com.squareup.retrofit2:converter-gson") + implementation("io.github.resilience4j:resilience4j-spring-boot3") + implementation("io.swagger.core.v3:swagger-annotations-jakarta") + implementation("jakarta.ws.rs:jakarta.ws.rs-api") + implementation("org.apache.commons:commons-lang3") + implementation("org.glassfish.jersey.media:jersey-media-multipart") + implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui") + implementation("org.springframework.boot:spring-boot-starter-security") + implementation("org.springframework.boot:spring-boot-starter-web") + + implementation("org.mapstruct:mapstruct") + annotationProcessor("org.mapstruct:mapstruct-processor") + + implementation("org.springframework.boot:spring-boot-starter-data-jpa") { + exclude(group = "org.hibernate") + } + implementation("org.eclipse.persistence:org.eclipse.persistence.jpa") { + exclude(group = "org.eclipse.persistence", module = "jakarta.persistence") + } + testImplementation("org.springframework.boot:spring-boot-starter-test") +} \ No newline at end of file diff --git a/fineract-progressive-loan/build.gradle.off b/fineract-progressive-loan/build.gradle.off new file mode 100644 index 00000000000..c61ed9d520e --- /dev/null +++ b/fineract-progressive-loan/build.gradle.off @@ -0,0 +1,77 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +description = 'Fineract Progressive Loan' +apply plugin: 'java' + +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/" + } + 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" + } +} + +apply from: 'dependencies.gradle' + +//configurations { +// providedRuntime // needed for Spring Boot executable WAR +// providedCompile +// compile() { +// exclude module: 'hibernate-entitymanager' +// exclude module: 'hibernate-validator' +// exclude module: 'activation' +// exclude module: 'bcmail-jdk14' +// exclude module: 'bcprov-jdk14' +// exclude module: 'bctsp-jdk14' +// exclude module: 'c3p0' +// exclude module: 'stax-api' +// exclude module: 'jaxb-api' +// exclude module: 'jaxb-impl' +// exclude module: 'jboss-logging' +// exclude module: 'itext-rtf' +// exclude module: 'classworlds' +// } +// runtime +//} + + +/* 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 { +// java { +// exclude '**/core/boot/tests/**' +// } +// } +// } +//} diff --git a/fineract-progressive-loan/dependencies.gradle b/fineract-progressive-loan/dependencies.gradle index c39bee8640e..709170e1289 100644 --- a/fineract-progressive-loan/dependencies.gradle +++ b/fineract-progressive-loan/dependencies.gradle @@ -16,65 +16,3 @@ * specific language governing permissions and limitations * under the License. */ - -dependencies { - // Never use "compile" scope, but make all dependencies either 'implementation', 'runtimeOnly' or 'testCompile'. - // Note that we never use 'api', because Fineract at least currently is a simple monolithic application ("WAR"), not a library. - // We also (normally should have) no need to ever use 'compileOnly'. - - // implementation dependencies are directly used (compiled against) in src/main (and src/test) - // - implementation(project(path: ':fineract-core')) - implementation(project(path: ':fineract-accounting')) - implementation(project(path: ':fineract-charge')) - implementation(project(path: ':fineract-loan')) - implementation('org.apache.avro:avro') - implementation( - project(path: ':fineract-avro-schemas') - ) - - implementation( - 'org.springframework.boot:spring-boot-starter-web', - 'org.springframework.boot:spring-boot-starter-security', - 'jakarta.ws.rs:jakarta.ws.rs-api', - 'org.glassfish.jersey.media:jersey-media-multipart', - - 'com.google.guava:guava', - 'com.google.code.gson:gson', - - 'org.apache.commons:commons-lang3', - - 'com.jayway.jsonpath:json-path', - - 'com.github.spotbugs:spotbugs-annotations', - 'io.swagger.core.v3:swagger-annotations-jakarta', - - 'com.squareup.retrofit2:converter-gson', - - 'org.springdoc:springdoc-openapi-starter-webmvc-ui', - 'org.mapstruct:mapstruct', - - 'io.github.resilience4j:resilience4j-spring-boot3', - ) - compileOnly 'org.projectlombok:lombok' - annotationProcessor 'org.projectlombok:lombok' - annotationProcessor 'org.mapstruct:mapstruct-processor' - implementation ('org.springframework.boot:spring-boot-starter-data-jpa') { - exclude group: 'org.hibernate' - } - implementation('org.eclipse.persistence:org.eclipse.persistence.jpa') { - exclude group: 'org.eclipse.persistence', module: 'jakarta.persistence' - } - // testCompile dependencies are ONLY used in src/test, not src/main. - // Do NOT repeat dependencies which are ALREADY in implementation or runtimeOnly! - // - testImplementation( 'io.github.classgraph:classgraph' ) - testImplementation ('org.springframework.boot:spring-boot-starter-test') { - exclude group: 'com.jayway.jsonpath', module: 'json-path' - exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' - exclude group: 'jakarta.activation' - exclude group: 'javax.activation' - exclude group: 'org.skyscreamer' - } - testImplementation ('org.mockito:mockito-inline') -}