Skip to content

Commit

Permalink
FINERACT-1470: Fineract release plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
vidakovic committed May 4, 2022
1 parent b185937 commit 40eb547
Show file tree
Hide file tree
Showing 160 changed files with 4,954 additions and 638 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-docker-postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
with:
java-version: '17'
distribution: 'zulu'
cache: gradle
- name: Build the image
run: ./gradlew :fineract-provider:clean :fineract-provider:jibDockerBuild -x test
- name: Start the stack
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
with:
java-version: '17'
distribution: 'zulu'
cache: gradle
- name: Build the image
run: ./gradlew :fineract-provider:clean :fineract-provider:jibDockerBuild -x test
- name: Start the stack
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
with:
java-version: '17'
distribution: 'zulu'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@859c33240bd026ce8d5f711f5adcc65c2f8eafc1
- name: Verify PostgreSQL connection
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
with:
java-version: '17'
distribution: 'zulu'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@859c33240bd026ce8d5f711f5adcc65c2f8eafc1
- name: Verify MariaDB connection
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
with:
java-version: '17'
distribution: 'zulu'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@859c33240bd026ce8d5f711f5adcc65c2f8eafc1
- name: Sonarqube
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ bin/
fineract-provider/out/
fineract-provider/config/swagger/config.json
fineract-provider/config/swagger/fineract-input.yaml
licenses
licenses
**/.asciidoctor/images/*
**/.asciidoctor/diagram/*
**/images/diag-*.svg
53 changes: 0 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,59 +457,6 @@ Upgrades sometimes require package name changes. Changed code should ideally ha
Our `ClasspathHellDuplicatesCheckRuleTest` detects classes that appear in more than 1 JAR. If a version bump in [`build.gradle`](https://github.com/search?q=repo%3Aapache%2Ffineract+filename%3Abuild.gradle&type=Code&ref=advsearch&l=&l=) causes changes in transitives dependencies, then you may have to add related `exclude` to our [`dependencies.gradle`](https://github.com/apache/fineract/search?q=dependencies.gradle). Running `./gradlew dependencies` helps to understand what is required.


Releasing
---------

[How to Release Apache Fineract](https://cwiki.apache.org/confluence/x/DRwIB) documents the process how we make the source code that is available here in this Git repository into a binary release tar.gz available on https://fineract.apache.org.

Before you use Gradle to create a release you need to make sure that you provide the proper GPG parameters. You have to options:

1. Provide the parameters via ~/.gradle/gradle.properties in your home folder:
```
signing.gnupg.keyName=7890ABCD
signing.gnupg.passphrase=secret
```

IMPORTANT: Do not set your GPG secrets in one of the project gradle.properties and double check that you are not accidentally committing them to Git.

The release command would look then look like this:
```
./gradlew -Pfineract.release clean build
```

2. Another way to provide these parameters are via project parameters on the command line. A release command would then look like this:
```
./gradlew -Pfineract.release -Psigning.gnupg.keyName=7890ABCD -Psigning.gnupg.passphrase=secret clean build
```

NOTE: Let's assume your GPG key ID would be "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCD" then you have to use the last 8 characters (i. e. "7890ABCD") for the signing plugin property "signing.gnupg.keyName".

Above tasks will create the following files in folder build/distributions:

- binary distribution file: apache-fineract-1.6.0-binary.tar.gz
- ASCII armored signature for binary distribution: apache-fineract-1.6.0-binary.tar.gz.asc
- SHA512 checksum for binary distribution: apache-fineract-1.6.0-binary.tar.gz.sha512
- source distribution file: apache-fineract-1.6.0-src.tar.gz
- ASCII armored signature for source distribution: apache-fineract-1.6.0-src.tar.gz.asc
- SHA512 checksum for source distribution: apache-fineract-1.6.0-src.tar.gz.sha512

The signatures are automatically verified by the build script. It will throw an exception if the verification fails.

Additionally, you can verify the validity of the release distribution files e. g. with:
```
gpg --verify build/distributions/apache-fineract-1.6.0-binary.tar.gz.asc
```

The output should look somewhat like this:
```
gpg: assuming signed data in 'build/distributions/apache-fineract-1.6.0-binary.tgz'
gpg: Signature made Mi 26 Aug 2020 17:17:45 CEST
gpg: using RSA key ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCD
gpg: Good signature from "Aleksandar Vidakovic (Apache Fineract Release Manager) <[email protected]>" [ultimate]
```

NOTE: All commands shown above are assuming that the current working directory is the project root folder.

More Information
============
More details of the project can be found at <https://cwiki.apache.org/confluence/display/FINERACT>.
167 changes: 9 additions & 158 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ buildscript {
}

plugins {
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id "org.barfuin.gradle.taskinfo" version "1.4.0"
id 'com.adarshr.test-logger' version '3.2.0'
id 'com.diffplug.spotless' version '6.5.0' apply false
id 'com.diffplug.spotless' version '6.5.1' apply false
id 'org.nosphere.apache.rat' version '0.7.1' apply false
id 'com.github.hierynomus.license' version '0.16.1' apply false
id 'com.github.jk1.dependency-license-report' version '2.1' apply false
Expand All @@ -68,7 +67,7 @@ plugins {
id 'org.springframework.boot' version '2.6.7' apply false
id 'net.ltgt.errorprone' version '2.0.2' apply false
id 'io.swagger.core.v3.swagger-gradle-plugin' version '2.2.0' apply false
id 'com.gorylenko.gradle-git-properties' version '2.4.0' apply false
id 'com.gorylenko.gradle-git-properties' version '2.4.1' 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
Expand All @@ -83,6 +82,8 @@ plugins {
id 'se.thinkcode.cucumber-runner' version '0.0.10' apply false
}

apply from: "${rootDir}/buildSrc/src/main/groovy/org.apache.fineract.release.gradle"

description = '''\
Run as:
gradle clean bootRun'''
Expand All @@ -91,6 +92,8 @@ ext['groovy.version'] = '3.0.10'
ext['swaggerFile'] = "$rootDir/fineract-provider/build/classes/java/main/static/fineract.yaml".toString()

allprojects {
apply from: "${rootDir}/buildSrc/src/main/groovy/org.apache.fineract.dependencies.gradle"

group = 'org.apache.fineract'

jgitver {
Expand All @@ -103,166 +106,13 @@ allprojects {
mavenCentral()
}

apply plugin: 'io.spring.dependency-management'
apply plugin: 'com.adarshr.test-logger'
apply plugin: 'com.diffplug.spotless'
apply plugin: 'com.github.hierynomus.license'
apply plugin: 'org.nosphere.apache.rat'
apply plugin: 'project-report'
apply plugin: 'com.github.jk1.dependency-license-report'

// Configuration for the dependency management plugin
// https://github.com/spring-gradle-plugins/dependency-management-plugin
dependencyManagement {
imports {
mavenBom 'org.springframework:spring-framework-bom:5.3.19'
mavenBom 'org.springframework.boot:spring-boot-dependencies:2.6.7'
mavenBom 'org.jetbrains.kotlin:kotlin-bom:1.6.21'
mavenBom 'org.junit:junit-bom:5.8.2'
mavenBom 'com.fasterxml.jackson:jackson-bom:2.13.2.1'
mavenBom 'io.cucumber:cucumber-bom:7.3.2'
mavenBom 'io.netty:netty-bom:4.1.76.Final'
mavenBom 'org.mockito:mockito-bom:4.5.1'
mavenBom 'io.github.swagger2markup:swagger2markup-bom:1.3.4'
}

dependencies {
// We use fixed versions, instead of inheriting them from the Spring BOM, to be able to be on more recent ones.
// We do not use :+ to get the latest available version available on Maven Central, as that could suddenly break things.
// We use the Renovate Bot to automatically propose Pull Requests (PRs) when upgrades for all of these versions are available.

dependency 'org.slf4j:slf4j-api:1.7.36'
dependency 'org.slf4j:slf4j-simple:1.7.36'
dependency 'org.slf4j:jcl-over-slf4j:1.7.36'
dependency 'org.slf4j:jul-to-slf4j:1.7.36'
dependency 'org.slf4j:log4j-over-slf4j:1.7.36'
dependency 'ch.qos.logback:logback-core:1.2.11'
dependency 'ch.qos.logback:logback-classic:1.2.11'

dependency 'org.eclipse.persistence:org.eclipse.persistence.jpa:2.7.10'
dependency 'com.google.guava:guava:31.1-jre'
dependency 'com.google.code.gson:gson:2.9.0'
dependency 'com.google.truth:truth:1.1.3'
dependency 'com.google.truth.extensions:truth-java8-extension:1.1.3'
dependency 'com.google.googlejavaformat:google-java-format:1.15.0'
dependency ('org.apache.commons:commons-email:1.5') {
exclude 'com.sun.mail:javax.mail'
exclude 'javax.activation:activation'
}
dependency 'commons-io:commons-io:2.11.0'
dependency 'com.github.librepdf:openpdf:1.3.27'
dependency ('org.mnode.ical4j:ical4j:3.2.2') {
exclude 'com.sun.mail:javax.mail'
}
dependency 'org.quartz-scheduler:quartz:2.3.2'
dependency 'com.amazonaws:aws-java-sdk-s3:1.12.205'
dependency 'org.ehcache:ehcache:3.10.0'
dependency 'com.github.spullara.mustache.java:compiler:0.9.10'
dependency 'com.jayway.jsonpath:json-path:2.7.0'
dependency 'org.apache.tika:tika-core:2.3.0'
dependency 'org.apache.httpcomponents:httpclient:4.5.13'
dependency 'jakarta.management.j2ee:jakarta.management.j2ee-api:1.1.4'
dependency 'jakarta.jms:jakarta.jms-api:2.0.3'
dependency 'org.glassfish.jaxb:jaxb-runtime:2.3.6' // Swagger needs exactly this version
dependency 'org.apache.bval:org.apache.bval.bundle:2.0.5'
dependency 'joda-time:joda-time:2.10.14'

dependency 'io.github.classgraph:classgraph:4.8.146'
dependency 'org.awaitility:awaitility:4.2.0'
dependency 'com.github.spotbugs:spotbugs-annotations:4.6.0'
dependency 'javax.cache:cache-api:1.1.1'
dependency 'org.mock-server:mockserver-junit-jupiter:5.13.2'
dependency 'org.webjars:webjars-locator-core:0.50'
dependency 'com.icegreen:greenmail-junit5:1.6.8'
dependency 'com.intuit.karate:karate-junit5:1.2.0.RC6'

// fineract client dependencies
dependency "com.squareup.retrofit2:retrofit:$retrofitVersion"
dependency "com.squareup.retrofit2:retrofit-mock:$retrofitVersion"
dependency "com.squareup.retrofit2:adapter-java8:$retrofitVersion"
dependency "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
dependency "com.squareup.retrofit2:adapter-rxjava3:$retrofitVersion"
dependency "com.squareup.retrofit2:adapter-guava:$retrofitVersion"
dependency "com.squareup.retrofit2:converter-wire:$retrofitVersion"
dependency "com.squareup.retrofit2:converter-jackson:$retrofitVersion"
dependency "com.squareup.retrofit2:converter-simplexml:$retrofitVersion"
dependency "com.squareup.retrofit2:converter-jaxb:$retrofitVersion"
dependency "com.squareup.retrofit2:converter-java8:$retrofitVersion"
dependency "com.squareup.retrofit2:converter-scalars:$retrofitVersion"
dependency "com.squareup.retrofit2:converter-gson:$retrofitVersion"
dependency "com.squareup.retrofit2:converter-protobuf:$retrofitVersion"
dependency "org.apache.oltu.oauth2:org.apache.oltu.oauth2.common:$oltuVersion"
dependency "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltuVersion"
dependency "org.apache.oltu.oauth2:org.apache.oltu.oauth2.httpclient4:$oltuVersion"
dependency "com.squareup.okhttp3:okhttp:$okhttpVersion"
dependency "com.squareup.okhttp3:okcurl:$okhttpVersion"
dependency "com.squareup.okhttp3:logging-interceptor:$okhttpVersion"
dependency "com.squareup.okhttp3:okhttp-apache:$okhttpVersion"
dependency "com.squareup.okhttp3:okhttp-android-support:$okhttpVersion"
dependency "com.squareup.okhttp3:okhttp-urlconnection:$okhttpVersion"
dependency "com.squareup.okhttp3:okhttp-sse:$okhttpVersion"
dependency "io.gsonfire:gson-fire:1.8.5"
dependency "com.google.code.findbugs:jsr305:3.0.2"
dependency "commons-codec:commons-codec:1.15"
dependency "org.bouncycastle:bcpkix-jdk15to18:1.70"
dependency "org.bouncycastle:bcprov-jdk15to18:1.70"
dependency "org.projectlombok:lombok:1.18.24"

dependency 'org.springdoc:springdoc-openapi-ui:1.6.8'
dependency 'org.springdoc:springdoc-openapi-webmvc-core:1.6.8'
dependency 'org.springdoc:springdoc-openapi-common:1.6.8'
dependency 'org.springdoc:springdoc-openapi-security:1.6.8'
dependency 'org.springdoc:springdoc-openapi-javadoc:1.6.8'

dependency ('org.apache.activemq:activemq-broker:5.17.0') {
exclude 'javax.annotation:javax.annotation-api'
}

dependency 'io.swagger:swagger-annotations:1.6.6'
dependency 'io.swagger.core.v3:swagger-annotations:2.2.0'
dependency ('io.swagger.core.v3:swagger-jaxrs2:2.2.0') {
exclude 'jakarta.activation:jakarta.activation-api'
}
dependency ('io.swagger.core.v3:swagger-core:2.2.0') {
exclude 'jakarta.activation:jakarta.activation-api'
}

dependency "jakarta.annotation:jakarta.annotation-api:1.3.5"
dependency 'jakarta.activation:jakarta.activation-api:1.2.2'
dependency ('com.sun.mail:jakarta.mail:1.6.7') {
exclude 'com.sun.activation:jakarta.activation'
}
dependency ('jakarta.xml.bind:jakarta.xml.bind-api:2.3.3') {
exclude 'jakarta.activation:jakarta.activation-api'
}

dependency ('org.liquibase:liquibase-core:4.9.1') {
exclude 'javax.xml.bind:jaxb-api'
}

dependency ('org.dom4j:dom4j:2.1.3') {
exclude 'relaxngDatatype:relaxngDatatype' // already in com.sun.xml.bind:jaxb-osgi:2.3.0.1
// FINERACT-940 && FINERACT-966 https://github.com/spotbugs/spotbugs/issues/1128
exclude 'xpp3:xpp3'
exclude 'pull-parser:pull-parser'
}

dependency 'org.owasp.esapi:esapi:2.3.0.0'

dependencySet(group: 'org.apache.poi', version: '5.2.2') {
entry 'poi'
entry 'poi-ooxml'
entry 'poi-ooxml-schemas'
}

dependencySet(group: 'io.rest-assured', version: '4.5.1') {
entry 'rest-assured'
entry 'json-path'
entry 'xml-path'
}
}
}

// Configuration for the sonarqube plugin is now in GitHub Actions

// Configuration for the spotless plugin
Expand Down Expand Up @@ -415,6 +265,7 @@ configure(project.fineractJavaProjects) {
apply plugin: 'com.github.andygoossens.modernizer'
apply plugin: 'se.thinkcode.cucumber-runner'


/* define the valid syntax level for source files */
sourceCompatibility = JavaVersion.VERSION_17
/* define binary compatibility version */
Expand Down Expand Up @@ -528,8 +379,8 @@ configure(project.fineractJavaProjects) {
// Configuration for the Checkstyle plugin
// https://docs.gradle.org/current/userguide/checkstyle_plugin.html
dependencies {
checkstyle 'com.puppycrawl.tools:checkstyle:10.1'
checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.41.0'
checkstyle 'com.puppycrawl.tools:checkstyle:10.2'
checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.42.0'
}

// Configuration for JaCoCo code coverage task
Expand Down
51 changes: 51 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* 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
*
* https://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.
*/
plugins {
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'groovy'
id 'java-gradle-plugin'
id 'groovy-gradle-plugin'
}

apply from: "${projectDir}/src/main/groovy/org.apache.fineract.dependencies.gradle"

description = 'Fineract Gradle Plugin'

repositories {
gradlePluginPortal()
mavenCentral()
}

dependencies {
implementation 'com.sun.mail:jakarta.mail'
implementation 'org.freemarker:freemarker'
implementation 'org.tmatesoft.svnkit:svnkit'
implementation 'org.bouncycastle:bcprov-jdk15on'
implementation 'org.bouncycastle:bcpg-jdk15on'
implementation 'org.eclipse.jgit:org.eclipse.jgit'
implementation 'org.eclipse.jgit:org.eclipse.jgit.ssh.apache'
implementation 'com.vdurmont:semver4j'
implementation 'org.beryx:text-io'
implementation 'commons-io:commons-io'
implementation 'com.squareup.okhttp3:okhttp'
implementation 'com.squareup.okhttp3:logging-interceptor'
implementation 'com.squareup.retrofit2:retrofit'
implementation 'com.squareup.retrofit2:converter-jackson'
implementation 'com.fasterxml.jackson.core:jackson-databind'
}
Loading

0 comments on commit 40eb547

Please sign in to comment.