fineract-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ptuom...@apache.org
Subject [fineract] branch develop updated: FINERACT-1188: README and other files are not covered by Spotless
Date Wed, 14 Oct 2020 07:29:41 GMT
This is an automated email from the ASF dual-hosted git repository.

ptuomola pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git


The following commit(s) were added to refs/heads/develop by this push:
     new 5520bb3  FINERACT-1188: README and other files are not covered by Spotless
5520bb3 is described below

commit 5520bb3c2dfacdcc24572abda891784d6b7a0ef3
Author: Aleksandar Vidakovic <aleks@apache.org>
AuthorDate: Tue Oct 13 04:18:01 2020 +0200

    FINERACT-1188: README and other files are not covered by Spotless
---
 .travis.yml                                        |   2 +-
 Dockerfile                                         |   2 +-
 README.md                                          |   9 +-
 build.gradle                                       | 112 +++++++++++++++++
 .../OpenJPA Enhance Builder.launch                 |   4 +-
 fineract-provider/build.gradle                     | 136 +++------------------
 fineract-provider/gradlew                          |   1 -
 7 files changed, 133 insertions(+), 133 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 0c1fc3e..a0fa49e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -72,6 +72,6 @@ script:
 # using "&&" instead of several "-" means that integrationTest does not run if test
fails,
 # and Docker test does not run if integration test fails, which makes PR failure easier to
understand.
 # @see https://docs.travis-ci.com/user/job-lifecycle/#customizing-the-build-phase
-  - ./gradlew --console=plain -PautomatedBuild=true licenseMain licenseTest licenseIntegrationTest
check  &&  ./gradlew --console=plain -PautomatedBuild=true integrationTest --fail-fast
 &&  sudo service mysql stop  &&  docker-compose build  &&  docker-compose
