Skip to content

Commit

Permalink
workaround for bazelbuild#47
Browse files Browse the repository at this point in the history
  • Loading branch information
nevillelyh committed Nov 23, 2017
1 parent a5e6874 commit f10e14f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

jar -tf bazel-bin/generate_workspace/generate_workspace_deploy.jar
cp bazel-bin/generate_workspace/generate_workspace_deploy.jar transitive_maven_jar
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import static com.google.devtools.build.workspace.maven.ArtifactBuilder.InvalidArtifactCoordinateException;

import com.google.common.annotations.VisibleForTesting;

import java.util.Collections;
import java.util.List;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.resolution.VersionRangeResolutionException;
Expand Down Expand Up @@ -69,9 +71,13 @@ String resolveVersion(String groupId, String artifactId, String versionSpec)
*/
private List<String> requestVersionList(String groupId, String artifactId, String versionSpec)
throws VersionRangeResolutionException, InvalidArtifactCoordinateException {
String transformedSpec = makeVersionRange(versionSpec);
Artifact artifact = ArtifactBuilder.fromCoords(groupId, artifactId, transformedSpec);
return aether.requestVersionRange(artifact);
if (isVersionRange(versionSpec)) {
String transformedSpec = makeVersionRange(versionSpec);
Artifact artifact = ArtifactBuilder.fromCoords(groupId, artifactId, transformedSpec);
return aether.requestVersionRange(artifact);
} else {
return Collections.singletonList(versionSpec);
}
}

/**
Expand Down
Binary file modified transitive_maven_jar/generate_workspace_deploy.jar
Binary file not shown.

0 comments on commit f10e14f

Please sign in to comment.