From d1aaed0232a3a130dd55b5efd9e9f4881a1d75be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Quenaudon?= Date: Wed, 11 Sep 2024 14:00:55 +0100 Subject: [PATCH] CompileOnly for the KGP in wire-gradle-plugin --- wire-gradle-plugin/build.gradle.kts | 10 +++- .../squareup/wire/gradle/WirePluginTest.kt | 60 +++++++++++++------ .../cache-include-paths-1/build.gradle | 4 +- .../cache-include-paths-1/settings.gradle | 5 -- .../cache-include-paths-1/settings.gradle.kts | 24 ++++++++ .../cache-include-paths-2/build.gradle | 4 +- .../cache-include-paths-2/settings.gradle | 5 -- .../cache-include-paths-2/settings.gradle.kts | 24 ++++++++ .../projects/cache-relocation-1/build.gradle | 4 +- .../cache-relocation-1/settings.gradle | 5 -- .../cache-relocation-1/settings.gradle.kts | 24 ++++++++ .../projects/cache-relocation-2/build.gradle | 4 +- .../cache-relocation-2/settings.gradle | 5 -- .../cache-relocation-2/settings.gradle.kts | 24 ++++++++ .../build.gradle.kts | 4 +- .../gradle.properties | 1 - .../projects/consecutive-runs/build.gradle | 6 +- .../custom-output-no-such-class/build.gradle | 3 +- .../test/projects/custom-output/build.gradle | 3 +- .../customize-configuration/build.gradle | 3 +- .../test/projects/customize-task/build.gradle | 3 +- .../projects/different-java-out/build.gradle | 5 +- .../different-kotlin-out/build.gradle | 6 +- .../projects/different-proto-out/build.gradle | 4 +- .../build.gradle | 4 +- .../src/test/projects/dry-run/build.gradle | 3 +- .../projects/emit-java-options/build.gradle | 4 +- .../emit-java-then-emit-kotlin/build.gradle | 6 +- .../emit-kotlin-and-emit-java/build.gradle | 6 +- .../emit-kotlin-and-emit-java/settings.gradle | 0 .../projects/emit-kotlin-options/build.gradle | 4 +- .../emit-kotlin-then-emit-java/build.gradle | 6 +- .../emit-options-with-includes/build.gradle | 4 +- .../build.gradle | 4 +- .../emit-proto-with-prune/build.gradle | 4 +- .../emit-proto-with-root/build.gradle | 4 +- .../src/test/projects/emit-proto/build.gradle | 4 +- .../emit-service-name-suffix/build.gradle | 4 +- .../projects/emit-service-none/build.gradle | 4 +- .../emit-service-two-ways/build.gradle | 4 +- .../test/projects/emit-service/build.gradle | 6 +- .../test/projects/field-prune/build.gradle | 6 +- .../test/projects/field-prunes/build.gradle | 6 +- .../src/test/projects/field-root/build.gradle | 6 +- .../test/projects/field-roots/build.gradle | 4 +- .../projects/field-rule-prune/build.gradle | 6 +- .../projects/field-rule-root/build.gradle | 6 +- .../java-project-java-protos/build.gradle | 7 ++- .../java-project-kotlin-protos/build.gradle | 6 +- .../projects/kotlin-enum-mode/build.gradle | 4 +- .../kotlin-multiplatform/build.gradle | 4 +- .../kotlin-multiplatform/gradle.properties | 1 - .../kotlin-multiplatform/settings.gradle | 0 .../kotlin-project-java-protos/build.gradle | 8 +-- .../kotlin-project-kotlin-protos/build.gradle | 6 +- .../kotlinsourcesjar/build.gradle.kts | 4 +- .../listener-no-such-class/build.gradle | 4 +- .../src/test/projects/listener/build.gradle | 4 +- .../missing-kotlin-plugin/build.gradle | 5 +- .../test/projects/missing-plugin/build.gradle | 4 +- .../test/projects/move-message/build.gradle | 4 +- .../test/projects/only-version/build.gradle | 4 +- .../test/projects/opaque-message/build.gradle | 4 +- .../package-cycles-permitted/build.gradle | 6 +- .../test/projects/package-cycles/build.gradle | 6 +- .../dinosaurs/build.gradle | 3 +- .../geology/build.gradle | 3 +- .../location/build.gradle | 3 +- .../settings.gradle | 5 -- .../settings.gradle.kts | 24 ++++++++ .../dinosaurs/build.gradle | 3 +- .../project-dependencies/geology/build.gradle | 3 +- .../location/build.gradle | 3 +- .../project-dependencies/settings.gradle | 3 - .../project-dependencies/settings.gradle.kts | 22 +++++++ .../test/projects/proto-library/build.gradle | 3 +- .../projects/protopath-maven/build.gradle | 3 +- .../test/projects/reject-unused/build.gradle | 4 +- .../test/projects/require-target/build.gradle | 5 +- .../test/projects/since-until/build.gradle | 4 +- .../sourceaar-local-protopath/build.gradle | 3 +- .../projects/sourcedir-exclude/build.gradle | 6 +- .../projects/sourcedir-include/build.gradle | 6 +- .../sourcejar-local-many-files/build.gradle | 3 +- .../build.gradle | 3 +- .../sourcejar-local-single-file/build.gradle | 3 +- .../sourcejar-mixed-conflicts/build.gradle | 3 +- .../sourcejar-remote-many-files/build.gradle | 3 +- .../sourcejar-remote-protopath/build.gradle | 3 +- .../build.gradle | 3 +- .../settings.gradle | 7 --- .../settings.gradle.kts | 19 ++++++ .../sourcejar-remote-wildcards/build.gradle | 3 +- .../build.gradle | 3 +- .../sourcepath-build-dir/build.gradle | 5 +- .../projects/sourcepath-default/build.gradle | 5 +- .../test/projects/sourcepath-dir/build.gradle | 5 +- .../projects/sourcepath-file/build.gradle | 5 +- .../sourcepath-maven-single-file/build.gradle | 3 +- .../projects/sourcepath-maven/build.gradle | 3 +- .../sourcepath-no-sources/build.gradle | 5 +- .../sourcepath-nonexistent-dir/build.gradle | 5 +- .../build.gradle | 3 +- .../build.gradle | 5 +- .../test/projects/sourcepath-uri/build.gradle | 5 +- .../sourcetree-many-srcdirs/build.gradle | 5 +- .../build.gradle | 5 +- .../build.gradle | 5 +- .../sourcezip-local-protopath/build.gradle | 3 +- .../projects/task-dependency/build.gradle.kts | 4 +- 110 files changed, 426 insertions(+), 230 deletions(-) delete mode 100644 wire-gradle-plugin/src/test/projects/cache-include-paths-1/settings.gradle create mode 100644 wire-gradle-plugin/src/test/projects/cache-include-paths-1/settings.gradle.kts delete mode 100644 wire-gradle-plugin/src/test/projects/cache-include-paths-2/settings.gradle create mode 100644 wire-gradle-plugin/src/test/projects/cache-include-paths-2/settings.gradle.kts delete mode 100644 wire-gradle-plugin/src/test/projects/cache-relocation-1/settings.gradle create mode 100644 wire-gradle-plugin/src/test/projects/cache-relocation-1/settings.gradle.kts delete mode 100644 wire-gradle-plugin/src/test/projects/cache-relocation-2/settings.gradle create mode 100644 wire-gradle-plugin/src/test/projects/cache-relocation-2/settings.gradle.kts delete mode 100644 wire-gradle-plugin/src/test/projects/emit-kotlin-and-emit-java/settings.gradle delete mode 100644 wire-gradle-plugin/src/test/projects/kotlin-multiplatform/gradle.properties delete mode 100644 wire-gradle-plugin/src/test/projects/kotlin-multiplatform/settings.gradle delete mode 100644 wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/settings.gradle create mode 100644 wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/settings.gradle.kts delete mode 100644 wire-gradle-plugin/src/test/projects/project-dependencies/settings.gradle create mode 100644 wire-gradle-plugin/src/test/projects/project-dependencies/settings.gradle.kts delete mode 100644 wire-gradle-plugin/src/test/projects/sourcejar-remote-version-catalog/settings.gradle create mode 100644 wire-gradle-plugin/src/test/projects/sourcejar-remote-version-catalog/settings.gradle.kts diff --git a/wire-gradle-plugin/build.gradle.kts b/wire-gradle-plugin/build.gradle.kts index 9126c85e3b..9fda2eb409 100644 --- a/wire-gradle-plugin/build.gradle.kts +++ b/wire-gradle-plugin/build.gradle.kts @@ -35,14 +35,15 @@ gradlePlugin { dependencies { compileOnly(gradleApi()) compileOnly(libs.pluginz.android) + compileOnly(libs.pluginz.kotlin) implementation(projects.wireCompiler) implementation(projects.wireKotlinGenerator) implementation(libs.swiftpoet) - implementation(libs.pluginz.kotlin) testImplementation(libs.junit) testImplementation(libs.assertj) + testImplementation(libs.pluginz.kotlin) testImplementation(projects.wireTestUtils) } @@ -55,6 +56,13 @@ tasks.withType().configureEach { jvmArgs("--add-opens", "java.base/java.util=ALL-UNNAMED") dependsOn(installProtoJars) dependsOn(":wire-runtime:installLocally") + dependsOn(":wire-java-generator:publishAllPublicationsToLocalMavenRepository") + dependsOn(":wire-kotlin-generator:publishAllPublicationsToLocalMavenRepository") + dependsOn(":wire-swift-generator:publishAllPublicationsToLocalMavenRepository") + dependsOn(":wire-schema:publishAllPublicationsToLocalMavenRepository") + dependsOn(":wire-grpc-client:publishAllPublicationsToLocalMavenRepository") + dependsOn(":wire-compiler:publishAllPublicationsToLocalMavenRepository") + dependsOn(":wire-gradle-plugin:publishAllPublicationsToLocalMavenRepository") } val test by tasks.getting(Test::class) { diff --git a/wire-gradle-plugin/src/test/kotlin/com/squareup/wire/gradle/WirePluginTest.kt b/wire-gradle-plugin/src/test/kotlin/com/squareup/wire/gradle/WirePluginTest.kt index dc8c084d81..e791ef6e87 100644 --- a/wire-gradle-plugin/src/test/kotlin/com/squareup/wire/gradle/WirePluginTest.kt +++ b/wire-gradle-plugin/src/test/kotlin/com/squareup/wire/gradle/WirePluginTest.kt @@ -47,7 +47,6 @@ class WirePluginTest { @Before fun setUp() { gradleRunner = GradleRunner.create() - .withPluginClasspath() // Ensure individual tests are isolated and not reusing each other's previous outputs // by setting project dir and gradle home directly. .withProjectDir(tmpFolder.newFolder("project-dir")) @@ -58,6 +57,7 @@ class WirePluginTest { "--stacktrace", "--info", "--configuration-cache", + "-PwireVersion=$VERSION", ) .withDebug(true) } @@ -456,7 +456,7 @@ class WirePluginTest { val fixtureRoot = File("src/test/projects/project-dependencies-typesafe-accessor") val result = gradleRunner.runFixture(fixtureRoot) { - withArguments("generateMainProtos", "--stacktrace", "--info").build() + withArguments("generateMainProtos", "--stacktrace", "--info", "-PwireVersion=$VERSION").build() } assertThat(result.task(":dinosaurs:generateMainProtos")?.outcome) @@ -646,7 +646,7 @@ class WirePluginTest { val outputRoot = File(fixtureRoot, "build/generated/source/wire") val result = gradleRunner.runFixture(fixtureRoot) { - withArguments("run", "--stacktrace", "--info").build() + withArguments("run", "--stacktrace", "--info", "-PwireVersion=$VERSION").build() } assertThat(result.task(":generateMainProtos")).isNotNull() @@ -660,7 +660,7 @@ class WirePluginTest { val outputRoot = File(fixtureRoot, "build/generated/source/wire") val result = gradleRunner.runFixture(fixtureRoot) { - withArguments("run", "--stacktrace", "--info").build() + withArguments("run", "--stacktrace", "--info", "-PwireVersion=$VERSION").build() } assertThat(result.task(":generateMainProtos")).isNotNull() @@ -674,7 +674,7 @@ class WirePluginTest { val outputRoot = File(fixtureRoot, "build/generated/source/wire") val result = gradleRunner.runFixture(fixtureRoot) { - withArguments("run", "--stacktrace", "--info").build() + withArguments("run", "--stacktrace", "--info", "-PwireVersion=$VERSION").build() } assertThat(result.task(":generateMainProtos")).isNotNull() @@ -688,7 +688,7 @@ class WirePluginTest { val outputRoot = File(fixtureRoot, "build/generated/source/wire") val result = gradleRunner.runFixture(fixtureRoot) { - withArguments("run", "--stacktrace", "--info").build() + withArguments("run", "--stacktrace", "--info", "-PwireVersion=$VERSION").build() } assertThat(result.task(":generateMainProtos")).isNotNull() @@ -701,7 +701,7 @@ class WirePluginTest { val fixtureRoot = File("src/test/projects/proto-library") gradleRunner.runFixture(fixtureRoot) { - withArguments("jar", "--stacktrace", "--info").build() + withArguments("jar", "--stacktrace", "--info", "-PwireVersion=$VERSION").build() } ZipFile(File(fixtureRoot, "build/libs/proto-library.jar")).use { @@ -729,7 +729,7 @@ class WirePluginTest { val outputRoot = File(fixtureRoot, "build/generated/source/wire") val result = gradleRunner.runFixture(fixtureRoot) { - withArguments("run", "--stacktrace", "--info").build() + withArguments("run", "--stacktrace", "--info", "-PwireVersion=$VERSION").build() } assertThat(result.task(":generateMainProtos")).isNotNull() @@ -973,6 +973,7 @@ class WirePluginTest { "-Dkjs=$kmpJsEnabled", "-Dknative=$kmpNativeEnabled", "--debug", + "-PwireVersion=$VERSION", ).build() } @@ -1219,7 +1220,7 @@ class WirePluginTest { val geologyOutputRoot = File(fixtureRoot, "geology/build/generated/source/wire") val result = gradleRunner.runFixture(fixtureRoot) { - withArguments("generateMainProtos", "--stacktrace", "--info").build() + withArguments("generateMainProtos", "--stacktrace", "--info", "-PwireVersion=$VERSION").build() } assertThat(result.task(":dinosaurs:generateMainProtos")?.outcome) @@ -1247,7 +1248,7 @@ class WirePluginTest { val fixtureRoot = File("src/test/projects/cache-relocation-1") val result = gradleRunner.runFixture(fixtureRoot) { - withArguments("generateProtos", "--build-cache", "--stacktrace", "--info").build() + withArguments("generateProtos", "--build-cache", "--stacktrace", "--info", "-PwireVersion=$VERSION").build() } assertThat(result.task(":generateProtos")).isNotNull() @@ -1261,7 +1262,7 @@ class WirePluginTest { val relocatedRoot = File("src/test/projects/cache-relocation-2") val relocatedResult = gradleRunner.runFixture(relocatedRoot) { - withArguments("generateProtos", "--build-cache", "--stacktrace", "--info").build() + withArguments("generateProtos", "--build-cache", "--stacktrace", "--info", "-PwireVersion=$VERSION").build() } assertThat(relocatedResult.task(":generateProtos")).isNotNull() @@ -1284,7 +1285,7 @@ class WirePluginTest { val fixtureRoot = File("src/test/projects/cache-include-paths-1") val result = gradleRunner.runFixture(fixtureRoot) { - withArguments("generateProtos", "--build-cache", "--stacktrace", "--debug").build() + withArguments("generateProtos", "--build-cache", "--stacktrace", "--debug", "-PwireVersion=$VERSION").build() } assertThat(result.task(":generateProtos")).isNotNull() @@ -1296,7 +1297,7 @@ class WirePluginTest { assertThat(buildCacheDir.exists()).isTrue() val cachedResult = gradleRunner.runFixture(fixtureRoot) { - withArguments("generateProtos", "--build-cache", "--stacktrace", "--debug").build() + withArguments("generateProtos", "--build-cache", "--stacktrace", "--debug", "-PwireVersion=$VERSION").build() } assertThat(cachedResult.task(":generateProtos")).isNotNull() @@ -1320,7 +1321,7 @@ class WirePluginTest { val fixtureRoot = File("src/test/projects/cache-include-paths-1") val result = gradleRunner.runFixture(fixtureRoot) { - withArguments("generateProtos", "--build-cache", "--stacktrace", "--info").build() + withArguments("generateProtos", "--build-cache", "--stacktrace", "--info", "-PwireVersion=$VERSION").build() } assertThat(result.task(":generateProtos")).isNotNull() @@ -1336,7 +1337,7 @@ class WirePluginTest { // expect the new task to run again, without using the cache. val modifiedFixtureRoot = File("src/test/projects/cache-include-paths-2") val modifiedResult = gradleRunner.runFixture(modifiedFixtureRoot) { - withArguments("generateProtos", "--build-cache", "--stacktrace", "--debug").build() + withArguments("generateProtos", "--build-cache", "--stacktrace", "--debug", "-PwireVersion=$VERSION").build() } assertThat(modifiedResult.task(":generateProtos")).isNotNull() @@ -1355,7 +1356,7 @@ class WirePluginTest { val fixtureRoot = File("src/test/projects/configuration-cache-failure") val result = gradleRunner.runFixture(fixtureRoot) { - withArguments("clean", "generateMainProtos", "--stacktrace", "--info").build() + withArguments("clean", "generateMainProtos", "--stacktrace", "--info", "-PwireVersion=$VERSION").build() } assertThat(result.task(":generateMainProtos")?.outcome).isEqualTo(TaskOutcome.SUCCESS) } @@ -1365,7 +1366,7 @@ class WirePluginTest { val fixtureRoot = File("src/test/projects/kotlinsourcesjar") gradleRunner.runFixture(fixtureRoot) { - withArguments("clean", "kotlinSourcesJar", "--stacktrace", "--info").build() + withArguments("clean", "kotlinSourcesJar", "--stacktrace", "--info", "-PwireVersion=$VERSION").build() } ZipFile(File(fixtureRoot, "build/libs/kotlinsourcesjar-sources.jar")).use { @@ -1379,7 +1380,7 @@ class WirePluginTest { val outputRoot = File(fixtureRoot, "build/generated/source/wire") val result = gradleRunner.runFixture(fixtureRoot) { - withArguments("clean", "generateMainProtos", "--stacktrace", "--info").build() + withArguments("clean", "generateMainProtos", "--stacktrace", "--info", "-PwireVersion=$VERSION").build() } assertThat(result.task(":generateMainProtos")?.outcome).isEqualTo(TaskOutcome.SUCCESS) assertThat(File(outputRoot, "Dinosaur.kt")).exists() @@ -1391,12 +1392,33 @@ class WirePluginTest { action: GradleRunner.() -> BuildResult, ): BuildResult { var generatedSettings = false - val settings = File(root, "settings.gradle") + val settings = File(root, "settings.gradle.kts") var generatedGradleProperties = false val gradleProperties = File(root, "gradle.properties") return try { if (!settings.exists()) { settings.createNewFile() + settings.writeText( + """ + |pluginManagement { + | listOf(repositories, dependencyResolutionManagement.repositories).forEach { + | it.apply { + | mavenCentral() + | maven { + | url = uri(rootDir.resolve("../../../../../build/localMaven").absolutePath) + | } + | } + | } + |} + | + |dependencyResolutionManagement { + | versionCatalogs { + | create("libs").from(files(rootDir.resolve("../../../../../gradle/libs.versions.toml").absolutePath)) + | } + |} + | + """.trimMargin(), + ) generatedSettings = true } diff --git a/wire-gradle-plugin/src/test/projects/cache-include-paths-1/build.gradle b/wire-gradle-plugin/src/test/projects/cache-include-paths-1/build.gradle index 6199ced0fc..8b4a6192e6 100644 --- a/wire-gradle-plugin/src/test/projects/cache-include-paths-1/build.gradle +++ b/wire-gradle-plugin/src/test/projects/cache-include-paths-1/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // This file should be kept in sync with `cache-include-paths-2/build.gradle` with the exception of diff --git a/wire-gradle-plugin/src/test/projects/cache-include-paths-1/settings.gradle b/wire-gradle-plugin/src/test/projects/cache-include-paths-1/settings.gradle deleted file mode 100644 index 816593eff6..0000000000 --- a/wire-gradle-plugin/src/test/projects/cache-include-paths-1/settings.gradle +++ /dev/null @@ -1,5 +0,0 @@ -buildCache { - local { - directory = new File(rootDir, '../.cache-include-paths-build-cache') - } -} diff --git a/wire-gradle-plugin/src/test/projects/cache-include-paths-1/settings.gradle.kts b/wire-gradle-plugin/src/test/projects/cache-include-paths-1/settings.gradle.kts new file mode 100644 index 0000000000..b5ef8f9e3f --- /dev/null +++ b/wire-gradle-plugin/src/test/projects/cache-include-paths-1/settings.gradle.kts @@ -0,0 +1,24 @@ +buildCache { + local { + directory = File(rootDir, "../.cache-include-paths-build-cache") + } +} + +pluginManagement { + listOf(repositories, dependencyResolutionManagement.repositories).forEach { + it.apply { + mavenCentral() + maven { + url = uri(rootDir.resolve("../../../../../build/localMaven").absolutePath) + } + } + } +} + +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files(rootDir.resolve("../../../../../gradle/libs.versions.toml").absolutePath)) + } + } +} diff --git a/wire-gradle-plugin/src/test/projects/cache-include-paths-2/build.gradle b/wire-gradle-plugin/src/test/projects/cache-include-paths-2/build.gradle index 5e964d9414..65fdb2a106 100644 --- a/wire-gradle-plugin/src/test/projects/cache-include-paths-2/build.gradle +++ b/wire-gradle-plugin/src/test/projects/cache-include-paths-2/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // This file should be kept in sync with `cache-include-paths-1/build.gradle` with the exception of diff --git a/wire-gradle-plugin/src/test/projects/cache-include-paths-2/settings.gradle b/wire-gradle-plugin/src/test/projects/cache-include-paths-2/settings.gradle deleted file mode 100644 index 816593eff6..0000000000 --- a/wire-gradle-plugin/src/test/projects/cache-include-paths-2/settings.gradle +++ /dev/null @@ -1,5 +0,0 @@ -buildCache { - local { - directory = new File(rootDir, '../.cache-include-paths-build-cache') - } -} diff --git a/wire-gradle-plugin/src/test/projects/cache-include-paths-2/settings.gradle.kts b/wire-gradle-plugin/src/test/projects/cache-include-paths-2/settings.gradle.kts new file mode 100644 index 0000000000..b5ef8f9e3f --- /dev/null +++ b/wire-gradle-plugin/src/test/projects/cache-include-paths-2/settings.gradle.kts @@ -0,0 +1,24 @@ +buildCache { + local { + directory = File(rootDir, "../.cache-include-paths-build-cache") + } +} + +pluginManagement { + listOf(repositories, dependencyResolutionManagement.repositories).forEach { + it.apply { + mavenCentral() + maven { + url = uri(rootDir.resolve("../../../../../build/localMaven").absolutePath) + } + } + } +} + +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files(rootDir.resolve("../../../../../gradle/libs.versions.toml").absolutePath)) + } + } +} diff --git a/wire-gradle-plugin/src/test/projects/cache-relocation-1/build.gradle b/wire-gradle-plugin/src/test/projects/cache-relocation-1/build.gradle index 4b0e2e2ff2..4e4ab9becb 100644 --- a/wire-gradle-plugin/src/test/projects/cache-relocation-1/build.gradle +++ b/wire-gradle-plugin/src/test/projects/cache-relocation-1/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // The code in this test project should be identical to diff --git a/wire-gradle-plugin/src/test/projects/cache-relocation-1/settings.gradle b/wire-gradle-plugin/src/test/projects/cache-relocation-1/settings.gradle deleted file mode 100644 index 50c8b6035b..0000000000 --- a/wire-gradle-plugin/src/test/projects/cache-relocation-1/settings.gradle +++ /dev/null @@ -1,5 +0,0 @@ -buildCache { - local { - directory = new File(rootDir, '../.relocation-build-cache') - } -} diff --git a/wire-gradle-plugin/src/test/projects/cache-relocation-1/settings.gradle.kts b/wire-gradle-plugin/src/test/projects/cache-relocation-1/settings.gradle.kts new file mode 100644 index 0000000000..e47d9a22dc --- /dev/null +++ b/wire-gradle-plugin/src/test/projects/cache-relocation-1/settings.gradle.kts @@ -0,0 +1,24 @@ +buildCache { + local { + directory = File(rootDir, "../.relocation-build-cache") + } +} + +pluginManagement { + listOf(repositories, dependencyResolutionManagement.repositories).forEach { + it.apply { + mavenCentral() + maven { + url = uri(rootDir.resolve("../../../../../build/localMaven").absolutePath) + } + } + } +} + +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files(rootDir.resolve("../../../../../gradle/libs.versions.toml").absolutePath)) + } + } +} diff --git a/wire-gradle-plugin/src/test/projects/cache-relocation-2/build.gradle b/wire-gradle-plugin/src/test/projects/cache-relocation-2/build.gradle index 05c6cbefb3..fe2e8af0f5 100644 --- a/wire-gradle-plugin/src/test/projects/cache-relocation-2/build.gradle +++ b/wire-gradle-plugin/src/test/projects/cache-relocation-2/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // The code in this test project should be identical to diff --git a/wire-gradle-plugin/src/test/projects/cache-relocation-2/settings.gradle b/wire-gradle-plugin/src/test/projects/cache-relocation-2/settings.gradle deleted file mode 100644 index 50c8b6035b..0000000000 --- a/wire-gradle-plugin/src/test/projects/cache-relocation-2/settings.gradle +++ /dev/null @@ -1,5 +0,0 @@ -buildCache { - local { - directory = new File(rootDir, '../.relocation-build-cache') - } -} diff --git a/wire-gradle-plugin/src/test/projects/cache-relocation-2/settings.gradle.kts b/wire-gradle-plugin/src/test/projects/cache-relocation-2/settings.gradle.kts new file mode 100644 index 0000000000..e47d9a22dc --- /dev/null +++ b/wire-gradle-plugin/src/test/projects/cache-relocation-2/settings.gradle.kts @@ -0,0 +1,24 @@ +buildCache { + local { + directory = File(rootDir, "../.relocation-build-cache") + } +} + +pluginManagement { + listOf(repositories, dependencyResolutionManagement.repositories).forEach { + it.apply { + mavenCentral() + maven { + url = uri(rootDir.resolve("../../../../../build/localMaven").absolutePath) + } + } + } +} + +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files(rootDir.resolve("../../../../../gradle/libs.versions.toml").absolutePath)) + } + } +} diff --git a/wire-gradle-plugin/src/test/projects/configuration-cache-failure/build.gradle.kts b/wire-gradle-plugin/src/test/projects/configuration-cache-failure/build.gradle.kts index 78e5499bb3..6737ee63af 100644 --- a/wire-gradle-plugin/src/test/projects/configuration-cache-failure/build.gradle.kts +++ b/wire-gradle-plugin/src/test/projects/configuration-cache-failure/build.gradle.kts @@ -1,6 +1,6 @@ plugins { - id("com.squareup.wire") - id("org.jetbrains.kotlin.jvm") version "1.9.22" + id("com.squareup.wire") version("$wireVersion") + id("org.jetbrains.kotlin.jvm") version libs.versions.kotlin } val genProtosDir = "$buildDir/generated/proto" diff --git a/wire-gradle-plugin/src/test/projects/configuration-cache-failure/gradle.properties b/wire-gradle-plugin/src/test/projects/configuration-cache-failure/gradle.properties index f99878e87a..54ac8d93ab 100644 --- a/wire-gradle-plugin/src/test/projects/configuration-cache-failure/gradle.properties +++ b/wire-gradle-plugin/src/test/projects/configuration-cache-failure/gradle.properties @@ -1,4 +1,3 @@ org.gradle.caching=false org.gradle.unsafe.configuration-cache=true org.gradle.configuration-cache=true -VERSION_NAME=5.1.1-SNAPSHOT diff --git a/wire-gradle-plugin/src/test/projects/consecutive-runs/build.gradle b/wire-gradle-plugin/src/test/projects/consecutive-runs/build.gradle index dc57750163..bb58362040 100644 --- a/wire-gradle-plugin/src/test/projects/consecutive-runs/build.gradle +++ b/wire-gradle-plugin/src/test/projects/consecutive-runs/build.gradle @@ -1,11 +1,11 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { kotlin { out 'custom' } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/custom-output-no-such-class/build.gradle b/wire-gradle-plugin/src/test/projects/custom-output-no-such-class/build.gradle index 0c82bd9a7e..23fda8f667 100644 --- a/wire-gradle-plugin/src/test/projects/custom-output-no-such-class/build.gradle +++ b/wire-gradle-plugin/src/test/projects/custom-output-no-such-class/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/custom-output/build.gradle b/wire-gradle-plugin/src/test/projects/custom-output/build.gradle index 5a3828004f..81db34cb45 100644 --- a/wire-gradle-plugin/src/test/projects/custom-output/build.gradle +++ b/wire-gradle-plugin/src/test/projects/custom-output/build.gradle @@ -3,7 +3,8 @@ import org.jetbrains.annotations.NotNull plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } class MyCustomHandlerFactory implements SchemaHandler.Factory { diff --git a/wire-gradle-plugin/src/test/projects/customize-configuration/build.gradle b/wire-gradle-plugin/src/test/projects/customize-configuration/build.gradle index f829b27553..d4db2f3985 100644 --- a/wire-gradle-plugin/src/test/projects/customize-configuration/build.gradle +++ b/wire-gradle-plugin/src/test/projects/customize-configuration/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // See installProtoJars task in wire-gradle-plugin/build.gradle.kts diff --git a/wire-gradle-plugin/src/test/projects/customize-task/build.gradle b/wire-gradle-plugin/src/test/projects/customize-task/build.gradle index 4f587e2960..481db54262 100644 --- a/wire-gradle-plugin/src/test/projects/customize-task/build.gradle +++ b/wire-gradle-plugin/src/test/projects/customize-task/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // See installProtoJars task in wire-gradle-plugin/build.gradle.kts diff --git a/wire-gradle-plugin/src/test/projects/different-java-out/build.gradle b/wire-gradle-plugin/src/test/projects/different-java-out/build.gradle index b15a61175e..cecefe572c 100644 --- a/wire-gradle-plugin/src/test/projects/different-java-out/build.gradle +++ b/wire-gradle-plugin/src/test/projects/different-java-out/build.gradle @@ -1,10 +1,11 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { java { out 'custom' } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/different-kotlin-out/build.gradle b/wire-gradle-plugin/src/test/projects/different-kotlin-out/build.gradle index dc57750163..bb58362040 100644 --- a/wire-gradle-plugin/src/test/projects/different-kotlin-out/build.gradle +++ b/wire-gradle-plugin/src/test/projects/different-kotlin-out/build.gradle @@ -1,11 +1,11 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { kotlin { out 'custom' } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/different-proto-out/build.gradle b/wire-gradle-plugin/src/test/projects/different-proto-out/build.gradle index 94a2969b3e..981b20daf5 100644 --- a/wire-gradle-plugin/src/test/projects/different-proto-out/build.gradle +++ b/wire-gradle-plugin/src/test/projects/different-proto-out/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/do-not-emit-wire-runtime-protos/build.gradle b/wire-gradle-plugin/src/test/projects/do-not-emit-wire-runtime-protos/build.gradle index 60ffa8a7f8..c7f9a9197d 100644 --- a/wire-gradle-plugin/src/test/projects/do-not-emit-wire-runtime-protos/build.gradle +++ b/wire-gradle-plugin/src/test/projects/do-not-emit-wire-runtime-protos/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/dry-run/build.gradle b/wire-gradle-plugin/src/test/projects/dry-run/build.gradle index 9634f2ee57..dee8912034 100644 --- a/wire-gradle-plugin/src/test/projects/dry-run/build.gradle +++ b/wire-gradle-plugin/src/test/projects/dry-run/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire{ diff --git a/wire-gradle-plugin/src/test/projects/emit-java-options/build.gradle b/wire-gradle-plugin/src/test/projects/emit-java-options/build.gradle index e5b87631b3..c56276155b 100644 --- a/wire-gradle-plugin/src/test/projects/emit-java-options/build.gradle +++ b/wire-gradle-plugin/src/test/projects/emit-java-options/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/emit-java-then-emit-kotlin/build.gradle b/wire-gradle-plugin/src/test/projects/emit-java-then-emit-kotlin/build.gradle index 62a24a2fb3..44d75bfdbb 100644 --- a/wire-gradle-plugin/src/test/projects/emit-java-then-emit-kotlin/build.gradle +++ b/wire-gradle-plugin/src/test/projects/emit-java-then-emit-kotlin/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { @@ -12,4 +12,4 @@ wire { kotlin { // Kotlin gets everything else. } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/emit-kotlin-and-emit-java/build.gradle b/wire-gradle-plugin/src/test/projects/emit-kotlin-and-emit-java/build.gradle index 81150bc0ec..b2db29f1c4 100644 --- a/wire-gradle-plugin/src/test/projects/emit-kotlin-and-emit-java/build.gradle +++ b/wire-gradle-plugin/src/test/projects/emit-kotlin-and-emit-java/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { @@ -13,4 +13,4 @@ wire { // Java gets everything. exclusive = false } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/emit-kotlin-and-emit-java/settings.gradle b/wire-gradle-plugin/src/test/projects/emit-kotlin-and-emit-java/settings.gradle deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/wire-gradle-plugin/src/test/projects/emit-kotlin-options/build.gradle b/wire-gradle-plugin/src/test/projects/emit-kotlin-options/build.gradle index 57962e681b..08ba99fccd 100644 --- a/wire-gradle-plugin/src/test/projects/emit-kotlin-options/build.gradle +++ b/wire-gradle-plugin/src/test/projects/emit-kotlin-options/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/emit-kotlin-then-emit-java/build.gradle b/wire-gradle-plugin/src/test/projects/emit-kotlin-then-emit-java/build.gradle index 019e193675..1e6f195764 100644 --- a/wire-gradle-plugin/src/test/projects/emit-kotlin-then-emit-java/build.gradle +++ b/wire-gradle-plugin/src/test/projects/emit-kotlin-then-emit-java/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { @@ -12,4 +12,4 @@ wire { java { // Java gets everything else. } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/emit-options-with-includes/build.gradle b/wire-gradle-plugin/src/test/projects/emit-options-with-includes/build.gradle index 48ccca60d3..a9d73914d9 100644 --- a/wire-gradle-plugin/src/test/projects/emit-options-with-includes/build.gradle +++ b/wire-gradle-plugin/src/test/projects/emit-options-with-includes/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/emit-options-without-conflicts/build.gradle b/wire-gradle-plugin/src/test/projects/emit-options-without-conflicts/build.gradle index 57962e681b..08ba99fccd 100644 --- a/wire-gradle-plugin/src/test/projects/emit-options-without-conflicts/build.gradle +++ b/wire-gradle-plugin/src/test/projects/emit-options-without-conflicts/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/emit-proto-with-prune/build.gradle b/wire-gradle-plugin/src/test/projects/emit-proto-with-prune/build.gradle index 7eda09a36d..b137cacdef 100644 --- a/wire-gradle-plugin/src/test/projects/emit-proto-with-prune/build.gradle +++ b/wire-gradle-plugin/src/test/projects/emit-proto-with-prune/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/emit-proto-with-root/build.gradle b/wire-gradle-plugin/src/test/projects/emit-proto-with-root/build.gradle index 69acc7d13a..3430d676fa 100644 --- a/wire-gradle-plugin/src/test/projects/emit-proto-with-root/build.gradle +++ b/wire-gradle-plugin/src/test/projects/emit-proto-with-root/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/emit-proto/build.gradle b/wire-gradle-plugin/src/test/projects/emit-proto/build.gradle index 25eac5bf3a..c9446103a9 100644 --- a/wire-gradle-plugin/src/test/projects/emit-proto/build.gradle +++ b/wire-gradle-plugin/src/test/projects/emit-proto/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/emit-service-name-suffix/build.gradle b/wire-gradle-plugin/src/test/projects/emit-service-name-suffix/build.gradle index 95926cd753..8d1ea5c14c 100644 --- a/wire-gradle-plugin/src/test/projects/emit-service-name-suffix/build.gradle +++ b/wire-gradle-plugin/src/test/projects/emit-service-name-suffix/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/emit-service-none/build.gradle b/wire-gradle-plugin/src/test/projects/emit-service-none/build.gradle index 3b0c0e1d51..ac8518cf2d 100644 --- a/wire-gradle-plugin/src/test/projects/emit-service-none/build.gradle +++ b/wire-gradle-plugin/src/test/projects/emit-service-none/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/emit-service-two-ways/build.gradle b/wire-gradle-plugin/src/test/projects/emit-service-two-ways/build.gradle index 0514973281..0ea5e11b62 100644 --- a/wire-gradle-plugin/src/test/projects/emit-service-two-ways/build.gradle +++ b/wire-gradle-plugin/src/test/projects/emit-service-two-ways/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/emit-service/build.gradle b/wire-gradle-plugin/src/test/projects/emit-service/build.gradle index bf00a2b411..43621dc9ad 100644 --- a/wire-gradle-plugin/src/test/projects/emit-service/build.gradle +++ b/wire-gradle-plugin/src/test/projects/emit-service/build.gradle @@ -1,10 +1,10 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { kotlin { } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/field-prune/build.gradle b/wire-gradle-plugin/src/test/projects/field-prune/build.gradle index 8277788d65..2e7dc13bb2 100644 --- a/wire-gradle-plugin/src/test/projects/field-prune/build.gradle +++ b/wire-gradle-plugin/src/test/projects/field-prune/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { @@ -9,4 +9,4 @@ wire { prune 'squareup.dinosaurs.Dinosaur#name' kotlin {} -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/field-prunes/build.gradle b/wire-gradle-plugin/src/test/projects/field-prunes/build.gradle index 510539a9a0..18320d054c 100644 --- a/wire-gradle-plugin/src/test/projects/field-prunes/build.gradle +++ b/wire-gradle-plugin/src/test/projects/field-prunes/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { @@ -10,4 +10,4 @@ wire { prune 'squareup.dinosaurs.Dinosaur#length_meters' kotlin {} -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/field-root/build.gradle b/wire-gradle-plugin/src/test/projects/field-root/build.gradle index df8d5964c2..17e642df88 100644 --- a/wire-gradle-plugin/src/test/projects/field-root/build.gradle +++ b/wire-gradle-plugin/src/test/projects/field-root/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { @@ -9,4 +9,4 @@ wire { root 'squareup.dinosaurs.Dinosaur#name' kotlin {} -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/field-roots/build.gradle b/wire-gradle-plugin/src/test/projects/field-roots/build.gradle index 525f8cdc01..48f4c83831 100644 --- a/wire-gradle-plugin/src/test/projects/field-roots/build.gradle +++ b/wire-gradle-plugin/src/test/projects/field-roots/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/field-rule-prune/build.gradle b/wire-gradle-plugin/src/test/projects/field-rule-prune/build.gradle index 0fcc2c0a82..6d648e5feb 100644 --- a/wire-gradle-plugin/src/test/projects/field-rule-prune/build.gradle +++ b/wire-gradle-plugin/src/test/projects/field-rule-prune/build.gradle @@ -1,11 +1,11 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { rules 'rules.txt' kotlin {} -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/field-rule-root/build.gradle b/wire-gradle-plugin/src/test/projects/field-rule-root/build.gradle index 0fcc2c0a82..6d648e5feb 100644 --- a/wire-gradle-plugin/src/test/projects/field-rule-root/build.gradle +++ b/wire-gradle-plugin/src/test/projects/field-rule-root/build.gradle @@ -1,11 +1,11 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { rules 'rules.txt' kotlin {} -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/java-project-java-protos/build.gradle b/wire-gradle-plugin/src/test/projects/java-project-java-protos/build.gradle index 488a5a66cd..ba84a0de95 100644 --- a/wire-gradle-plugin/src/test/projects/java-project-java-protos/build.gradle +++ b/wire-gradle-plugin/src/test/projects/java-project-java-protos/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } mainClassName = 'com.squareup.dinosaurs.Sample' @@ -13,10 +14,10 @@ repositories { } dependencies { - implementation "com.squareup.wire:wire-runtime:$VERSION_NAME" + implementation "com.squareup.wire:wire-runtime:$wireVersion" } wire{ java{ } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/java-project-kotlin-protos/build.gradle b/wire-gradle-plugin/src/test/projects/java-project-kotlin-protos/build.gradle index 9d8a9287a1..c03b9a6a9d 100644 --- a/wire-gradle-plugin/src/test/projects/java-project-kotlin-protos/build.gradle +++ b/wire-gradle-plugin/src/test/projects/java-project-kotlin-protos/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } mainClassName = 'com.squareup.dinosaurs.Sample' @@ -14,7 +14,7 @@ repositories { } dependencies { - implementation "com.squareup.wire:wire-runtime:$VERSION_NAME" + implementation "com.squareup.wire:wire-runtime:$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/kotlin-enum-mode/build.gradle b/wire-gradle-plugin/src/test/projects/kotlin-enum-mode/build.gradle index b9b425f428..ccc9131ae4 100644 --- a/wire-gradle-plugin/src/test/projects/kotlin-enum-mode/build.gradle +++ b/wire-gradle-plugin/src/test/projects/kotlin-enum-mode/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/kotlin-multiplatform/build.gradle b/wire-gradle-plugin/src/test/projects/kotlin-multiplatform/build.gradle index 29c98b77dd..e149d0f756 100644 --- a/wire-gradle-plugin/src/test/projects/kotlin-multiplatform/build.gradle +++ b/wire-gradle-plugin/src/test/projects/kotlin-multiplatform/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'org.jetbrains.kotlin.multiplatform' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.multiplatform' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } repositories { diff --git a/wire-gradle-plugin/src/test/projects/kotlin-multiplatform/gradle.properties b/wire-gradle-plugin/src/test/projects/kotlin-multiplatform/gradle.properties deleted file mode 100644 index 1aaedd8c56..0000000000 --- a/wire-gradle-plugin/src/test/projects/kotlin-multiplatform/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -VERSION_NAME=5.1.1-SNAPSHOT diff --git a/wire-gradle-plugin/src/test/projects/kotlin-multiplatform/settings.gradle b/wire-gradle-plugin/src/test/projects/kotlin-multiplatform/settings.gradle deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/wire-gradle-plugin/src/test/projects/kotlin-project-java-protos/build.gradle b/wire-gradle-plugin/src/test/projects/kotlin-project-java-protos/build.gradle index 64d16a5c3b..1a211e23be 100644 --- a/wire-gradle-plugin/src/test/projects/kotlin-project-java-protos/build.gradle +++ b/wire-gradle-plugin/src/test/projects/kotlin-project-java-protos/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } mainClassName = 'com.squareup.dinosaurs.Sample' @@ -14,7 +14,7 @@ repositories { } dependencies { - implementation "com.squareup.wire:wire-runtime:$VERSION_NAME" + implementation "com.squareup.wire:wire-runtime:$wireVersion" compileOnly "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.20" } @@ -22,4 +22,4 @@ dependencies { wire{ java{ } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/kotlin-project-kotlin-protos/build.gradle b/wire-gradle-plugin/src/test/projects/kotlin-project-kotlin-protos/build.gradle index b4ceb3326b..d50f2e51ad 100644 --- a/wire-gradle-plugin/src/test/projects/kotlin-project-kotlin-protos/build.gradle +++ b/wire-gradle-plugin/src/test/projects/kotlin-project-kotlin-protos/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } mainClassName = 'com.squareup.dinosaurs.Sample' @@ -14,7 +14,7 @@ repositories { } dependencies { - implementation "com.squareup.wire:wire-runtime:$VERSION_NAME" + implementation "com.squareup.wire:wire-runtime:$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/kotlinsourcesjar/build.gradle.kts b/wire-gradle-plugin/src/test/projects/kotlinsourcesjar/build.gradle.kts index ed74681796..75442cb79b 100644 --- a/wire-gradle-plugin/src/test/projects/kotlinsourcesjar/build.gradle.kts +++ b/wire-gradle-plugin/src/test/projects/kotlinsourcesjar/build.gradle.kts @@ -1,6 +1,6 @@ plugins { - id("org.jetbrains.kotlin.jvm") version "1.9.22" - id("com.squareup.wire") + id("org.jetbrains.kotlin.jvm") version libs.versions.kotlin + id("com.squareup.wire") version("$wireVersion") } wire { diff --git a/wire-gradle-plugin/src/test/projects/listener-no-such-class/build.gradle b/wire-gradle-plugin/src/test/projects/listener-no-such-class/build.gradle index 1889fd556e..3f359ad6c7 100644 --- a/wire-gradle-plugin/src/test/projects/listener-no-such-class/build.gradle +++ b/wire-gradle-plugin/src/test/projects/listener-no-such-class/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/listener/build.gradle b/wire-gradle-plugin/src/test/projects/listener/build.gradle index b7b9d9685d..f1c22f0e76 100644 --- a/wire-gradle-plugin/src/test/projects/listener/build.gradle +++ b/wire-gradle-plugin/src/test/projects/listener/build.gradle @@ -10,8 +10,8 @@ import org.slf4j.Logger plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } class MyEventListenerFactory implements EventListener.Factory { diff --git a/wire-gradle-plugin/src/test/projects/missing-kotlin-plugin/build.gradle b/wire-gradle-plugin/src/test/projects/missing-kotlin-plugin/build.gradle index 946baff33c..b214830d2e 100644 --- a/wire-gradle-plugin/src/test/projects/missing-kotlin-plugin/build.gradle +++ b/wire-gradle-plugin/src/test/projects/missing-kotlin-plugin/build.gradle @@ -1,8 +1,9 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { kotlin {} -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/missing-plugin/build.gradle b/wire-gradle-plugin/src/test/projects/missing-plugin/build.gradle index fd0e09b975..31957de6b2 100644 --- a/wire-gradle-plugin/src/test/projects/missing-plugin/build.gradle +++ b/wire-gradle-plugin/src/test/projects/missing-plugin/build.gradle @@ -1,8 +1,8 @@ plugins { - id 'com.squareup.wire' + id 'com.squareup.wire' version "$wireVersion" } wire{ java{ } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/move-message/build.gradle b/wire-gradle-plugin/src/test/projects/move-message/build.gradle index c435705f9b..b98831c5da 100644 --- a/wire-gradle-plugin/src/test/projects/move-message/build.gradle +++ b/wire-gradle-plugin/src/test/projects/move-message/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/only-version/build.gradle b/wire-gradle-plugin/src/test/projects/only-version/build.gradle index 3a378bca46..12f234d40d 100644 --- a/wire-gradle-plugin/src/test/projects/only-version/build.gradle +++ b/wire-gradle-plugin/src/test/projects/only-version/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/opaque-message/build.gradle b/wire-gradle-plugin/src/test/projects/opaque-message/build.gradle index 6ac0f3bdc7..2adbc9d479 100644 --- a/wire-gradle-plugin/src/test/projects/opaque-message/build.gradle +++ b/wire-gradle-plugin/src/test/projects/opaque-message/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/package-cycles-permitted/build.gradle b/wire-gradle-plugin/src/test/projects/package-cycles-permitted/build.gradle index 005178349a..07e1c93908 100644 --- a/wire-gradle-plugin/src/test/projects/package-cycles-permitted/build.gradle +++ b/wire-gradle-plugin/src/test/projects/package-cycles-permitted/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } repositories { @@ -12,7 +12,7 @@ repositories { } dependencies { - implementation "com.squareup.wire:wire-runtime:$VERSION_NAME" + implementation "com.squareup.wire:wire-runtime:$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/package-cycles/build.gradle b/wire-gradle-plugin/src/test/projects/package-cycles/build.gradle index d470640737..d5d951a583 100644 --- a/wire-gradle-plugin/src/test/projects/package-cycles/build.gradle +++ b/wire-gradle-plugin/src/test/projects/package-cycles/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } repositories { @@ -12,7 +12,7 @@ repositories { } dependencies { - implementation "com.squareup.wire:wire-runtime:$VERSION_NAME" + implementation "com.squareup.wire:wire-runtime:$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/dinosaurs/build.gradle b/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/dinosaurs/build.gradle index 181181ae9b..f1825b551a 100644 --- a/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/dinosaurs/build.gradle +++ b/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/dinosaurs/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.squareup.wire' - id 'org.jetbrains.kotlin.jvm' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } dependencies { diff --git a/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/geology/build.gradle b/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/geology/build.gradle index e4f33b4b50..5f66fcc121 100644 --- a/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/geology/build.gradle +++ b/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/geology/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.squareup.wire' - id 'org.jetbrains.kotlin.jvm' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/location/build.gradle b/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/location/build.gradle index e4f33b4b50..5f66fcc121 100644 --- a/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/location/build.gradle +++ b/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/location/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.squareup.wire' - id 'org.jetbrains.kotlin.jvm' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/settings.gradle b/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/settings.gradle deleted file mode 100644 index fef4293a43..0000000000 --- a/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/settings.gradle +++ /dev/null @@ -1,5 +0,0 @@ -include ':dinosaurs' -include ':geology' -include ':location' - -enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") diff --git a/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/settings.gradle.kts b/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/settings.gradle.kts new file mode 100644 index 0000000000..b40897dcee --- /dev/null +++ b/wire-gradle-plugin/src/test/projects/project-dependencies-typesafe-accessor/settings.gradle.kts @@ -0,0 +1,24 @@ +include ":dinosaurs" +include ":geology" +include ":location" + +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + +pluginManagement { + listOf(repositories, dependencyResolutionManagement.repositories).forEach { + it.apply { + mavenCentral() + maven { + url = uri(rootDir.resolve("../../../../../build/localMaven").absolutePath) + } + } + } +} + +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files(rootDir.resolve("../../../../../gradle/libs.versions.toml").absolutePath)) + } + } +} diff --git a/wire-gradle-plugin/src/test/projects/project-dependencies/dinosaurs/build.gradle b/wire-gradle-plugin/src/test/projects/project-dependencies/dinosaurs/build.gradle index e7123c0bf0..d26d9926a2 100644 --- a/wire-gradle-plugin/src/test/projects/project-dependencies/dinosaurs/build.gradle +++ b/wire-gradle-plugin/src/test/projects/project-dependencies/dinosaurs/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.squareup.wire' - id 'org.jetbrains.kotlin.jvm' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } dependencies { diff --git a/wire-gradle-plugin/src/test/projects/project-dependencies/geology/build.gradle b/wire-gradle-plugin/src/test/projects/project-dependencies/geology/build.gradle index e4f33b4b50..5f66fcc121 100644 --- a/wire-gradle-plugin/src/test/projects/project-dependencies/geology/build.gradle +++ b/wire-gradle-plugin/src/test/projects/project-dependencies/geology/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.squareup.wire' - id 'org.jetbrains.kotlin.jvm' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/project-dependencies/location/build.gradle b/wire-gradle-plugin/src/test/projects/project-dependencies/location/build.gradle index e4f33b4b50..5f66fcc121 100644 --- a/wire-gradle-plugin/src/test/projects/project-dependencies/location/build.gradle +++ b/wire-gradle-plugin/src/test/projects/project-dependencies/location/build.gradle @@ -1,6 +1,7 @@ plugins { id 'com.squareup.wire' - id 'org.jetbrains.kotlin.jvm' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/project-dependencies/settings.gradle b/wire-gradle-plugin/src/test/projects/project-dependencies/settings.gradle deleted file mode 100644 index b8e6e9e904..0000000000 --- a/wire-gradle-plugin/src/test/projects/project-dependencies/settings.gradle +++ /dev/null @@ -1,3 +0,0 @@ -include ':dinosaurs' -include ':geology' -include ':location' diff --git a/wire-gradle-plugin/src/test/projects/project-dependencies/settings.gradle.kts b/wire-gradle-plugin/src/test/projects/project-dependencies/settings.gradle.kts new file mode 100644 index 0000000000..ec4abded35 --- /dev/null +++ b/wire-gradle-plugin/src/test/projects/project-dependencies/settings.gradle.kts @@ -0,0 +1,22 @@ +include ":dinosaurs" +include ":geology" +include ":location" + +pluginManagement { + listOf(repositories, dependencyResolutionManagement.repositories).forEach { + it.apply { + mavenCentral() + maven { + url = uri(rootDir.resolve("../../../../../build/localMaven").absolutePath) + } + } + } +} + +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files(rootDir.resolve("../../../../../gradle/libs.versions.toml").absolutePath)) + } + } +} diff --git a/wire-gradle-plugin/src/test/projects/proto-library/build.gradle b/wire-gradle-plugin/src/test/projects/proto-library/build.gradle index 483889d41b..aad54cc45a 100644 --- a/wire-gradle-plugin/src/test/projects/proto-library/build.gradle +++ b/wire-gradle-plugin/src/test/projects/proto-library/build.gradle @@ -1,6 +1,7 @@ plugins { id 'kotlin' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/protopath-maven/build.gradle b/wire-gradle-plugin/src/test/projects/protopath-maven/build.gradle index 2446daeb14..f92499ec07 100644 --- a/wire-gradle-plugin/src/test/projects/protopath-maven/build.gradle +++ b/wire-gradle-plugin/src/test/projects/protopath-maven/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // See installProtoJars task in wire-gradle-plugin/build.gradle.kts diff --git a/wire-gradle-plugin/src/test/projects/reject-unused/build.gradle b/wire-gradle-plugin/src/test/projects/reject-unused/build.gradle index fea4bc3c0b..b441283ccf 100644 --- a/wire-gradle-plugin/src/test/projects/reject-unused/build.gradle +++ b/wire-gradle-plugin/src/test/projects/reject-unused/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/require-target/build.gradle b/wire-gradle-plugin/src/test/projects/require-target/build.gradle index 765dd8dda1..2c27d8c82e 100644 --- a/wire-gradle-plugin/src/test/projects/require-target/build.gradle +++ b/wire-gradle-plugin/src/test/projects/require-target/build.gradle @@ -1,4 +1,5 @@ plugins { id 'application' - id 'com.squareup.wire' -} \ No newline at end of file + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" +} diff --git a/wire-gradle-plugin/src/test/projects/since-until/build.gradle b/wire-gradle-plugin/src/test/projects/since-until/build.gradle index 146dbc14f1..a6bac15a6f 100644 --- a/wire-gradle-plugin/src/test/projects/since-until/build.gradle +++ b/wire-gradle-plugin/src/test/projects/since-until/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/sourceaar-local-protopath/build.gradle b/wire-gradle-plugin/src/test/projects/sourceaar-local-protopath/build.gradle index 422e0d6ad3..3517f6a76c 100644 --- a/wire-gradle-plugin/src/test/projects/sourceaar-local-protopath/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourceaar-local-protopath/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // See installProtoJars task in wire-gradle-plugin/build.gradle.kts diff --git a/wire-gradle-plugin/src/test/projects/sourcedir-exclude/build.gradle b/wire-gradle-plugin/src/test/projects/sourcedir-exclude/build.gradle index 2c315823fe..90cd3c0c20 100644 --- a/wire-gradle-plugin/src/test/projects/sourcedir-exclude/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcedir-exclude/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } mainClassName = 'com.squareup.dinosaurs.Sample' @@ -14,7 +14,7 @@ repositories { } dependencies { - implementation "com.squareup.wire:wire-runtime:$VERSION_NAME" + implementation "com.squareup.wire:wire-runtime:$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/sourcedir-include/build.gradle b/wire-gradle-plugin/src/test/projects/sourcedir-include/build.gradle index bbfe4b604e..de014d81cd 100644 --- a/wire-gradle-plugin/src/test/projects/sourcedir-include/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcedir-include/build.gradle @@ -1,7 +1,7 @@ plugins { id 'application' - id 'org.jetbrains.kotlin.jvm' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } mainClassName = 'com.squareup.dinosaurs.Sample' @@ -14,7 +14,7 @@ repositories { } dependencies { - implementation "com.squareup.wire:wire-runtime:$VERSION_NAME" + implementation "com.squareup.wire:wire-runtime:$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/sourcejar-local-many-files/build.gradle b/wire-gradle-plugin/src/test/projects/sourcejar-local-many-files/build.gradle index 50563d88b0..9bbe953c81 100644 --- a/wire-gradle-plugin/src/test/projects/sourcejar-local-many-files/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcejar-local-many-files/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/sourcejar-local-nonproto-file/build.gradle b/wire-gradle-plugin/src/test/projects/sourcejar-local-nonproto-file/build.gradle index e3f8b8dbc2..bedace9e65 100644 --- a/wire-gradle-plugin/src/test/projects/sourcejar-local-nonproto-file/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcejar-local-nonproto-file/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/sourcejar-local-single-file/build.gradle b/wire-gradle-plugin/src/test/projects/sourcejar-local-single-file/build.gradle index b123752874..3a5ce3ec71 100644 --- a/wire-gradle-plugin/src/test/projects/sourcejar-local-single-file/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcejar-local-single-file/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/sourcejar-mixed-conflicts/build.gradle b/wire-gradle-plugin/src/test/projects/sourcejar-mixed-conflicts/build.gradle index 2737d052c9..69d63009eb 100644 --- a/wire-gradle-plugin/src/test/projects/sourcejar-mixed-conflicts/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcejar-mixed-conflicts/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // See installProtoJars task in wire-gradle-plugin/build.gradle.kts diff --git a/wire-gradle-plugin/src/test/projects/sourcejar-remote-many-files/build.gradle b/wire-gradle-plugin/src/test/projects/sourcejar-remote-many-files/build.gradle index 015a0ec94a..1834c711e1 100644 --- a/wire-gradle-plugin/src/test/projects/sourcejar-remote-many-files/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcejar-remote-many-files/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // See installProtoJars task in wire-gradle-plugin/build.gradle.kts diff --git a/wire-gradle-plugin/src/test/projects/sourcejar-remote-protopath/build.gradle b/wire-gradle-plugin/src/test/projects/sourcejar-remote-protopath/build.gradle index 1598003020..60fd3d1d45 100644 --- a/wire-gradle-plugin/src/test/projects/sourcejar-remote-protopath/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcejar-remote-protopath/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // See installProtoJars task in wire-gradle-plugin/build.gradle.kts diff --git a/wire-gradle-plugin/src/test/projects/sourcejar-remote-version-catalog/build.gradle b/wire-gradle-plugin/src/test/projects/sourcejar-remote-version-catalog/build.gradle index bbb6fb4fb4..b56f593ebd 100644 --- a/wire-gradle-plugin/src/test/projects/sourcejar-remote-version-catalog/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcejar-remote-version-catalog/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // See installProtoJars task in wire-gradle-plugin/build.gradle.kts diff --git a/wire-gradle-plugin/src/test/projects/sourcejar-remote-version-catalog/settings.gradle b/wire-gradle-plugin/src/test/projects/sourcejar-remote-version-catalog/settings.gradle deleted file mode 100644 index a5952cfe06..0000000000 --- a/wire-gradle-plugin/src/test/projects/sourcejar-remote-version-catalog/settings.gradle +++ /dev/null @@ -1,7 +0,0 @@ -dependencyResolutionManagement { - versionCatalogs { - create("libs") { - library("allprotos", "com.squareup.wire.dinosaur:all-protos:1.0") - } - } -} diff --git a/wire-gradle-plugin/src/test/projects/sourcejar-remote-version-catalog/settings.gradle.kts b/wire-gradle-plugin/src/test/projects/sourcejar-remote-version-catalog/settings.gradle.kts new file mode 100644 index 0000000000..e454d7bca7 --- /dev/null +++ b/wire-gradle-plugin/src/test/projects/sourcejar-remote-version-catalog/settings.gradle.kts @@ -0,0 +1,19 @@ +pluginManagement { + listOf(repositories, dependencyResolutionManagement.repositories).forEach { + it.apply { + mavenCentral() + maven { + url = uri(rootDir.resolve("../../../../../build/localMaven").absolutePath) + } + } + } +} + +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files(rootDir.resolve("../../../../../gradle/libs.versions.toml").absolutePath)) + library("allprotos", "com.squareup.wire.dinosaur:all-protos:1.0") + } + } +} diff --git a/wire-gradle-plugin/src/test/projects/sourcejar-remote-wildcards/build.gradle b/wire-gradle-plugin/src/test/projects/sourcejar-remote-wildcards/build.gradle index 140f389807..dab2a12517 100644 --- a/wire-gradle-plugin/src/test/projects/sourcejar-remote-wildcards/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcejar-remote-wildcards/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // See installProtoJars task in wire-gradle-plugin/build.gradle.kts diff --git a/wire-gradle-plugin/src/test/projects/sourcepath-and-protopath-intersect/build.gradle b/wire-gradle-plugin/src/test/projects/sourcepath-and-protopath-intersect/build.gradle index dfd8b3803a..033a1deb45 100644 --- a/wire-gradle-plugin/src/test/projects/sourcepath-and-protopath-intersect/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcepath-and-protopath-intersect/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // See installProtoJars task in wire-gradle-plugin/build.gradle.kts diff --git a/wire-gradle-plugin/src/test/projects/sourcepath-build-dir/build.gradle b/wire-gradle-plugin/src/test/projects/sourcepath-build-dir/build.gradle index 539e41e01d..41420010af 100644 --- a/wire-gradle-plugin/src/test/projects/sourcepath-build-dir/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcepath-build-dir/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } final String OUTPUT_REPO_DIR = "$buildDir/src/main/proto/squareup" @@ -25,4 +26,4 @@ wire { } java{ } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/sourcepath-default/build.gradle b/wire-gradle-plugin/src/test/projects/sourcepath-default/build.gradle index 8638433cef..f2b04bae4f 100644 --- a/wire-gradle-plugin/src/test/projects/sourcepath-default/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcepath-default/build.gradle @@ -1,9 +1,10 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire{ java{ } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/sourcepath-dir/build.gradle b/wire-gradle-plugin/src/test/projects/sourcepath-dir/build.gradle index fb457fb52a..e3d136bc6e 100644 --- a/wire-gradle-plugin/src/test/projects/sourcepath-dir/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcepath-dir/build.gradle @@ -1,10 +1,11 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { sourcePath 'src/main/proto' java{ } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/sourcepath-file/build.gradle b/wire-gradle-plugin/src/test/projects/sourcepath-file/build.gradle index 8ef94c0946..1558a84b9e 100644 --- a/wire-gradle-plugin/src/test/projects/sourcepath-file/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcepath-file/build.gradle @@ -1,10 +1,11 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { sourcePath 'src/main/proto/squareup/geology/period.proto' java{ } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/sourcepath-maven-single-file/build.gradle b/wire-gradle-plugin/src/test/projects/sourcepath-maven-single-file/build.gradle index bdab92ef8b..3f41a79cf1 100644 --- a/wire-gradle-plugin/src/test/projects/sourcepath-maven-single-file/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcepath-maven-single-file/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // See installProtoJars task in wire-gradle-plugin/build.gradle.kts diff --git a/wire-gradle-plugin/src/test/projects/sourcepath-maven/build.gradle b/wire-gradle-plugin/src/test/projects/sourcepath-maven/build.gradle index aa0dcc5f3d..94e695c322 100644 --- a/wire-gradle-plugin/src/test/projects/sourcepath-maven/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcepath-maven/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // See installProtoJars task in wire-gradle-plugin/build.gradle.kts diff --git a/wire-gradle-plugin/src/test/projects/sourcepath-no-sources/build.gradle b/wire-gradle-plugin/src/test/projects/sourcepath-no-sources/build.gradle index 8638433cef..f2b04bae4f 100644 --- a/wire-gradle-plugin/src/test/projects/sourcepath-no-sources/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcepath-no-sources/build.gradle @@ -1,9 +1,10 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire{ java{ } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/sourcepath-nonexistent-dir/build.gradle b/wire-gradle-plugin/src/test/projects/sourcepath-nonexistent-dir/build.gradle index fb457fb52a..e3d136bc6e 100644 --- a/wire-gradle-plugin/src/test/projects/sourcepath-nonexistent-dir/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcepath-nonexistent-dir/build.gradle @@ -1,10 +1,11 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { sourcePath 'src/main/proto' java{ } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/sourcepath-nonexistent-srcdir-with-protopath/build.gradle b/wire-gradle-plugin/src/test/projects/sourcepath-nonexistent-srcdir-with-protopath/build.gradle index 52835dc0c8..c5423606c4 100644 --- a/wire-gradle-plugin/src/test/projects/sourcepath-nonexistent-srcdir-with-protopath/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcepath-nonexistent-srcdir-with-protopath/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { diff --git a/wire-gradle-plugin/src/test/projects/sourcepath-nonexistent-srcdir/build.gradle b/wire-gradle-plugin/src/test/projects/sourcepath-nonexistent-srcdir/build.gradle index f906f282ed..a19075ded3 100644 --- a/wire-gradle-plugin/src/test/projects/sourcepath-nonexistent-srcdir/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcepath-nonexistent-srcdir/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { @@ -9,4 +10,4 @@ wire { } java{ } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/sourcepath-uri/build.gradle b/wire-gradle-plugin/src/test/projects/sourcepath-uri/build.gradle index cd43d3abc7..ecc5c3e911 100644 --- a/wire-gradle-plugin/src/test/projects/sourcepath-uri/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcepath-uri/build.gradle @@ -1,10 +1,11 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { sourcePath 'http://www.squareup.com' java{ } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/sourcetree-many-srcdirs/build.gradle b/wire-gradle-plugin/src/test/projects/sourcetree-many-srcdirs/build.gradle index 6a322d7d50..148626ff27 100644 --- a/wire-gradle-plugin/src/test/projects/sourcetree-many-srcdirs/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcetree-many-srcdirs/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { @@ -10,4 +11,4 @@ wire { } java{ } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/sourcetree-one-srcdir-many-files/build.gradle b/wire-gradle-plugin/src/test/projects/sourcetree-one-srcdir-many-files/build.gradle index ba9d9e5032..0515c4c38e 100644 --- a/wire-gradle-plugin/src/test/projects/sourcetree-one-srcdir-many-files/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcetree-one-srcdir-many-files/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { @@ -10,4 +11,4 @@ wire { } java{ } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/sourcetree-one-srcdir-one-file/build.gradle b/wire-gradle-plugin/src/test/projects/sourcetree-one-srcdir-one-file/build.gradle index ba9d9e5032..0515c4c38e 100644 --- a/wire-gradle-plugin/src/test/projects/sourcetree-one-srcdir-one-file/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcetree-one-srcdir-one-file/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } wire { @@ -10,4 +11,4 @@ wire { } java{ } -} \ No newline at end of file +} diff --git a/wire-gradle-plugin/src/test/projects/sourcezip-local-protopath/build.gradle b/wire-gradle-plugin/src/test/projects/sourcezip-local-protopath/build.gradle index 76a6272162..214b397e20 100644 --- a/wire-gradle-plugin/src/test/projects/sourcezip-local-protopath/build.gradle +++ b/wire-gradle-plugin/src/test/projects/sourcezip-local-protopath/build.gradle @@ -1,6 +1,7 @@ plugins { id 'application' - id 'com.squareup.wire' + id 'org.jetbrains.kotlin.jvm' version libs.versions.kotlin + id 'com.squareup.wire' version "$wireVersion" } // See installProtoJars task in wire-gradle-plugin/build.gradle.kts diff --git a/wire-gradle-plugin/src/test/projects/task-dependency/build.gradle.kts b/wire-gradle-plugin/src/test/projects/task-dependency/build.gradle.kts index 7670c50ef9..1763c3091d 100644 --- a/wire-gradle-plugin/src/test/projects/task-dependency/build.gradle.kts +++ b/wire-gradle-plugin/src/test/projects/task-dependency/build.gradle.kts @@ -1,8 +1,8 @@ import org.gradle.api.internal.file.FileOperations plugins { - id("com.squareup.wire") - id("org.jetbrains.kotlin.jvm") version "1.9.22" + id("com.squareup.wire") version "5.1.0-SNAPSHOT" + id("org.jetbrains.kotlin.jvm") version libs.versions.kotlin } @CacheableTask