up -d  &&  sleep 60s  && curl -f -k --retry 5 --retry-connrefused --connect-timeout
30 --retry-delay 30 https://localhost:8443/fineract-provider/actuator/health  && 
(( $(curl -f -k --retry 5 --retry-connrefused --connect-timeout 3 [...]
+  - ./gradlew --console=plain -PautomatedBuild=true licenseMain licenseTest licenseIntegrationTest
check  &&  ./gradlew --console=plain -PautomatedBuild=true integrationTest --fail-fast
 &&  sudo service mysql stop  &&  docker-compose build  &&  docker-compose
up -d  &&  sleep 60s  && curl -f -k --retry 5 --retry-connrefused --connect-timeout
30 --retry-delay 30 https://localhost:8443/fineract-provider/actuator/health  && 
(( $(curl -f -k --retry 5 --retry-connrefused --connect-timeout 3 [...]
 # We stop the mysql system service when running the Docker test to avoid port 3306 conflicts
(unless we run the mysql in docker-compose on another port; req. FINERACT-773)
 # The fancy /actuator/info test makes sure that has more than 100 characters of JSON to test
that the git.properties worked (see FINERACT-983)
diff --git a/Dockerfile b/Dockerfile
index d0eabe7..3713333 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -25,7 +25,7 @@ WORKDIR /fineract
 RUN ./gradlew -PautomatedBuild=true --no-daemon -q -x rat -x test bootJar
 
 WORKDIR /fineract/target
-RUN jar -xf /fineract/build/libs/fineract-provider*.jar
+RUN jar -xf /fineract/fineract-provider/build/libs/fineract-provider*.jar
 
 # https://issues.apache.org/jira/browse/LEGAL-462
 # https://issues.apache.org/jira/browse/FINERACT-762
diff --git a/README.md b/README.md
index b65bb83..ff46aba 100644
--- a/README.md
+++ b/README.md
@@ -83,13 +83,10 @@ Instructions to run and debug in Eclipse IDE
 It is possible to run Fineract in Eclipse IDE and also to debug Fineract using Eclipse's
debugging facilities.
 To do this, you need to create the Eclipse project files and import the project into an Eclipse
workspace:
 
-1. Create Eclipse project files into the Fineract project by running `./gradlew cleanEclipse
eclipse`
-2. Import the fineract-provider project into your Eclipse workspace (File->Import->General->Existing
Projects into Workspace, choose root directory fineract/fineract-provider)
-3. Do a clean build of the project in Eclipse (Project->Clean...)
+1. Import the fineract-provider project into your Eclipse workspace (File->Import->Gradle->Existing
Gradle Project into Workspace, choose root directory fineract/fineract-provider)
+2. Do a clean build of the project in Eclipse (Project->Clean...)
 3. Run / debug Fineract by right clicking on org.apache.fineract.ServerApplication class
and choosing Run As / Debug As -> Java Application. All normal Eclipse debugging features
(breakpoints, watchpoints etc) should work as expected.
 
-If you change the project settings (dependencies etc) in Gradle, you should redo step 1 and
refresh the project in Eclipse.
-
 You can also use Eclipse Junit support to run tests in Eclipse (Run As->Junit Test)
 
 Finally, modifying source code in Eclipse automatically triggers hot code replace to a running
instance, allowing you to immediately test your changes
@@ -203,7 +200,7 @@ Instructions to run Apache RAT (Release Audit Tool)
 2. Run `./gradlew rat`. A report will be generated under build/reports/rat/rat-report.txt
 
 
-Instructions to enable ActiveMQ 
+Instructions to enable ActiveMQ
 ============
 Messaging configuration is disabled by default. If you want to enable it and register some
message listeners, application needs to be started with the proper Spring profile, ie `-Dspring.profiles.active=activeMqEnabled`
(or one of the other Spring ways to configure it).
 
diff --git a/build.gradle b/build.gradle
index 139925f..435a5df 100644
--- a/build.gradle
+++ b/build.gradle
@@ -16,8 +16,120 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+// TODO: this is work in progress, please follow FINERACT-1171
 buildscript {
+    ext {
+        jacocoVersion = '0.8.5'
+    }
+    repositories {
+        jcenter()
+        maven { url "https://plugins.gradle.org/m2/" }
+    }
+
+    dependencies {
+        classpath 'com.bmuschko:gradle-cargo-plugin:2.7.1'
+        classpath 'org.zeroturnaround:gradle-jrebel-plugin:1.1.10'
+        classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.3.4.RELEASE'
+        classpath 'gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.15.0'
+        classpath 'org.apache.openjpa:openjpa:3.1.2' // when upgrading, also change OpenJPA
version repeated in fineract-provider/build.gradle!
+        classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0'
+        classpath 'org.nosphere.apache:creadur-rat-gradle:0.7.0'
+        classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.5.1"
+        classpath "gradle.plugin.com.github.andygoossens:gradle-modernizer-plugin:1.3.0"
+        classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.2.3"
+        classpath "net.ltgt.gradle:gradle-errorprone-plugin:1.2.1"
+        classpath "io.swagger.core.v3:swagger-gradle-plugin:2.1.5"
+        classpath "gradle.plugin.org.hidetake:gradle-swagger-generator-plugin:2.18.2"
+    }
+}
+
+plugins {
+    id 'io.spring.dependency-management' version '1.0.10.RELEASE'
+    id 'com.diffplug.spotless' version '5.6.1'
+}
+
+description = '''\
+Run as:
+gradle clean bootRun'''
+
+project.ext.jerseyVersion = '1.19.4'
+ext['groovy.version'] = '3.0.6'
+
+allprojects  {
+    group = 'org.apache.fineract'
+
     repositories {
         jcenter()
     }
+
+    apply plugin: 'io.spring.dependency-management'
+    apply plugin: "com.diffplug.spotless"
+
+    // Configuration for the spotless plugin
+    // https://github.com/diffplug/spotless/tree/main/plugin-gradle
+    spotless {
+        format 'misc', {
+            target '**/*.md', '**/*.properties', '**/.gitignore', '**/*.yml', '**/*.xml',
'**/**.json', '**/*.sql'
+            targetExclude '**/build/**', '**/bin/**', '**/.settings/**', '**/.idea/**', '**/.gradle/**'
+            indentWithSpaces(4)
+            endWithNewline()
+            trimTrailingWhitespace()
+        }
+
+        groovyGradle {
+            target '*.gradle', '**/*.gradle'
+            targetExclude '**/build/**'
+            greclipse()
+            indentWithSpaces(4)
+            endWithNewline()
+            trimTrailingWhitespace()
+        }
+
+        if (plugins.hasPlugin('java')) {
+            java {
+                targetExclude '**/build/**', '**/bin/**', '**/out/**'
+                importOrder() //sort imports alphabetically
+                removeUnusedImports()
+                eclipse().configFile "$rootDir/config/fineractdev-formatter.xml"
+                endWithNewline()
+                trimTrailingWhitespace()
+
+                // Enforce style modifier order
+                custom 'Modifier ordering', {
+                    def modifierRanking = [
+                        public      : 1,
+                        protected   : 2,
+                        private     : 3,
+                        abstract    : 4,
+                        default     : 5,
+                        static      : 6,
+                        final       : 7,
+                        transient   : 8,
+                        volatile    : 9,
+                        synchronized: 10,
+                        native      : 11,
+                        strictfp    : 12]
+                    // Find any instance of multiple modifiers. Lead with a non-word character
to avoid
+                    // accidental matching against for instance, "an alternative default
value"
+                    it.replaceAll(/\W(?:public |protected |private |abstract |default |static
|final |transient |volatile |synchronized |native |strictfp ){2,}/, {
+                        // Do not replace the leading non-word character.  Identify the modifiers
+                        it.replaceAll(/(?:public |protected |private |abstract |default |static
|final |transient |volatile |synchronized |native |strictfp ){2,}/, {
+                            // Sort the modifiers according to the ranking above
+                            it.split().sort({ modifierRanking[it] }).join(' ') + ' '
+                        }
+                        )
+                    }
+                    )
+                }
+            }
+
+            if (project.hasProperty("automatedBuild")) {
+                dependsOn(spotlessCheck)
+            } else {
+                dependsOn(spotlessApply)
+            }
+        }
+
+        lineEndings 'UNIX'
+    }
 }
diff --git a/fineract-provider/.externalToolBuilders/OpenJPA Enhance Builder.launch b/fineract-provider/.externalToolBuilders/OpenJPA
Enhance Builder.launch
index de36ed6..a741f73 100644
--- a/fineract-provider/.externalToolBuilders/OpenJPA Enhance Builder.launch	
+++ b/fineract-provider/.externalToolBuilders/OpenJPA Enhance Builder.launch	
@@ -2,9 +2,9 @@
 <launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType">
 <booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
 <stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:&lt;?xml
version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#10;&lt;resources&gt;&#10;&lt;item
path=&quot;/fineract-provider/bin/main&quot; type=&quot;2&quot;/&gt;&#10;&lt;/resources&gt;}"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/fineract-provider/gradlew}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/fineract/gradlew}"/>
 <stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="incremental,auto,"/>
 <stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-x rat
-x compileJava -x sql -x processResources -x  generateGitProperties -Penv=eclipse enhance"/>
 <booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
-<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/fineract-provider}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/fineract}"/>
 </launchConfiguration>
diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle
index 926492a..7d3098f 100644
--- a/fineract-provider/build.gradle
+++ b/fineract-provider/build.gradle
@@ -16,55 +16,13 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-description = '''\
-Run as:
-gradle clean bootRun'''
+description = 'Fineract Provider'
 
-group = 'org.apache.fineract'
-buildDir = new File(rootProject.projectDir, "build")
-
-repositories {
-    jcenter()
-}
-
-project.ext.jerseyVersion = '1.19.4'
-ext["groovy.version"] = '3.0.3'
-
-buildscript {
-    ext {
-        jacocoVersion = '0.8.5'
-    }
-    repositories {
-        jcenter()
-        maven { url "https://plugins.gradle.org/m2/" }
-    }
-
-    dependencies {
-        classpath 'io.spring.gradle:dependency-management-plugin:1.0.10.RELEASE'
-        classpath 'com.bmuschko:gradle-cargo-plugin:2.7.1'
-        classpath 'org.zeroturnaround:gradle-jrebel-plugin:1.1.10'
-        classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.3.4.RELEASE'
-        classpath 'gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.15.0'
-        classpath 'org.apache.openjpa:openjpa:3.1.2' // when upgrading, also change OpenJPA
version repeated below in dependencyManagement!
-        classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0'
-        classpath 'org.nosphere.apache:creadur-rat-gradle:0.7.0'
-        classpath "gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.5.1"
-        classpath "gradle.plugin.com.github.andygoossens:gradle-modernizer-plugin:1.3.0"
-        classpath "gradle.plugin.com.gorylenko.gradle-git-properties:gradle-git-properties:2.2.3"
-        classpath "net.ltgt.gradle:gradle-errorprone-plugin:1.2.1"
-        classpath "com.diffplug.spotless:spotless-plugin-gradle:5.6.1"
-        classpath "io.swagger.core.v3:swagger-gradle-plugin:2.1.5"
-        classpath "gradle.plugin.org.hidetake:gradle-swagger-generator-plugin:2.18.2"
-    }
-}
-
-apply plugin: 'io.spring.dependency-management'
 apply plugin: "org.nosphere.apache.rat"
 apply plugin: 'rebel'
 apply plugin: 'com.github.hierynomus.license'
 apply plugin: 'war'
 apply plugin: 'org.springframework.boot'
-apply plugin: 'eclipse'
 apply plugin: 'idea'
 apply plugin: 'com.bmuschko.cargo'
 apply plugin: 'project-report'
@@ -76,7 +34,6 @@ apply plugin: 'com.github.andygoossens.gradle-modernizer-plugin'
 apply plugin: 'jacoco'
 apply plugin: "com.gorylenko.gradle-git-properties"
 apply plugin: "net.ltgt.errorprone"
-apply plugin: "com.diffplug.spotless"
 apply plugin: "io.swagger.core.v3.swagger-gradle-plugin"
 apply plugin: "org.hidetake.swagger.generator"
 apply plugin: 'distribution'
@@ -179,13 +136,6 @@ if (project.hasProperty('env') && project.getProperty('env')
== 'eclipse')
     sourceSets.main.java.outputDir = new File(rootProject.projectDir, "fineract-provider/bin/main")
 }
 
-eclipse
-{
-    project {
-        buildCommand([ LaunchConfigHandle: "<project>/.externalToolBuilders/OpenJPA
Enhance Builder.launch" ],  'org.eclipse.ui.externaltools.ExternalToolBuilder')
-    }
-}
-
 // Configuration for the OpenJPA enhance task
 // https://github.com/radcortez/openjpa-gradle-plugin
 System.setProperty("openjpa.Log", "commons")
@@ -250,69 +200,11 @@ jacocoTestReport {
     }
 }
 
-// Configuration for the spotless plugin
-// https://github.com/diffplug/spotless/tree/main/plugin-gradle
-spotless {
-    format 'misc', {
-        target '**/*.md', '**/*.properties', '**/.gitignore', '**/*.yml', '**/*.xml', '**/**.json',
'**/*.sql'
-        targetExclude '**/build/**', '**/bin/**', '**/.settings/**','**/.idea/**'
-        indentWithSpaces(4)
-        endWithNewline()
-        trimTrailingWhitespace()
-    }
-
-    groovyGradle {
-        target '*.gradle', '**/*.gradle'
-        greclipse()
-        indentWithSpaces(4)
-        endWithNewline()
-        trimTrailingWhitespace()
-    }
-
-    java {
-        importOrder() //sort imports alphabetically
-        removeUnusedImports()
-        eclipse().configFile "$rootDir/config/fineractdev-formatter.xml"
-        endWithNewline()
-        trimTrailingWhitespace()
-
-        // Enforce style modifier order
-        custom 'Modifier ordering', {
-            def modifierRanking = [
-                public      : 1,
-                protected   : 2,
-                private     : 3,
-                abstract    : 4,
-                default     : 5,
-                static      : 6,
-                final       : 7,
-                transient   : 8,
-                volatile    : 9,
-                synchronized: 10,
-                native      : 11,
-                strictfp    : 12]
-            // Find any instance of multiple modifiers. Lead with a non-word character to
avoid
-            // accidental matching against for instance, "an alternative default value"
-            it.replaceAll(/\W(?:public |protected |private |abstract |default |static |final
|transient |volatile |synchronized |native |strictfp ){2,}/, {
-                // Do not replace the leading non-word character.  Identify the modifiers
-                it.replaceAll(/(?:public |protected |private |abstract |default |static |final
|transient |volatile |synchronized |native |strictfp ){2,}/, {
-                    // Sort the modifiers according to the ranking above
-                    it.split().sort({ modifierRanking[it] }).join(' ') + ' '
-                }
-                )
-            }
-            )
-        }
-    }
-
-    lineEndings 'UNIX'
-}
-
 // Configuration for Apache Release Audit Tool task
 // https://github.com/eskatos/creadur-rat-gradle
 rat {
     verbose = false
-    reportDir = new File(buildDir,'reports/rat')
+    reportDir = file("$buildDir/reports/rat")
     excludes = [
         '**/*.launch',
         '**/licenses/**',
@@ -612,12 +504,6 @@ modernizer {
 compileJava {
     dependsOn rat
     finalizedBy resolve
-
-    if (project.hasProperty("automatedBuild")) {
-        dependsOn(spotlessCheck)
-    } else {
-        dependsOn(spotlessApply)
-    }
 }
 
 war {
@@ -688,6 +574,12 @@ dependencies {
 cargo {
     containerId "tomcat9x"
 
+    // looks like Cargo doesn't detect the WAR file automatically in the multi-module setup
+    deployable {
+        file = file("${buildDir}/libs/fineract-provider.war")
+        context = 'fineract-provider'
+    }
+
     local {
         installer {
             installConfiguration = configurations.tomcat
@@ -854,7 +746,7 @@ distributions {
         contents {
             from bootJar
             from bootWar
-            from("$rootDir/build/swagger-code-fineract/build/libs/") {
+            from("$buildDir/swagger-code-fineract/build/libs/") {
                 include '**/*.jar'
                 rename 'client-(.+)\\.jar', 'fineract-client.jar'
             }
@@ -900,7 +792,7 @@ if( project.hasProperty("fineract.release") ) {
             task.getFilesToSign().each { f ->
                 new ByteArrayOutputStream().withStream { os ->
                     def result = exec {
-                        workingDir "$rootDir/build/distributions"
+                        workingDir "$buildDir/distributions"
                         executable 'sh'
                         args '-c', "gpg --verify ${f}.asc"
                         standardOutput = os
@@ -990,7 +882,7 @@ task prepareConfigJson(dependsOn: 'generateGitProperties') {
 
 swaggerSources {
     fineract {
-        inputFile = file("$rootDir/build/classes/java/main/static/swagger-ui/fineract.yaml")
+        inputFile = file("$buildDir/classes/java/main/static/swagger-ui/fineract.yaml")
         code {
             language = 'java'
             configFile = file('config/swagger/config.json')
@@ -999,15 +891,15 @@ swaggerSources {
     }
 }
 
-generateSwaggerCodeFineract.dependsOn prepareConfigJson
+// had to put resolve dependency here to make this work in multi-module
+generateSwaggerCodeFineract.dependsOn prepareConfigJson, resolve
 
 // TODO: fix version information for client jar
 // TODO: refactor to multi-module project and make client a separate module; cleaner than
running exec
 task buildSwaggerCodeFineract(type:Exec, dependsOn: [
-    'resolve',
     'generateSwaggerCodeFineract'
 ]) {
-    workingDir "$rootDir/build/swagger-code-fineract"
+    workingDir "$buildDir/swagger-code-fineract"
     executable 'sh'
     args '-c', 'chmod +x gradlew && ./gradlew clean build'
 }
diff --git a/fineract-provider/gradlew b/fineract-provider/gradlew
deleted file mode 120000
index 502f5a2..0000000
--- a/fineract-provider/gradlew
+++ /dev/null
@@ -1 +0,0 @@
-../gradlew
\ No newline at end of file


Mime
View raw message