Upgrade to Gradle 6 enabling parallel build (#731)

* Upgrade to Gradle 6 enabling parallel build

* Remove ignoring gradle.properties

* Limit resources in gradle.properties
This commit is contained in:
Javier Salinas 2020-01-07 01:59:00 +01:00 committed by Bogdan Drutu
parent 47ed1b1808
commit a9448a71dc
9 changed files with 94 additions and 60 deletions

1
.gitignore vendored
View File

@ -1,6 +1,5 @@
# Gradle
build
gradle.properties
.gradle
local.properties
out/

View File

@ -64,10 +64,10 @@ jacocoTestReport {
html.enabled = true
}
additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories = files(subprojects.sourceSets.main.output)
classDirectories = files(classDirectories.files.collect {
additionalSourceDirs.from = files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.from = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.from = files(subprojects.sourceSets.main.output)
classDirectories.from = files(classDirectories.files.collect {
fileTree(dir: it)
})
}

View File

@ -1,11 +1,11 @@
buildscript {
repositories {
mavenCentral()
mavenLocal()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
jcenter()
mavenLocal()
}
dependencies {
classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.5.0'
@ -54,7 +54,7 @@ subprojects {
it.options.compilerArgs += ["-Xlint:all", "-Xlint:-try", "-Xlint:-processing"]
it.options.compilerArgs += ["-XepAllDisabledChecksAsWarnings", "-XepDisableWarningsInGeneratedCode"]
// Doesn't currently use Var annotations.
// Doesn't currently use Var annotations.
it.options.compilerArgs += ["-Xep:Var:OFF"]
// ImmutableRefactoring suggests using com.google.errorprone.annotations.Immutable,
@ -115,29 +115,29 @@ subprojects {
protocVersion = '3.9.0'
libraries = [
auto_value: "com.google.auto.value:auto-value:${autoValueVersion}",
auto_value : "com.google.auto.value:auto-value:${autoValueVersion}",
auto_value_annotation: "com.google.auto.value:auto-value-annotations:${autoValueVersion}",
disruptor: 'com.lmax:disruptor:3.4.2',
disruptor : 'com.lmax:disruptor:3.4.2',
errorprone_annotation: "com.google.errorprone:error_prone_annotations:${errorProneVersion}",
grpc_api: "io.grpc:grpc-api:${grpcVersion}",
grpc_context: "io.grpc:grpc-context:${grpcVersion}",
grpc_protobuf: "io.grpc:grpc-protobuf:${grpcVersion}",
grpc_stub: "io.grpc:grpc-stub:${grpcVersion}",
guava: "com.google.guava:guava:${guavaVersion}",
jsr305: "com.google.code.findbugs:jsr305:${findBugsJsr305Version}",
protobuf: "com.google.protobuf:protobuf-java:${protobufVersion}",
protobuf_util: "com.google.protobuf:protobuf-java-util:${protobufVersion}",
grpc_api : "io.grpc:grpc-api:${grpcVersion}",
grpc_context : "io.grpc:grpc-context:${grpcVersion}",
grpc_protobuf : "io.grpc:grpc-protobuf:${grpcVersion}",
grpc_stub : "io.grpc:grpc-stub:${grpcVersion}",
guava : "com.google.guava:guava:${guavaVersion}",
jsr305 : "com.google.code.findbugs:jsr305:${findBugsJsr305Version}",
protobuf : "com.google.protobuf:protobuf-java:${protobufVersion}",
protobuf_util : "com.google.protobuf:protobuf-java-util:${protobufVersion}",
// Compatibility layer
opentracing: "io.opentracing:opentracing-api:${opentracingVersion}",
opentracing : "io.opentracing:opentracing-api:${opentracingVersion}",
// Test dependencies.
guava_testlib: "com.google.guava:guava-testlib:${guavaVersion}",
junit: 'junit:junit:4.12',
mockito: 'org.mockito:mockito-core:2.25.1',
truth: 'com.google.truth:truth:1.0',
slf4jsimple: 'org.slf4j:slf4j-simple:1.7.25', // Compatibility layer
awaitility: 'org.awaitility:awaitility:3.0.0', // Compatibility layer
guava_testlib : "com.google.guava:guava-testlib:${guavaVersion}",
junit : 'junit:junit:4.12',
mockito : 'org.mockito:mockito-core:2.25.1',
truth : 'com.google.truth:truth:1.0',
slf4jsimple : 'org.slf4j:slf4j-simple:1.7.25', // Compatibility layer
awaitility : 'org.awaitility:awaitility:3.0.0', // Compatibility layer
]
}
@ -221,3 +221,8 @@ subprojects {
apply from: "${rootProject.projectDir}/gradle/publish.gradle"
}
wrapper {
distributionType = Wrapper.DistributionType.ALL
gradleVersion = '6.0.1'
}

3
gradle.properties Normal file
View File

@ -0,0 +1,3 @@
org.gradle.parallel=true
org.gradle.workers.max=4
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=512m

Binary file not shown.

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

51
gradlew vendored
View File

@ -1,5 +1,21 @@
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed 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.
#
##############################################################################
##
## Gradle start up script for UN*X
@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m"'
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
@ -109,8 +125,8 @@ if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
@ -138,19 +154,19 @@ if $cygwin ; then
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
i=`expr $i + 1`
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
@ -159,14 +175,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"

18
gradlew.bat vendored
View File

@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@ -14,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="-Xmx64m"
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

View File

@ -1,18 +1,18 @@
rootProject.name = "opentelemetry-java"
include ":opentelemetry-all"
include ":opentelemetry-api"
include ":opentelemetry-contrib-runtime-metrics"
include ":opentelemetry-contrib-trace-utils"
include ":opentelemetry-exporters-inmemory"
include ":opentelemetry-exporters-jaeger"
include ":opentelemetry-exporters-logging"
include ":opentelemetry-exporters-otprotocol"
include ":opentelemetry-opentracing-shim"
include ":opentelemetry-proto"
include ":opentelemetry-sdk"
include ":opentelemetry-sdk-contrib-async-processor"
include ":opentelemetry-sdk-contrib-testbed"
include ":opentelemetry-all",
":opentelemetry-api",
":opentelemetry-contrib-runtime-metrics",
":opentelemetry-contrib-trace-utils",
":opentelemetry-exporters-inmemory",
":opentelemetry-exporters-jaeger",
":opentelemetry-exporters-logging",
":opentelemetry-exporters-otprotocol",
":opentelemetry-opentracing-shim",
":opentelemetry-proto",
":opentelemetry-sdk",
":opentelemetry-sdk-contrib-async-processor",
":opentelemetry-sdk-contrib-testbed"
project(':opentelemetry-all').projectDir = "$rootDir/all" as File
project(':opentelemetry-api').projectDir = "$rootDir/api" as File