Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Gradle 5 #2004

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 4 additions & 34 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ buildscript {
classpath 'gradle.plugin.org.unbroken-dome.gradle-plugins:gradle-testsets-plugin:1.4.2'
classpath 'com.netflix.nebula:nebula-dependency-recommender:4.3.0'
classpath 'gradle.plugin.org.openrepose:gradle-jaxb-plugin:2.5.0'
classpath 'gradle.plugin.org.scoverage:gradle-scoverage:2.1.0'
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.2'
classpath 'com.github.jengelman.gradle.plugins:shadow:4.0.3'
classpath 'org.github.ngbinh.scalastyle:gradle-scalastyle-plugin_2.11:1.0.1'
classpath 'gradle.plugin.nl.javadude.gradle.plugins:license-gradle-plugin:0.13.1'
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.4'
Expand Down Expand Up @@ -127,17 +126,12 @@ subprojects {
apply plugin: 'jacoco'
apply plugin: 'nebula.maven-publish'
apply plugin: 'signing'
apply plugin: 'org.scoverage'

dependencies {
jaxb "com.sun.xml.bind:jaxb-xjc"
jaxb "com.sun.xml.bind:jaxb-impl"
jaxb "javax.xml.bind:jaxb-api"
jaxb "org.jvnet.jaxb2_commons:jaxb2-basics-ant"

scoverage "org.scoverage:scalac-scoverage-plugin_$scalaMajDotMin:1.1.0"
scoverage "org.scoverage:scalac-scoverage-runtime_$scalaMajDotMin:1.1.0"

}

testSets {
Expand Down Expand Up @@ -245,29 +239,11 @@ subprojects {
compileClasspath += files([sourceSets.generated.java.outputDir])
runtimeClasspath += files([sourceSets.generated.java.outputDir])
}
scoverage {
compileClasspath += configurations.compileOnly
runtimeClasspath += configurations.compileOnly
compileClasspath += files([sourceSets.generated.java.outputDir, sourceSets.main.java.outputDir])
runtimeClasspath += files([sourceSets.generated.java.outputDir, sourceSets.main.java.outputDir, sourceSets.test.groovy.outputDir])
}
testScoverage {
compileClasspath += configurations.compileOnly
runtimeClasspath += configurations.compileOnly
compileClasspath += files([sourceSets.generated.java.outputDir, sourceSets.main.java.outputDir])
runtimeClasspath += files([sourceSets.generated.java.outputDir,
sourceSets.main.java.outputDir,
sourceSets.main.groovy.outputDir,
sourceSets.test.groovy.outputDir,
file("${project.buildDir}/resources/scoverage/")
])
}
}

compileJava.dependsOn compileGeneratedJava
compileScala.dependsOn compileGeneratedJava
compileIntegrationTestGroovy.dependsOn compileGeneratedJava
testScoverage.dependsOn compileTestGroovy

[JavaCompile, ScalaCompile, GroovyCompile].collect { type ->
tasks.withType(type) {
Expand All @@ -283,12 +259,12 @@ subprojects {

checkstyle {
configFile = file("$rootDir/repose-aggregator/src/config/styles/checkstyle.xml")
sourceSets = sourceSets.matching {it.name != 'generated' && it.name != 'scoverage' && it.name != 'testScoverage'}
sourceSets = sourceSets.matching {it.name != 'generated'}
}

codenarc {
configFile = file("$rootDir/repose-aggregator/src/config/styles/codenarc.xml")
sourceSets = sourceSets.matching {it.name != 'generated' && it.name != 'scoverage' && it.name != 'testScoverage'}
sourceSets = sourceSets.matching {it.name != 'generated'}
toolVersion = "1.0"
}

Expand All @@ -311,7 +287,7 @@ subprojects {
}
exclude "**/*.cfg.xml"
exclude "**/log4j2*.xml"
sourceSets = sourceSets.matching {it.name != 'generated' && it.name != 'scoverage' && it.name != 'testScoverage'}
sourceSets = sourceSets.matching {it.name != 'generated'}
}

//todo: for some reason jacoco freaks when we do clean and build together
Expand Down Expand Up @@ -420,7 +396,6 @@ subprojects {

sonarqube {
properties {
property "sonar.scoverage.reportPath", "$buildDir/reports/scoverage/scoverage.xml"
property "sonar.jacoco.reportPath", "$buildDir/jacoco/jacocoTest.exec"
property "sonar.jacoco.itReportPath", "$buildDir/jacoco/jacocoIntegrationTest.exec"
}
Expand All @@ -447,11 +422,6 @@ subprojects {
}
}

// Configure the Scoverage test coverage verification
checkScoverage {
minimumRate = minCoverageRatio
}

// Wire in test coverage verification tasks
//
// Note: To take advantage of Scoverage aggregation, the check dependency on
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 0 additions & 4 deletions repose-aggregator/artifacts/valve/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ processResources {
expand(reposeVersion: version, jettyVersion: versionProperties.get('jettyVersion'))
}

processScoverageResources {
expand(reposeVersion: version, jettyVersion: versionProperties.get('jettyVersion'))
}

jar {
manifest {
attributes 'Main-Class': 'org.openrepose.valve.Main'
Expand Down
13 changes: 0 additions & 13 deletions repose-aggregator/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +0,0 @@
import org.scoverage.ScoverageAggregate

task aggregateScoverage(type: ScoverageAggregate)

checkScoverage {
reportDir = file("$buildDir/scoverage-aggregate")
}

if (project.hasProperty("minCoverageRatio")) {
aggregateScoverage.dependsOn reportScoverage, subprojects.reportScoverage
checkScoverage.dependsOn aggregateScoverage
check.dependsOn checkScoverage
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
dependencies {
annotationProcessor 'org.projectlombok:lombok'

compile "org.apache.httpcomponents:httpclient"
compile "org.slf4j:jcl-over-slf4j"

Expand Down
2 changes: 2 additions & 0 deletions repose-aggregator/core/repose-core-api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import org.apache.tools.ant.filters.ReplaceTokens

dependencies {
annotationProcessor 'org.projectlombok:lombok'

compile project(":repose-aggregator:commons:commons-utilities")
compile "io.dropwizard.metrics:metrics-core"
compile "org.scala-lang:scala-library"
Expand Down
11 changes: 1 addition & 10 deletions repose-aggregator/core/repose-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ dependencies {

sourceSets.main.scala.srcDir "src/main/java"
sourceSets.main.java.srcDirs = []
sourceSets.test.compileClasspath.add(project.files([sourceSets.test.scala.outputDir]))
sourceSets.test.compileClasspath = project.files([sourceSets.test.scala.outputDir]).from(sourceSets.test.compileClasspath)

compileTestGroovy.dependsOn compileTestScala

Expand All @@ -99,24 +99,15 @@ task copyEars() {
}

test.dependsOn copyEars
testScoverage.dependsOn copyEars

processResources {
expand(reposeVersion: version, reposeVersionName: reposeCodename)
}

processScoverageResources {
expand(reposeVersion: version, reposeVersionName: reposeCodename)
}

processTestResources {
expand(earDirectory: copyEars.outputDir, earVersion: version)
}

processTestScoverageResources {
expand(earDirectory: copyEars.outputDir, earVersion: version)
}

license {
excludes(["**/log4j2.component.properties", "**/test.properties", "**/log4j2-List2.json", "**/log4j2-List1.yaml",
"**/log4j2-List1.json", "**/log4j2-List2.yaml"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ processResources {
)
}

processScoverageResources {
expand(
version: version,
)
}

license {
excludes(['**/credentials.xsd', '**/atom.xsd', '**/xml.xsd'])
}
Expand Down
2 changes: 1 addition & 1 deletion versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ org.luaj:luaj-jse=3.0.1
mockitoVersion=1.9.5
org.mockito:mockito-core=$mockitoVersion
org.openrepose:http-delegation=4.0.0
org.projectlombok:lombok=1.18.2
org.projectlombok:lombok=1.18.4
org.python:jython-standalone=2.7.0
org.rackspace:deproxy=0.21
org.scala-lang:scala-library=2.11.12
Expand Down