-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Update Gradle to 5.5 version #4567
Changes from all commits
e1e5965
5f3d842
5d83ee1
fecf2df
73bfd96
0649a7c
5adcdb0
f058465
e12d981
f9ae903
0b7944d
57bfa51
9b99b26
e4c30e7
bb7b5b8
70601a6
4abb5b3
832c3d3
0056977
972d6d7
f663b0e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ set APP_BASE_NAME=%~n0 | |
set APP_HOME=%DIRNAME% | ||
|
||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 | ||
set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this too low? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah but thats the current default in there generated files There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If a different heap size is appropriate, we can change it. It's fine for us to diverge from the upstream gradlew[.bat] as needed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For now build seems to work fine. If we see any issue then we can change. I believe Gradle wrapper internally forks a new jvm process so it needs bare minimum memory for its work |
||
|
||
@rem Find java.exe | ||
if defined JAVA_HOME goto findJavaFromJavaHome | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,13 +43,6 @@ gradle.ext.scalafmt = [ | |
config: new File(rootProject.projectDir, '.scalafmt.conf') | ||
] | ||
|
||
gradle.ext.scoverage = [ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now scoverage plugin internally adapts the classpath with required dependencies. So no need to explicitly add them |
||
deps: [ | ||
'org.scoverage:scalac-scoverage-plugin_2.12:1.3.1', | ||
'org.scoverage:scalac-scoverage-runtime_2.12:1.3.1' | ||
] | ||
] | ||
|
||
gradle.ext.akka = [version : '2.5.22'] | ||
gradle.ext.akka_http = [version : '10.1.8'] | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,14 @@ def leanExcludes = [ | |
'invokerShoot/**' | ||
] | ||
|
||
def projectsWithCoverage = [ | ||
':common:scala', | ||
':core:controller', | ||
':core:invoker', | ||
':tools:admin', | ||
':core:cosmosdb:cache-invalidator' | ||
] | ||
|
||
def systemIncludes = [ | ||
"org/apache/openwhisk/core/limits/**", | ||
"org/apache/openwhisk/core/admin/**", | ||
|
@@ -186,6 +194,7 @@ dependencies { | |
compile "org.apache.curator:curator-test:${gradle.curator.version}" | ||
compile 'com.atlassian.oai:swagger-request-validator-core:1.4.5' | ||
compile 'com.typesafe.akka:akka-stream-kafka-testkit_2.12:1.0' | ||
compile "com.typesafe.akka:akka-stream-testkit_2.12:${gradle.akka.version}" | ||
|
||
compile "com.amazonaws:aws-java-sdk-s3:1.11.295" | ||
|
||
|
@@ -195,10 +204,6 @@ dependencies { | |
compile project(':core:cosmosdb:cache-invalidator') | ||
compile project(':tools:admin') | ||
|
||
|
||
|
||
scoverage gradle.scoverage.deps | ||
|
||
swaggerCodegen 'io.swagger:swagger-codegen-cli:2.3.1' | ||
} | ||
|
||
|
@@ -233,13 +238,13 @@ gradle.projectsEvaluated { | |
doFirst { | ||
logTestSetInfo() | ||
} | ||
classpath = getScoverageClasspath(project) | ||
classpath = getScoverageClasspath(project, projectsWithCoverage) | ||
exclude getPattern(testSetName, "excludes") | ||
include getPattern(testSetName, "includes") | ||
} | ||
|
||
task testCoverage(type: Test) { | ||
classpath = getScoverageClasspath(project) | ||
classpath = getScoverageClasspath(project, projectsWithCoverage) | ||
} | ||
tasks.withType(Test) { | ||
systemProperties(System.getProperties()) | ||
|
@@ -250,8 +255,33 @@ gradle.projectsEvaluated { | |
showStandardStreams = true | ||
exceptionFormat = 'full' | ||
} | ||
maxHeapSize = "1024m" //Gradle 5.5 defaults to 512MB which is low | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With Gradle 5.0 it now defaults to 512M of heap. Due to this OOM was seen in test runs on Travis (which has 7 GB memory). Hence specifying the size explicitly to 1024 MB now
|
||
outputs.upToDateWhen { false } // force tests to run every time | ||
} | ||
/** | ||
* Task to generate coverage xml report. Requires the | ||
* tests to be executed prior to its invocation | ||
*/ | ||
task reportCoverage(type: ScoverageReport) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new version now creates task like However in our case as we have a separate test module and further to capture coverage of code running within container (as part of integration test) we copy the coverage metrics files manually we cannot use default tasks. Hence the report task duplicate bit of logic from actual task and clones the config from generated |
||
def dependentTasks = [] | ||
dependentTasks << copyMeasurementFiles | ||
projectsWithCoverage.forEach { | ||
dependentTasks << it + ':reportScoverage' | ||
} | ||
dependsOn(dependentTasks) | ||
//Need to recreate the logic from | ||
//https://github.com/scoverage/gradle-scoverage/blob/924bf49a8f981f119d0604b44a782f3f8eecb359/src/main/groovy/org/scoverage/ScoveragePlugin.groovy#L137 | ||
//default tasks retrigger the tests. As ours is a multi module integration | ||
//test we have to adapt the classpath and hence cannot use default reportXXXScoverage tasks | ||
runner = new org.scoverage.ScoverageRunner(project.configurations.scoverage) | ||
reportDir = reportTestScoverage.reportDir | ||
sources = reportTestScoverage.sources | ||
dataDir = reportTestScoverage.dataDir | ||
coverageOutputCobertura = reportTestScoverage.coverageOutputCobertura | ||
coverageOutputXML = reportTestScoverage.coverageOutputXML | ||
coverageOutputHTML = reportTestScoverage.coverageOutputHTML | ||
coverageDebug = reportTestScoverage.coverageDebug | ||
} | ||
} | ||
|
||
task copyMeasurementFiles() { | ||
|
@@ -273,21 +303,6 @@ task copyMeasurementFiles() { | |
} | ||
} | ||
|
||
/** | ||
* Task to generate coverage xml report. Requires the | ||
* tests to be executed prior to its invocation | ||
*/ | ||
task reportCoverage(type: ScoverageReport) { | ||
dependsOn([ | ||
copyMeasurementFiles, | ||
':common:scala:reportScoverage', | ||
':core:controller:reportScoverage', | ||
':core:invoker:reportScoverage', | ||
':tools:admin:reportScoverage', | ||
':core:cosmosdb:cache-invalidator:reportScoverage', | ||
]) | ||
|
||
} | ||
|
||
/** | ||
* Scoverage measurement files are named like scoverage.measurements.xxx. Where xxx is thread id. While | ||
|
@@ -315,37 +330,11 @@ def loadWhiskProps(){ | |
p | ||
} | ||
|
||
/** | ||
* Aggregates the scoverage xml reports from various modules into a | ||
* single report | ||
*/ | ||
task aggregateCoverage(type: JavaExec, dependsOn: reportCoverage) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This task was never used as we rely on codecov to perform actual aggregation |
||
//Taken from ScoverageAggregate | ||
main = 'org.scoverage.AggregateReportApp' | ||
classpath = project.extensions.scoverage.pluginClasspath | ||
args = [ | ||
project.rootProject.projectDir, //Use the root project path so as to "see" all source paths | ||
new File(project.buildDir, 'scoverage-aggregate'), | ||
false, //Clean scoverage report post process | ||
true, //coverageOutputCobertura | ||
true, //coverageOutputXML | ||
true, //coverageOutputHTML | ||
false //coverageDebug | ||
] | ||
} | ||
|
||
/** | ||
* Prepares the classpath which refer to scoverage instrumented classes from | ||
* dependent projects "before" the non instrumented classes | ||
*/ | ||
def getScoverageClasspath(Project project) { | ||
def projectNames = [ | ||
':common:scala', | ||
':core:controller', | ||
':core:invoker', | ||
':tools:admin', | ||
':core:cosmosdb:cache-invalidator' | ||
] | ||
def getScoverageClasspath(Project project, List<String> projectNames) { | ||
def combinedClasspath = projectNames.inject(project.files([])) { result, name -> | ||
def cp = project.project(name).sourceSets.scoverage.runtimeClasspath | ||
result + cp.filter {it.name.contains('scoverage')} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switching to 5.5.1 and also to
all
mode so as to enable code assists in IDE