gradle: Fix Gradle 6 warnings

Most of these are easy "replace X with Y."

The CreateStartScripts changes were because the scripts were being included in
the output zip/tar multiple times. The was because they were all using the same
output directory, and the entire output directory was being included for each.
The output directory tmp/ was particularly poor because other tasks were
dumping things into it, so our zip/tar was including those junk files as well.
This commit is contained in:
Eric Anderson 2020-07-31 06:55:52 -07:00 committed by Eric Anderson
parent 96a5c5df57
commit 026673cff5
6 changed files with 20 additions and 20 deletions

View File

@ -60,7 +60,7 @@ task qps_client(type: CreateStartScripts) {
defaultJvmOpts = [
"-javaagent:" + configurations.alpnagent.asPath
].plus(vmArgs)
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}
@ -70,14 +70,14 @@ task openloop_client(type: CreateStartScripts) {
defaultJvmOpts = [
"-javaagent:" + configurations.alpnagent.asPath
].plus(vmArgs)
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}
task qps_server(type: CreateStartScripts) {
mainClassName = "io.grpc.benchmarks.qps.AsyncServer"
applicationName = "qps_server"
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}
@ -87,7 +87,7 @@ task benchmark_worker(type: CreateStartScripts) {
defaultJvmOpts = [
"-javaagent:" + configurations.alpnagent.asPath
].plus(vmArgs)
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

View File

@ -10,7 +10,6 @@ import net.ltgt.gradle.errorprone.CheckSeverity
subprojects {
apply plugin: "checkstyle"
apply plugin: "maven"
apply plugin: "idea"
apply plugin: "signing"
apply plugin: "jacoco"
@ -286,7 +285,7 @@ subprojects {
jacoco { toolVersion = "0.8.2" }
checkstyle {
configDir = file("$rootDir/buildscripts")
configDirectory = file("$rootDir/buildscripts")
toolVersion = "6.17"
ignoreFailures = false
if (rootProject.hasProperty("checkstyle.ignoreFailures")) {
@ -315,7 +314,7 @@ subprojects {
targetCompatibility = 1.7
dependencies {
testCompile libraries.junit,
testImplementation libraries.junit,
libraries.mockito,
libraries.truth
}

View File

@ -20,7 +20,7 @@ buildscript {
url "https://maven-central.storage-download.googleapis.com/maven2/" }
}
dependencies {
classpath 'com.google.cloud.tools:appengine-gradle-plugin:1.3.5'
classpath 'com.google.cloud.tools:appengine-gradle-plugin:2.3.0'
classpath 'com.squareup.okhttp:okhttp:2.7.4'
}
}
@ -75,6 +75,7 @@ appengine {
deploy {
// deploy configuration
projectId = 'GCLOUD_CONFIG'
// default - stop the current version
stopPreviousVersion = System.getProperty('gaeStopPreviousVersion') ?: true
// default - do not make this the promoted version

View File

@ -63,7 +63,7 @@ task test_client(type: CreateStartScripts) {
defaultJvmOpts = [
"-javaagent:JAVAAGENT_APP_HOME" + configurations.alpnagent.singleFile.name
]
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
doLast {
unixScript.text = unixScript.text.replace('JAVAAGENT_APP_HOME', '\$APP_HOME/lib/')
@ -74,21 +74,21 @@ task test_client(type: CreateStartScripts) {
task test_server(type: CreateStartScripts) {
mainClassName = "io.grpc.testing.integration.TestServiceServer"
applicationName = "test-server"
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}
task reconnect_test_client(type: CreateStartScripts) {
mainClassName = "io.grpc.testing.integration.ReconnectTestClient"
applicationName = "reconnect-test-client"
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}
task stresstest_client(type: CreateStartScripts) {
mainClassName = "io.grpc.testing.integration.StressTestClient"
applicationName = "stresstest-client"
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
defaultJvmOpts = [
"-verbose:gc",
@ -99,14 +99,14 @@ task stresstest_client(type: CreateStartScripts) {
task http2_client(type: CreateStartScripts) {
mainClassName = "io.grpc.testing.integration.Http2Client"
applicationName = "http2-client"
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}
task grpclb_long_lived_affinity_test_client(type: CreateStartScripts) {
mainClassName = "io.grpc.testing.integration.GrpclbLongLivedAffinityTestClient"
applicationName = "grpclb-long-lived-affinity-test-client"
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
defaultJvmOpts = [
"-Dio.grpc.internal.DnsNameResolverProvider.enable_service_config=true"
@ -116,8 +116,8 @@ task grpclb_long_lived_affinity_test_client(type: CreateStartScripts) {
task grpclb_fallback_test_client (type: CreateStartScripts) {
mainClassName = "io.grpc.testing.integration.GrpclbFallbackTestClient"
applicationName = "grpclb-fallback-test-client"
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + configurations.runtime
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
defaultJvmOpts = [
"-Dio.grpc.internal.DnsNameResolverProvider.enable_service_config=true"
]
@ -126,14 +126,14 @@ task grpclb_fallback_test_client (type: CreateStartScripts) {
task xds_test_client(type: CreateStartScripts) {
mainClassName = "io.grpc.testing.integration.XdsTestClient"
applicationName = "xds-test-client"
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}
task xds_test_server(type: CreateStartScripts) {
mainClassName = "io.grpc.testing.integration.XdsTestServer"
applicationName = "xds-test-server"
outputDir = new File(project.buildDir, 'tmp')
outputDir = new File(project.buildDir, 'tmp/scripts/' + name)
classpath = startScripts.classpath
}

View File

@ -9,7 +9,7 @@ pluginManagement {
id "digital.wup.android-maven-publish" version "3.6.2"
id "me.champeau.gradle.japicmp" version "0.2.5"
id "me.champeau.gradle.jmh" version "0.5.0"
id "net.ltgt.errorprone" version "0.8.1"
id "net.ltgt.errorprone" version "1.2.1"
id "ru.vyarus.animalsniffer" version "1.5.0"
}
resolutionStrategy {

View File

@ -12,7 +12,7 @@ dependencies {
project(':grpc-stub')
compileOnly libraries.javax_annotation
testImplementation libraries.truth
testRuntime libraries.javax_annotation
testRuntimeOnly libraries.javax_annotation
}
configureProtoCompilation()