Upgrading to Gradle 7.2

This commit is contained in:
Petri Tuomola
2021-09-13 07:24:39 +02:00
committed by Aleksandar Vidakovic
parent ad17b5bcb1
commit b74501b43b
7 changed files with 58 additions and 23 deletions
+1 -1
View File
@@ -74,6 +74,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
- travis_wait 60 ./gradlew -q --no-daemon --console=plain licenseMain licenseTest check build test --fail-fast doc && 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 30 --retry-delay 30 https://localhost:8443/fineract-provider/actuator/info | wc --chars) > 100 ))
- ./gradlew -q --no-daemon --console=plain licenseMain licenseTest check build test --fail-fast doc && 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 30 --retry-delay 30 https://localhost:8443/fineract-provider/actuator/info | wc --chars) > 100 ))
# 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)
+27 -9
View File
@@ -38,7 +38,6 @@ buildscript {
}
}
repositories {
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}
@@ -53,9 +52,11 @@ buildscript {
plugins {
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id "org.barfuin.gradle.taskinfo" version "1.3.0"
id 'com.adarshr.test-logger' version '3.0.0'
id 'com.diffplug.spotless' version '5.15.0' apply false
id 'org.nosphere.apache.rat' version '0.7.0' apply false
id 'com.github.hierynomus.license' version '0.15.0' apply false
id 'com.github.hierynomus.license' version '0.16.1' apply false
id 'org.openapi.generator' version '4.3.1' apply false
id 'org.zeroturnaround.gradle.jrebel' version '1.1.11' apply false
id 'org.springframework.boot' version '2.3.5.RELEASE' apply false
@@ -86,6 +87,7 @@ allprojects {
}
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'
@@ -469,6 +471,10 @@ configure(project.fineractJavaProjects) {
compileJava.dependsOn spotlessCheck
// compileJava may create more source files into generated, hence we need to run these tasks after it
licenseMain.dependsOn compileJava
processResources.dependsOn compileJava
// 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') {
@@ -605,12 +611,10 @@ configure(project.fineractJavaProjects) {
test {
useJUnitPlatform()
testLogging {
// FINERACT-927
events "skipped", "failed"
showStandardStreams = false
exceptionFormat "full"
}
}
testlogger {
logLevel 'quiet'
}
// Configuration for spotbugs plugin
@@ -650,7 +654,6 @@ configure(project.fineractJavaProjects) {
}
configure(project.fineractPublishProjects) {
apply plugin: 'maven'
apply plugin: 'maven-publish'
publishing {
@@ -689,3 +692,18 @@ configure(project.fineractPublishProjects) {
// TODO FINERACT-1102: Actually use this to deploy to ASF (Apache Software Foundation) Nexus Maven Repository
}
}
task printSourceSetInformation() {
doLast{
sourceSets.each { srcSet ->
println "["+srcSet.name+"]"
print "-->Source directories: "+srcSet.allJava.srcDirs+"\n"
print "-->Output directories: "+srcSet.output.classesDirs.files+"\n"
print "-->Compile classpath:\n"
srcSet.compileClasspath.files.each {
print " "+it.path+"\n"
}
println ""
}
}
}
+5 -2
View File
@@ -112,10 +112,13 @@ tasks.withType(JavaCompile) {
}
configurations {
generatedCompile.extendsFrom implementation
generatedRuntime.extendsFrom runtime
generatedCompileClasspath.extendsFrom implementation
generatedRuntimeClasspath.extendsFrom runtimeClasspath
}
test {
useJUnitPlatform()
}
// Gradle 7.x asks for explicit dependencies between tasks
licenseFormatBuildScripts.dependsOn spotlessGroovyGradle, spotlessJava, spotlessMisc, compileJava, processResources, compileGeneratedJava, compileTestJava, rat, test
+14 -2
View File
@@ -253,6 +253,7 @@ bootJar {
manifest {
attributes 'Main-Class': 'org.springframework.boot.loader.PropertiesLauncher'
}
dependsOn resolve
}
bootWar {
@@ -266,7 +267,8 @@ tasks.withType(Tar) {
distributions {
binary {
baseName "apache-fineract-$releaseVersion-binary"
// TODO: Add the version number before enabling this
distributionBaseName = "apache-fineract-binary"
contents {
from bootJar
from war
@@ -284,7 +286,8 @@ distributions {
}
}
src {
baseName "apache-fineract-$releaseVersion-src"
// TODO: Add the version number before enabling this
distributionBaseName = "apache-fineract-src"
contents {
from "$rootDir/"
exclude '**/build' , '.git', '.gradle', '.github', '.settings', '.project', '.classpath', '.idea', 'out', '._.DS_Store', '.DS_Store', 'WebContent', '.externalToolbuilders', '.theia', '.gitpod.yml', '.travis.yml', 'LICENSE_RELEASE', 'NOTICE_RELEASE', '**/licenses/binary'
@@ -342,3 +345,12 @@ gitProperties {
// make sure the generateGitProperties task always executes (even when git.properties is not changed)
generateGitProperties.outputs.upToDateWhen { false }
// Gradle 7.x asks for explicit dependencies between tasks
processResources.dependsOn generateGitProperties
checkstyleMain.dependsOn resolve
checkstyleTest.dependsOn resolve
licenseMain.dependsOn processResources, generateGitProperties
war.dependsOn resolve
spotbugsTest.dependsOn resolve
test.dependsOn resolve
+10 -4
View File
@@ -38,7 +38,6 @@ dependencies {
'com.sun.jersey:jersey-servlet',
'com.sun.jersey:jersey-server',
'com.sun.jersey:jersey-json',
'com.sun.jersey.contribs:jersey-spring',
'com.sun.jersey.contribs:jersey-multipart',
@@ -53,7 +52,6 @@ dependencies {
'com.squareup.okhttp3:okhttp',
'com.squareup.okhttp3:okhttp-urlconnection',
'org.apache.commons:commons-email',
'org.apache.commons:commons-lang3',
'commons-io:commons-io',
'org.apache.poi:poi',
@@ -68,8 +66,6 @@ dependencies {
'com.github.spullara.mustache.java:compiler',
'com.jayway.jsonpath:json-path',
'org.dom4j:dom4j',
'javax.cache:cache-api',
'com.github.spotbugs:spotbugs-annotations',
@@ -80,9 +76,18 @@ dependencies {
'com.squareup.retrofit2:converter-gson',
'com.sun.activation:jakarta.activation:1.2.2'
)
implementation('org.apache.commons:commons-email') {
exclude group: 'javax.activation'
}
implementation('org.dom4j:dom4j') {
exclude group: 'javax.xml.bind'
}
implementation ('jakarta.xml.bind:jakarta.xml.bind-api') {
exclude group: 'jakarta.activation'
}
implementation ('com.sun.jersey:jersey-json') {
exclude group: 'com.sun.xml.bind'
}
implementation ('org.apache.activemq:activemq-broker') {
exclude group: 'org.apache.geronimo.specs'
}
@@ -101,6 +106,7 @@ dependencies {
}
implementation ('org.mnode.ical4j:ical4j') {
exclude group: 'commons-logging'
exclude group: 'javax.activation'
}
runtimeOnly('org.ehcache:ehcache') {
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-4
View File
@@ -63,8 +63,4 @@ cargoStartLocal.mustRunAfter 'testClasses'
test {
dependsOn cargoStartLocal
finalizedBy cargoStopLocal
beforeTest { descriptor ->
logger.lifecycle("Now running $descriptor.className#$descriptor.displayName...")
}
}