From 899ce0085a1b49ecc9ca333a907b677372606410 Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Mon, 15 Feb 2021 01:03:21 +0300 Subject: [PATCH 01/10] Add .editorconfig for automatic editor configuration --- .editorconfig | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..37d06131 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +root = true + +[*] +trim_trailing_whitespace = true +insert_final_newline = true +charset = utf-8 +indent_style = space + +[{*.sh,gradlew}] +end_of_line = lf + +[{*.bat,*.cmd}] +end_of_line = crlf + +[{*.kts,*.kt}] +max_line_length = 100 +# Google Kotlin code style uses 2 spaces for indentation +# See https://github.com/GoogleCloudPlatform/app-gradle-plugin/pull/398/files#r984944216 +indent_size = 2 From 2e8cfb777d93830b382aeeb08e2936c7a3d194af Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Wed, 7 Sep 2022 17:24:50 +0300 Subject: [PATCH 02/10] style: build.gradle.kts, fix indentation in build.gradle.kts (Google Kotlin guide uses 2 spaces) --- build.gradle.kts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index fe3c3e8c..1b927cb4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -71,10 +71,10 @@ tasks.jar.configure { } } -tasks.withType().configureEach { - options.compilerArgs = options.compilerArgs + listOf( - "-Xlint:all" - ) +tasks.withType().configureEach { + options.compilerArgs = options.compilerArgs + listOf( + "-Xlint:all" + ) } /* TESTING */ @@ -202,7 +202,10 @@ tasks.withType().configureEach { checkstyle { toolVersion = "8.37" // Get the google_checks.xml file from the actual tool we're invoking. - config = resources.text.fromArchiveEntry(configurations.checkstyle.get().files.first(), "google_checks.xml") + config = resources.text.fromArchiveEntry( + configurations.checkstyle.files.first(), + "google_checks.xml" + ) maxErrors = 0 maxWarnings = 0 tasks.checkstyleTest.configure { From fc9c9bba6085c3db825cf99ab19951af6756444e Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sun, 2 Apr 2023 11:11:14 +0300 Subject: [PATCH 03/10] style: build.gradle.kts, move license header to the top of build.gradle.kts --- build.gradle.kts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 1b927cb4..1d34d4df 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,3 @@ -import net.researchgate.release.GitAdapter.GitConfig -import java.util.Date -import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL - /* * Copyright 2022 Google LLC. All Rights Reserved. * @@ -18,6 +14,9 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL * limitations under the License. * */ +import net.researchgate.release.GitAdapter.GitConfig +import java.util.Date +import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL plugins { id("java") From 79d34f2de2efaf663cff59ce6406d3315ea3b874 Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sun, 2 Apr 2023 11:11:50 +0300 Subject: [PATCH 04/10] style: build.gradle.kts, remove excessive "configure {" calls --- build.gradle.kts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 1d34d4df..4fe82d04 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -55,7 +55,7 @@ tasks.wrapper { gradleVersion = "6.9" } -tasks.jar.configure { +tasks.jar { manifest { attributes( mapOf( @@ -77,7 +77,7 @@ tasks.withType().configureEach { } /* TESTING */ -tasks.test.configure { +tasks.test { testLogging { showStandardStreams = true exceptionFormat = FULL @@ -188,7 +188,7 @@ googleJavaFormat { } -tasks.check.configure { +tasks.check { dependsOn(tasks.verifyGoogleJavaFormat) } tasks.withType().configureEach { @@ -207,7 +207,7 @@ checkstyle { ) maxErrors = 0 maxWarnings = 0 - tasks.checkstyleTest.configure { + tasks.checkstyleTest { enabled = false } } From 484d926bb53cc20952b745535cd825e445cc1d93 Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sun, 2 Apr 2023 11:13:42 +0300 Subject: [PATCH 05/10] style: build.gradle.kts, use editor-friendly separator comments --- build.gradle.kts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4fe82d04..e3c7ad53 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -76,7 +76,7 @@ tasks.withType().configureEach { ) } -/* TESTING */ +// tasks.test { testLogging { showStandardStreams = true @@ -101,10 +101,9 @@ tasks.register("integTest") { classpath = sourceSets.getByName("integTest").runtimeClasspath outputs.upToDateWhen { false } } -/* TESTING */ +// - -/* RELEASING */ +// tasks.register("sourceJar") { from(sourceSets.main.get().allJava) archiveClassifier.set("sources") @@ -180,9 +179,9 @@ release { requireBranch = """^release-v\d+.*$""" //regex } } -/* RELEASING */ +// -/* FORMATTING */ +// googleJavaFormat { toolVersion = "1.7" } @@ -211,9 +210,9 @@ checkstyle { enabled = false } } -/* FORMATTING */ +// -/* TEST COVERAGE */ +// jacoco { toolVersion = "0.8.8" } @@ -224,4 +223,4 @@ tasks.jacocoTestReport { html.isEnabled = false } } -/* TEST COVERAGE */ +// From d0de6c9c6eab50ad6dac4652b1928e75ca2023fb Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sun, 2 Apr 2023 11:14:21 +0300 Subject: [PATCH 06/10] use lazy API for configuring Checkstyle task: avoid reading google_checks.xml when task is not executed --- build.gradle.kts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index e3c7ad53..6f8319fe 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -201,14 +201,15 @@ checkstyle { toolVersion = "8.37" // Get the google_checks.xml file from the actual tool we're invoking. config = resources.text.fromArchiveEntry( - configurations.checkstyle.files.first(), + configurations.checkstyle.map { it.first() }, "google_checks.xml" ) maxErrors = 0 maxWarnings = 0 - tasks.checkstyleTest { - enabled = false - } +} + +tasks.checkstyleTest { + enabled = false } // From adf9ecb4ffce1e767fb27091b50554cc377ca65b Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sun, 2 Apr 2023 11:14:30 +0300 Subject: [PATCH 07/10] style: build.gradle.kts, use variable references for integTestSourceSet instead of string-based references --- build.gradle.kts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 6f8319fe..d919d97b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -84,21 +84,23 @@ tasks.test { } } -sourceSets { - create("integTest") { - compileClasspath += main.get().output - runtimeClasspath += main.get().output - } +val integTestSourceSet = sourceSets.create("integTest") { + compileClasspath += sourceSets.main.get().output + runtimeClasspath += sourceSets.main.get().output } configurations { - named("integTestCompile").get().extendsFrom(testCompileClasspath.get()) - named("integTestRuntime").get().extendsFrom(testRuntimeClasspath.get()) + "integTestImplementation" { + extendsFrom(testImplementation.get()) + } + "integTestRuntimeOnly" { + extendsFrom(testRuntimeOnly.get()) + } } -tasks.register("integTest") { - testClassesDirs = sourceSets.getByName("integTest").output.classesDirs - classpath = sourceSets.getByName("integTest").runtimeClasspath +val integTest by tasks.registering(Test::class) { + testClassesDirs = integTestSourceSet.output.classesDirs + classpath = integTestSourceSet.runtimeClasspath outputs.upToDateWhen { false } } // From f3d606f2f0e0ba70c54e106905248b68b5958d96 Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sun, 2 Apr 2023 11:14:37 +0300 Subject: [PATCH 08/10] Refactor Maven publication: maven -> maven-publish --- build.gradle.kts | 210 +++++++++++++----- gradle.properties | 4 + ...tools.appengine-appenginewebxml.properties | 16 -- ...e.cloud.tools.appengine-appyaml.properties | 16 -- ....cloud.tools.appengine-flexible.properties | 17 -- ....cloud.tools.appengine-standard.properties | 17 -- ...om.google.cloud.tools.appengine.properties | 17 -- ...ogle.cloud.tools.source-context.properties | 17 -- 8 files changed, 161 insertions(+), 153 deletions(-) delete mode 100644 src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-appenginewebxml.properties delete mode 100644 src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-appyaml.properties delete mode 100644 src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-flexible.properties delete mode 100644 src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-standard.properties delete mode 100644 src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine.properties delete mode 100644 src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.source-context.properties diff --git a/build.gradle.kts b/build.gradle.kts index d919d97b..d55bcf02 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -20,7 +20,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL plugins { id("java") - id("maven") + id("maven-publish") id("java-gradle-plugin") id("net.researchgate.release") version "2.6.0" id("com.github.sherter.google-java-format") version "0.9" @@ -35,6 +35,8 @@ repositories { java { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 + withSourcesJar() + withJavadocJar() } group = "com.google.cloud.tools" @@ -76,6 +78,60 @@ tasks.withType().configureEach { ) } +// +gradlePlugin { + plugins { + create("appengine") { + id = "$group.appengine" + implementationClass = "com.google.cloud.tools.gradle.appengine.AppEnginePlugin" + displayName = "App Engine Gradle Plugin" + description = + "This Gradle plugin provides tasks to build and deploy Google App Engine applications." + } + create("appengine-appenginewebxml") { + id = "$group.appengine-appenginewebxml" + implementationClass = + "com.google.cloud.tools.gradle.appengine.standard.AppEngineStandardPlugin" + displayName = "App Engine Gradle Plugin" + description = + "This Gradle plugin provides tasks to build and deploy Google App Engine applications." + } + create("appengine-appyaml") { + id = "$group.appengine-appyaml" + implementationClass = + "com.google.cloud.tools.gradle.appengine.appyaml.AppEngineAppYamlPlugin" + displayName = "App Engine Gradle Plugin" + description = + "This Gradle plugin provides tasks to build and deploy Google App Engine applications." + } + create("appengine-flexible") { + id = "$group.appengine-flexible" + implementationClass = + "com.google.cloud.tools.gradle.appengine.appyaml.AppEngineAppYamlPlugin" + displayName = "App Engine Gradle Plugin" + description = + "This Gradle plugin provides tasks to build and deploy Google App Engine applications." + } + create("appengine-standard") { + id = "$group.appengine-standard" + implementationClass = + "com.google.cloud.tools.gradle.appengine.standard.AppEngineStandardPlugin" + displayName = "App Engine Gradle Plugin" + description = + "This Gradle plugin provides tasks to build and deploy Google App Engine applications." + } + create("source-context") { + id = "$group.source-context" + implementationClass = + "com.google.cloud.tools.gradle.appengine.sourcecontext.SourceContextPlugin" + displayName = "App Engine Source Context Gradle Plugin" + description = + "This Gradle plugin injects source code context for cloud debugging." + } + } +} +// + // tasks.test { testLogging { @@ -106,56 +162,89 @@ val integTest by tasks.registering(Test::class) { // // -tasks.register("sourceJar") { - from(sourceSets.main.get().allJava) - archiveClassifier.set("sources") +val generatePom by tasks.registering { + description = + "Generates all the pom files to ${buildDir.name}/publications/ for manual inspection" + group = "release" + dependsOn(tasks.withType()) +} + +val tempRepoPath = "$buildDir/repo" + +val cleanTempRepo by tasks.registering(Delete::class) { + delete(tempRepoPath) } -tasks.register("javadocJar") { - dependsOn(tasks.javadoc) - from(tasks.javadoc.map { it.destinationDir!! }) - archiveClassifier.set("javadoc") +tasks.withType().configureEach { + dependsOn(cleanTempRepo) } -project.afterEvaluate { - tasks.register("writePom") { - val outputFile = file("$buildDir/pom/${project.name}-${project.version}.pom") - outputs.file(outputFile) +// ./gradlew publishToTmpMaven would publish the files to build/repo, so they can be signed and released +val publishToTmpMaven by tasks.registering { + description = "Publish Maven publications to $tempRepoPath" + group = PublishingPlugin.PUBLISH_TASK_GROUP + dependsOn("publishAllPublicationsToTmpMavenRepository") +} - doLast { - maven { +publishing { + repositories { + maven { + name = "tmpMaven" + url = uri(tempRepoPath) + } + } + publications { + // java-gradle-plugin adds publication late, so we need afterEvaluate here + afterEvaluate { + // Configure and for the java module of the plugin + named("pluginMaven") { pom { - project { - withGroovyBuilder { - "name"("App Engine Gradle Plugin") - "description"("This Gradle plugin provides tasks to build and deploy Google App Engine applications.") - - "url"("https://github.com/GoogleCloudPlatform/app-gradle-plugin") - "inceptionYear"("2016") - - "scm" { - "url"("https://github.com/GoogleCloudPlatform/app-gradle-plugin") - "connection"("scm:https://github.com/GoogleCloudPlatform/app-gradle-plugin.git") - "developerConnection"("scm:git://github.com/GoogleCloudPlatform/app-gradle-plugin.git") - } - - "licenses" { - "license" { - "name"("The Apache Software License, Version 2.0") - "url"("http://www.apache.org/licenses/LICENSE-2.0.txt") - "distribution"("repo") - } - } - "developers" { - "developer" { - "id"("loosebazooka") - "name"("Appu Goundan") - "email"("appu@google.com") - } - } - } + name.set("App Engine Gradle Plugin") + description.set("This Gradle plugin provides tasks to build and deploy Google App Engine applications.") + } + } + } + withType { + // Use the resolved versions in pom.xml + // Gradle might have different resolution rules, so we set the versions + // that were used in Gradle build/test. + versionMapping { + usage(Usage.JAVA_RUNTIME) { + fromResolutionResult() + } + usage(Usage.JAVA_API) { + fromResolutionOf("runtimeClasspath") + } + } + pom { + // + developers { + developer { + id.set("loosebazooka") + name.set("Appu Goundan") + email.set("appu@google.com") + } + } + url.set("https://github.com/GoogleCloudPlatform/app-gradle-plugin") + inceptionYear.set("2016") + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") + comments.set("A business-friendly OSS license") + distribution.set("repo") } - }.writeTo(outputFile) + } + issueManagement { + system.set("GitHub") + url.set("https://github.com/GoogleCloudPlatform/app-gradle-plugin/issues") + } + scm { + url.set("https://github.com/GoogleCloudPlatform/app-gradle-plugin") + connection.set("scm:https://github.com/GoogleCloudPlatform/app-gradle-plugin.git") + developerConnection.set("scm:git://github.com/GoogleCloudPlatform/app-gradle-plugin.git") + } + // } } } @@ -163,15 +252,30 @@ project.afterEvaluate { // for kokoro releases -tasks.register("prepareRelease") { - from(tasks.jar) - from(tasks.named("sourceJar")) - from(tasks.named("javadocJar")) - from(tasks.named("writePom")) - - into("${buildDir}/release-artifacts") - - dependsOn(tasks.build) +val prepareRelease by tasks.registering(Sync::class) { + description = "Copy release artifacts to ${buildDir.name}/release-artifacts/" + group = "release" + dependsOn(tasks.publish) + into("$buildDir/release-artifacts") + from(tempRepoPath) { + include("**/appengine-gradle-plugin/**/*.jar") + include("**/appengine-gradle-plugin/**/*.module") + include("**/appengine-gradle-plugin/**/*.pom") + // Flatten hierarchy + eachFile { + path = "plugin-artifacts/$name" + } + } + from(tempRepoPath) { + include("**/*.gradle.plugin/**/*.pom") + // Flatten hierarchy + eachFile { + path = "plugin-markers/$name" + } + } + // Flattening the hierarchy leaves empty directories, + // do not copy those + includeEmptyDirs = false } release { diff --git a/gradle.properties b/gradle.properties index 39759aff..30afad39 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,5 @@ version = 2.4.6-SNAPSHOT + +org.gradle.parallel=true + +kotlin.code.style=official diff --git a/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-appenginewebxml.properties b/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-appenginewebxml.properties deleted file mode 100644 index 4722509f..00000000 --- a/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-appenginewebxml.properties +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright 2019 Google LLC. All Rights Reserved. -# -# 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 -# -# http://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. -# -implementation-class=com.google.cloud.tools.gradle.appengine.standard.AppEngineStandardPlugin diff --git a/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-appyaml.properties b/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-appyaml.properties deleted file mode 100644 index f5395462..00000000 --- a/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-appyaml.properties +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright 2018 Google LLC. All Rights Reserved. -# -# 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 -# -# http://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. -# -implementation-class=com.google.cloud.tools.gradle.appengine.appyaml.AppEngineAppYamlPlugin diff --git a/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-flexible.properties b/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-flexible.properties deleted file mode 100644 index a581aac9..00000000 --- a/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-flexible.properties +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright 2017 Google LLC. All Rights Reserved. -# -# 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 -# -# http://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. -# -# -implementation-class=com.google.cloud.tools.gradle.appengine.appyaml.AppEngineAppYamlPlugin diff --git a/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-standard.properties b/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-standard.properties deleted file mode 100644 index 6c9ff0df..00000000 --- a/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine-standard.properties +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright 2017 Google LLC. All Rights Reserved. -# -# 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 -# -# http://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. -# -# -implementation-class=com.google.cloud.tools.gradle.appengine.standard.AppEngineStandardPlugin diff --git a/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine.properties b/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine.properties deleted file mode 100644 index bfa6e0e1..00000000 --- a/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.appengine.properties +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright 2016 Google LLC. All Rights Reserved. -# -# 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 -# -# http://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. -# -# -implementation-class=com.google.cloud.tools.gradle.appengine.AppEnginePlugin diff --git a/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.source-context.properties b/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.source-context.properties deleted file mode 100644 index f536a008..00000000 --- a/src/main/resources/META-INF/gradle-plugins/com.google.cloud.tools.source-context.properties +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright 2016 Google LLC. All Rights Reserved. -# -# 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 -# -# http://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. -# -# -implementation-class=com.google.cloud.tools.gradle.appengine.sourcecontext.SourceContextPlugin From 0ab2c7ea0c193afa914199b5279e752b7201ee30 Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sun, 2 Apr 2023 11:15:01 +0300 Subject: [PATCH 09/10] chore: simplify options.compilerArgs configuration --- build.gradle.kts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index d55bcf02..f02c0992 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -73,9 +73,7 @@ tasks.jar { } tasks.withType().configureEach { - options.compilerArgs = options.compilerArgs + listOf( - "-Xlint:all" - ) + options.compilerArgs.add("-Xlint:all") } // From 45cd6d2daf136266e8f610dce0106cc941ef9ab9 Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sun, 2 Apr 2023 11:15:10 +0300 Subject: [PATCH 10/10] chore: use compileOnly for gradleApi Gradle supplies the relevant API at the runtime, so there's no need for adding gradelApi as runtime dependency. --- build.gradle.kts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index f02c0992..f3855c9d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -42,8 +42,9 @@ java { group = "com.google.cloud.tools" dependencies { - implementation(localGroovy()) - implementation(gradleApi()) + // Gradle will definitely supply the proper API at the runtime, so we should not + // ask for anything else. + compileOnly(gradleApi()) api("com.google.cloud.tools:appengine-plugins-core:0.9.9") testImplementation("commons-io:commons-io:2.11.0")