FINERACT-1074: Sorting out plugin configurations

This commit is contained in:
Petri Tuomola
2020-07-05 14:56:38 +01:00
committed by Yemdjih Kaze Nasser
parent 06ab553d92
commit e4d6cc543e
+53 -40
View File
@@ -20,10 +20,17 @@ description = '''\
Run as: Run as:
gradle clean bootRun''' gradle clean bootRun'''
group = 'org.apache.fineract'
buildDir = new File(rootProject.projectDir, "../build")
repositories {
jcenter()
mavenCentral()
}
project.ext.jerseyVersion = '1.19.4' project.ext.jerseyVersion = '1.19.4'
ext["groovy.version"] = '3.0.3' ext["groovy.version"] = '3.0.3'
buildscript { buildscript {
ext { ext {
jacocoVersion = '0.8.5' jacocoVersion = '0.8.5'
@@ -36,11 +43,10 @@ buildscript {
dependencies { dependencies {
classpath 'io.spring.gradle:dependency-management-plugin:1.0.9.RELEASE' classpath 'io.spring.gradle:dependency-management-plugin:1.0.9.RELEASE'
classpath 'com.bmuschko:gradle-cargo-plugin:2.7.1', classpath 'com.bmuschko:gradle-cargo-plugin:2.7.1'
'nl.javadude.gradle.plugins:license-gradle-plugin:0.11.0', classpath 'org.zeroturnaround:gradle-jrebel-plugin:1.1.10'
'org.zeroturnaround:gradle-jrebel-plugin:1.1.10', classpath 'org.springframework.boot:spring-boot-gradle-plugin:2.3.1.RELEASE'
'org.springframework.boot:spring-boot-gradle-plugin:2.3.1.RELEASE' classpath 'gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.15.0'
// below
classpath 'org.apache.openjpa:openjpa:3.1.1' // when upgrading, also change OpenJPA version repeated below in dependencyManagement! classpath 'org.apache.openjpa:openjpa:3.1.1' // when upgrading, also change OpenJPA version repeated below in dependencyManagement!
classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0' classpath 'com.radcortez.gradle:openjpa-gradle-plugin:3.1.0'
classpath 'org.nosphere.apache:creadur-rat-gradle:0.7.0' classpath 'org.nosphere.apache:creadur-rat-gradle:0.7.0'
@@ -56,7 +62,7 @@ buildscript {
apply plugin: 'io.spring.dependency-management' apply plugin: 'io.spring.dependency-management'
apply plugin: "org.nosphere.apache.rat" apply plugin: "org.nosphere.apache.rat"
apply plugin: 'rebel' apply plugin: 'rebel'
apply plugin: 'license' apply plugin: 'com.github.hierynomus.license'
apply plugin: 'war' apply plugin: 'war'
apply plugin: 'org.springframework.boot' apply plugin: 'org.springframework.boot'
apply plugin: 'eclipse' apply plugin: 'eclipse'
@@ -158,16 +164,6 @@ sourceCompatibility = JavaVersion.VERSION_11
/* define binary compatibility version */ /* define binary compatibility version */
targetCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11
project.ext.mysqlUser='root'
project.ext.mysqlPassword='mysql'
group = 'org.apache.fineract'
buildDir = new File(rootProject.projectDir, "../build")
repositories {
jcenter()
// mavenLocal() // useful for local dev using MariaDB4j SNAPSHOTs (not needed for real-world non-SNAPHOT builds)
}
// If we are running Gradle within Eclipse to enhance classes with OpenJPA, // If we are running Gradle within Eclipse to enhance classes with OpenJPA,
// set the classes directory to point to Eclipse's default build directory // set the classes directory to point to Eclipse's default build directory
if (project.hasProperty('env') && project.getProperty('env') == 'eclipse') if (project.hasProperty('env') && project.getProperty('env') == 'eclipse')
@@ -182,6 +178,8 @@ eclipse
} }
} }
// Configuration for the OpenJPA enhance task
// https://github.com/radcortez/openjpa-gradle-plugin
System.setProperty("openjpa.Log", "commons") System.setProperty("openjpa.Log", "commons")
openjpa { openjpa {
@@ -210,17 +208,18 @@ resolve {
jacoco { jacoco {
toolVersion = jacocoVersion toolVersion = jacocoVersion
reportsDir = file("$buildDir/reports/jacoco") reportsDir = file("$buildDir/reports/jacoco")
} }
jacocoTestReport{ jacocoTestReport {
reports{ reports {
html.enabled=true html.enabled=true
xml.enabled=true xml.enabled=true
html.destination file("${buildDir}/code-coverage") html.destination file("${buildDir}/code-coverage")
} }
} }
// Configuration for the spotless plugin
// https://github.com/diffplug/spotless/tree/main/plugin-gradle
spotless { spotless {
format 'misc', { format 'misc', {
target '**/*.md', '**/*.properties', '**/.gitignore', '**/*.yml', '**/*.xml', '**/**.json', '**/*.sql' target '**/*.md', '**/*.properties', '**/.gitignore', '**/*.yml', '**/*.xml', '**/**.json', '**/*.sql'
@@ -272,7 +271,6 @@ spotless {
} }
) )
} }
} }
lineEndings 'UNIX' lineEndings 'UNIX'
@@ -306,7 +304,7 @@ rat {
'**/.gitignore', '**/.gitignore',
'**/.gitkeep', '**/.gitkeep',
'**/*.iml', '**/*.iml',
//Notice files // Notice files
'**/NOTICE_RELEASE', '**/NOTICE_RELEASE',
'**/NOTICE_SOURCE', '**/NOTICE_SOURCE',
// Swagger License // Swagger License
@@ -321,7 +319,7 @@ rat {
'**/native/**', '**/native/**',
'**/wrapper/**', '**/wrapper/**',
'**/build/**', '**/build/**',
//Api Docs // Api Docs
'**/api-docs/*.*', '**/api-docs/*.*',
'**/docs/system-architecture/.htaccess', '**/docs/system-architecture/.htaccess',
'**/docs/system-architecture/404.html', '**/docs/system-architecture/404.html',
@@ -329,10 +327,10 @@ rat {
'**/docs/system-architecture/**/*.xml', '**/docs/system-architecture/**/*.xml',
'**/bootstrap-3.0.0/assets/application.js', '**/bootstrap-3.0.0/assets/application.js',
'**/system-architecture/js/plugins.js', '**/system-architecture/js/plugins.js',
//Apache License // Apache License
'**/bootstrap-3.0.0/assets/less.js', '**/bootstrap-3.0.0/assets/less.js',
'**/css/bootstrap-3.0.0/**/*.*', '**/css/bootstrap-3.0.0/**/*.*',
//Public Domain See http://www.JSON.org/js.html // Public Domain See http://www.JSON.org/js.html
'**/bootstrap-3.0.0/assets/json2.js.htm', '**/bootstrap-3.0.0/assets/json2.js.htm',
// MIT License // MIT License
'**/modernizr-2.6.2.min.js', '**/modernizr-2.6.2.min.js',
@@ -348,9 +346,9 @@ rat {
'**/system-architecture/js/vendor/toc-0.1.2/jquery.toc.min.js', '**/system-architecture/js/vendor/toc-0.1.2/jquery.toc.min.js',
'**/assets/respond.min.js', '**/assets/respond.min.js',
'**/assets/html5shiv.js', '**/assets/html5shiv.js',
//BSD License // BSD License
'**/assets/uglify.js', '**/assets/uglify.js',
//Ignore out folder // Ignore out folder
'**/out/**', '**/out/**',
// Git build info // Git build info
"**/git.properties", "**/git.properties",
@@ -554,6 +552,8 @@ if (project.hasProperty('security') && project.getProperty('security') == 'oauth
} }
} }
// Configuration for the modernizer plugin
// https://github.com/andygoossens/gradle-modernizer-plugin
modernizer { modernizer {
includeTestClasses = true includeTestClasses = true
failOnViolations = true failOnViolations = true
@@ -581,11 +581,6 @@ compileJava{
dependsOn spotlessCheck dependsOn spotlessCheck
finalizedBy resolve finalizedBy resolve
} }
/*
pmd {
sourceSets = [sourceSets.main]
}
*/
war { war {
from('../licenses/binary/') { from('../licenses/binary/') {
@@ -610,6 +605,8 @@ war {
war.finalizedBy(bootWar) war.finalizedBy(bootWar)
} }
// Configuration for Gradle license plug-in
// https://github.com/hierynomus/license-gradle-plugin
license { license {
header rootProject.file('../APACHE_LICENSETEXT.md') header rootProject.file('../APACHE_LICENSETEXT.md')
excludes([ excludes([
@@ -633,6 +630,14 @@ task licenseFormatBuildScripts (type:nl.javadude.gradle.plugins.license.License)
} }
licenseFormat.dependsOn licenseFormatBuildScripts licenseFormat.dependsOn licenseFormatBuildScripts
// Configuration for the errorprone plugin
// https://github.com/tbroyer/gradle-errorprone-plugin
dependencies {
errorprone "com.google.errorprone:error_prone_core:2.4.0"
}
// Configuration for the Gradle Cargo plugin
// https://github.com/bmuschko/gradle-cargo-plugin
configurations configurations
{ {
tomcat tomcat
@@ -642,9 +647,6 @@ dependencies {
tomcat "org.apache.tomcat:tomcat:9.0.36@zip" tomcat "org.apache.tomcat:tomcat:9.0.36@zip"
} }
dependencies {
errorprone "com.google.errorprone:error_prone_core:2.4.0"
}
cargo { cargo {
containerId "tomcat9x" containerId "tomcat9x"
@@ -734,19 +736,25 @@ test {
} }
} }
// Configuration for the Checkstyle plugin
// https://docs.gradle.org/current/userguide/checkstyle_plugin.html
dependencies {
checkstyle 'com.puppycrawl.tools:checkstyle:8.34'
checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.37.1'
}
// Configuration for SQL tasks
// https://docs.groovy-lang.org/latest/html/api/groovy/sql/Sql.html
import groovy.sql.Sql import groovy.sql.Sql
repositories { project.ext.mysqlUser='root'
mavenCentral() project.ext.mysqlPassword='mysql'
}
configurations { configurations {
driver driver
} }
dependencies { dependencies {
driver 'org.drizzle.jdbc:drizzle-jdbc:1.4' driver 'org.drizzle.jdbc:drizzle-jdbc:1.4'
checkstyle 'com.puppycrawl.tools:checkstyle:8.34'
checkstyle 'com.github.sevntu-checkstyle:sevntu-checks:1.37.1'
} }
URLClassLoader loader = GroovyObject.class.classLoader URLClassLoader loader = GroovyObject.class.classLoader
@@ -790,6 +798,9 @@ bootJar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
} }
// Configuration for spotbugs plugin
// https://github.com/spotbugs/spotbugs-gradle-plugin
// To generate an HTML report instead of XML // To generate an HTML report instead of XML
spotbugs { spotbugs {
reportLevel = 'high' reportLevel = 'high'
@@ -821,6 +832,8 @@ spotbugsIntegrationTest {
} }
} }
// Configuration for git properties gradle plugin
// https://github.com/n0mer/gradle-git-properties
gitProperties { gitProperties {
gitPropertiesResourceDir = "$buildDir/classes/java/main/resources" gitPropertiesResourceDir = "$buildDir/classes/java/main/resources"
dateFormat = "yyyy-MM-dd'T'HH:mmZ" dateFormat = "yyyy-MM-dd'T'HH:mmZ"