Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore OS as an input to GenerateProtoTask #556

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,26 @@ public abstract class GenerateProtoTask extends DefaultTask {
@InputFiles
@PathSensitive(PathSensitivity.NONE)
ConfigurableFileCollection getAlternativePaths() {
return objectFactory.fileCollection().from(getLocatorToAlternativePathsMapping().get().values())
objectFactory.fileCollection().from(locatorToAlternativePathsMapping.map {
if (protocArtifactGav.map { !it.endsWith("-SNAPSHOT") }.getOrElse(false)) {
it.findAll { it.key != protocLocator.get().name }
} else {
it
}}.get().values())
}

@Input
@Optional
Provider<String> getProtocArtifactGav() {
// Avoiding Provider#map to support Gradle < 6.2 since artifact can be null
// See https://github.com/gradle/gradle/issues/11979
providerFactory.provider {
def protocArtifact = protocLocator.get().artifact
if (protocArtifact) {
def (group, artifact, version) = ToolsLocator.artifactParts(protocArtifact)
"$group:$artifact:$version"
}
} as Provider<String>
}

@Internal("Input captured by getAlternativePaths()")
Expand Down