Skip to content

Commit

Permalink
Fix CodeNarc violations
Browse files Browse the repository at this point in the history
  • Loading branch information
clayburn committed Jun 6, 2022
1 parent 53bba1f commit 19b52b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ public abstract class GenerateProtoTask extends DefaultTask {
@InputFiles
@PathSensitive(PathSensitivity.NONE)
FileCollection getSnapshotArtifacts() {
def snapshotArtifacts = locatorToAlternativePathsMapping.map { map ->
def releaseArtifactKeys = releaseDependenciesMapping.get().keySet()
Provider<Collection<FileCollection>> snapshotArtifacts = locatorToAlternativePathsMapping.map { map ->
Set<String> releaseArtifactKeys = releaseDependenciesMapping.get().keySet()
map.findAll { entry ->
!releaseArtifactKeys.contains(entry.key)
}.values()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@ class ProtobufJavaPluginTest extends Specification {
then: "generateProto is not UP_TO_DATE"
result.task(":generateProto").outcome == TaskOutcome.SUCCESS
when: "plugin artifact is changed and build runs again"
new File(projectDir, "build.gradle")
.append("""
Expand Down Expand Up @@ -492,7 +491,7 @@ class ProtobufJavaPluginTest extends Specification {
.build()
when: "protoc path is set and build is invoked"
def buildGradleFile = new File(projectDir, "build.gradle")
File buildGradleFile = new File(projectDir, "build.gradle")
buildGradleFile.append("""
configurations {
protoc
Expand All @@ -501,13 +500,13 @@ class ProtobufJavaPluginTest extends Specification {
dependencies {
protoc "com.google.protobuf:protoc:3.0.0:\$project.osdetector.classifier@exe"
}

protobuf {
protoc {
path = "\$configurations.protoc.singleFile"
}
}""")
def result = GradleRunner.create()
BuildResult result = GradleRunner.create()
.withProjectDir(projectDir)
.withArguments('build', '--stacktrace')
.withPluginClasspath()
Expand All @@ -521,7 +520,8 @@ class ProtobufJavaPluginTest extends Specification {
result.task(":generateProto").outcome == TaskOutcome.SUCCESS
when: "protoc path is changed and build runs again"
buildGradleFile.text = buildGradleFile.text.replace("com.google.protobuf:protoc:3.0.0", "com.google.protobuf:protoc:3.0.2")
buildGradleFile.text = buildGradleFile.text.replace("com.google.protobuf:protoc:3.0.0",
"com.google.protobuf:protoc:3.0.2")
result = GradleRunner.create()
.withProjectDir(projectDir)
.withArguments('build', '--stacktrace')
Expand Down

0 comments on commit 19b52b6

Please sign in to comment.