From 28fd3fd90af531b173251db1243070d255e43602 Mon Sep 17 00:00:00 2001 From: rougsig Date: Thu, 27 Oct 2022 22:28:07 +0300 Subject: [PATCH] Add failing test case for #624 --- .../gradle/ProtobufJavaPluginTest.groovy | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/test/groovy/com/google/protobuf/gradle/ProtobufJavaPluginTest.groovy b/src/test/groovy/com/google/protobuf/gradle/ProtobufJavaPluginTest.groovy index de7e40ed..c8603a1c 100644 --- a/src/test/groovy/com/google/protobuf/gradle/ProtobufJavaPluginTest.groovy +++ b/src/test/groovy/com/google/protobuf/gradle/ProtobufJavaPluginTest.groovy @@ -91,6 +91,29 @@ class ProtobufJavaPluginTest extends Specification { gradleVersion << GRADLE_VERSIONS } + @Unroll + void "generateTestProto should not execute :compileJava task (java-only project) [gradle #gradleVersion]"() { + given: "project from testProject" + File projectDir = ProtobufPluginTestHelper.projectBuilder('testProject') + .copyDirs('testProjectBase', 'testProject') + .build() + + when: "build is invoked" + BuildResult result = ProtobufPluginTestHelper.getGradleRunner( + projectDir, + gradleVersion, + "generateTestProto" + ).build() + + then: "it succeed" + result.task(":generateTestProto").outcome == TaskOutcome.SUCCESS + assert !result.output.contains("Task :classes") + assert !result.output.contains("Task :compileJava") + + where: + gradleVersion << GRADLE_VERSIONS + } + @Unroll void "testProject should be successfully executed (configuration cache) [gradle #gradleVersion]"() { given: "project from testProject"