From 19418b6cd52c43e79af648d1e718dff6239f8fa5 Mon Sep 17 00:00:00 2001 From: Holger Stolzenberg Date: Wed, 13 Nov 2024 11:43:03 +0100 Subject: [PATCH] Try to fix all tests by adopting new output path for generated sources --- README.md | 2 +- testProjectAndroidKotlinDsl/build.gradle.kts | 4 ++-- testProjectBase/build_base.gradle | 8 ++++---- testProjectKotlinDslBase/build.gradle.kts | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 48b27750..bdc9b51e 100644 --- a/README.md +++ b/README.md @@ -410,7 +410,7 @@ protobuf { Generated files are under `task.outputBaseDir` with a subdirectory per builtin and plugin. This produces a folder structure of -``$buildDir/generated/source/proto/$sourceSet/$builtinPluginName``. +``$buildDir/generated/sources/proto/$sourceSet/$builtinPluginName``. The subdirectory name, which is by default ``$builtinPluginName``, can be changed by setting the ``outputSubDir`` property in the ``builtins`` or diff --git a/testProjectAndroidKotlinDsl/build.gradle.kts b/testProjectAndroidKotlinDsl/build.gradle.kts index cad04866..f8cb68c3 100644 --- a/testProjectAndroidKotlinDsl/build.gradle.kts +++ b/testProjectAndroidKotlinDsl/build.gradle.kts @@ -310,10 +310,10 @@ fun assertJavaCompileHasProtoGeneratedDir( compileJavaTask: JavaCompile, codegenPlugins: Collection ) { - val baseDir = File("${project.buildDir}/generated/source/proto/$variant") + val baseDir = File("${project.buildDir}/generated/sources/protos/$variant") // The expected direct subdirectories under baseDir val expectedDirs = codegenPlugins.map { codegenPlugin -> - File("${project.buildDir}/generated/source/proto/$variant/$codegenPlugin") + File("${project.buildDir}/generated/sources/proto/$variant/$codegenPlugin") }.toSet() val actualDirs = mutableSetOf() diff --git a/testProjectBase/build_base.gradle b/testProjectBase/build_base.gradle index 287e151d..75c5332f 100644 --- a/testProjectBase/build_base.gradle +++ b/testProjectBase/build_base.gradle @@ -97,9 +97,9 @@ test.doLast { // Check generateDescriptorSet option has been honored ['main', 'test'].each { sourceSet -> - assertFileExists(false, "$buildDir/generated/source/proto/$sourceSet/descriptor_set.desc") + assertFileExists(false, "$buildDir/generated/sources/proto/$sourceSet/descriptor_set.desc") } - assertFileExists(true, "$buildDir/generated/source/proto/grpc/descriptor_set.desc") + assertFileExists(true, "$buildDir/generated/sources/proto/grpc/descriptor_set.desc") } rootProject.ext { @@ -108,10 +108,10 @@ rootProject.ext { // not include any other dirs under the generated code base dir. assertJavaCompileHasProtoGeneratedDir = { Project project, String sourceSet, JavaCompile compileJavaTask, Collection codegenPlugins -> - def baseDir = "${project.buildDir}/generated/source/proto/$sourceSet" as File + def baseDir = "${project.buildDir}/generated/sources/proto/$sourceSet" as File // The expected direct subdirectories under baseDir def expectedDirs = codegenPlugins.collect { codegenPlugin -> - "${project.buildDir}/generated/source/proto/$sourceSet/$codegenPlugin" as File + "${project.buildDir}/generated/sources/proto/$sourceSet/$codegenPlugin" as File } as Set def actualDirs = new HashSet() diff --git a/testProjectKotlinDslBase/build.gradle.kts b/testProjectKotlinDslBase/build.gradle.kts index ed2a37a5..3ade54f9 100644 --- a/testProjectKotlinDslBase/build.gradle.kts +++ b/testProjectKotlinDslBase/build.gradle.kts @@ -97,9 +97,9 @@ tasks { assertJavaCompileHasProtoGeneratedDir("grpc", listOf("java", "grpc_output")) listOf("main", "test").forEach { sourceSet -> - assertFileExists(false, "$buildDir/generated/source/proto/$sourceSet/descriptor_set.desc") + assertFileExists(false, "$buildDir/generated/sources/proto/$sourceSet/descriptor_set.desc") } - assertFileExists(true, "$buildDir/generated/source/proto/grpc/descriptor_set.desc") + assertFileExists(true, "$buildDir/generated/sources/proto/grpc/descriptor_set.desc") } } } @@ -123,10 +123,10 @@ fun assertJavaCompileHasProtoGeneratedDir( compileJavaTask: JavaCompile, codegenPlugins: Collection ) { - val baseDir = File("${project.buildDir}/generated/source/proto/$sourceSet") + val baseDir = File("${project.buildDir}/generated/sources/proto/$sourceSet") // The expected direct subdirectories under baseDir val expectedDirs = codegenPlugins.map { codegenPlugin -> - File("${project.buildDir}/generated/source/proto/$sourceSet/$codegenPlugin") + File("${project.buildDir}/generated/sources/proto/$sourceSet/$codegenPlugin") }.toSet() val actualDirs = mutableSetOf()