diff options
author | Damien Martin-Guillerez <dmarting@google.com> | 2016-02-15 12:27:10 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-02-15 13:44:34 +0000 |
commit | a4ba24e286b7e9a7a09e333d8eb64a8cf7e81895 (patch) | |
tree | ac7c5f441a15efd3b6dfacae3c5406f95fc10ab4 /src/main/java/com/google/devtools/build/lib/ideinfo | |
parent | def8ce373cef2c50b8b5be43aea6f56a5a5ba2e1 (diff) |
Rollback of commit 500175fcfb37953f50cf0869df164902755807f2.
*** Reason for rollback ***
Breaks Bazel Build
http://ci.bazel.io/job/Bazel/JAVA_VERSION=1.7,PLATFORM_NAME=linux-x86_64/356/console
*** Original change description ***
Don't include absolute paths in blaze IDE artifacts
RELNOTES: Don't include absolute paths in blaze IDE artifacts
--
MOS_MIGRATED_REVID=114682419
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/ideinfo')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspect.java | 46 |
1 files changed, 5 insertions, 41 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspect.java b/src/main/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspect.java index 472bef60f9..f6d4856374 100644 --- a/src/main/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspect.java +++ b/src/main/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspect.java @@ -20,10 +20,8 @@ import static com.google.devtools.build.lib.packages.Attribute.attr; import static com.google.devtools.build.lib.packages.BuildType.LABEL; import com.google.common.base.Function; -import com.google.common.base.Joiner; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.io.ByteSource; import com.google.devtools.build.lib.Constants; @@ -58,7 +56,6 @@ import com.google.devtools.build.lib.ideinfo.androidstudio.AndroidStudioIdeInfo. import com.google.devtools.build.lib.packages.AspectDefinition; import com.google.devtools.build.lib.packages.AspectParameters; import com.google.devtools.build.lib.packages.BuildType; -import com.google.devtools.build.lib.packages.Package; import com.google.devtools.build.lib.packages.Rule; import com.google.devtools.build.lib.rules.android.AndroidCommon; import com.google.devtools.build.lib.rules.android.AndroidIdeInfoProvider; @@ -306,9 +303,6 @@ public class AndroidStudioInfoAspect implements ConfiguredNativeAspectFactory { .getPath() .toString()); - outputBuilder.setBuildFileArtifactLocation( - makeArtifactLocation(ruleContext.getRule().getPackage())); - outputBuilder.setKind(ruleKind); if (ruleKind == Kind.JAVA_LIBRARY @@ -379,7 +373,8 @@ public class AndroidStudioInfoAspect implements ConfiguredNativeAspectFactory { .setExecutable(ruleContext.getExecutablePrerequisite("$packageParser", Mode.HOST)) .setCommandLine(CustomCommandLine.builder() .addExecPath("--output_manifest", packageManifest) - .addJoinStrings("--sources", ":", toSerializedArtifactLocations(sourceFiles)) + .addJoinStrings("--sources_absolute_paths", ":", Artifact.toAbsolutePaths(sourceFiles)) + .addJoinExecPaths("--sources_execution_paths", ":", sourceFiles) .build()) .useParameterFile(ParameterFileType.SHELL_QUOTED) .setProgressMessage("Parsing java package strings for " + ruleContext.getRule()) @@ -387,25 +382,6 @@ public class AndroidStudioInfoAspect implements ConfiguredNativeAspectFactory { .build(ruleContext); } - private static Iterable<String> toSerializedArtifactLocations(Iterable<Artifact> artifacts) { - return Iterables.transform( - Iterables.filter(artifacts, Artifact.MIDDLEMAN_FILTER), - PACKAGE_PARSER_SERIALIZER); - } - - private static final Function<Artifact, String> PACKAGE_PARSER_SERIALIZER = - new Function<Artifact, String>() { - @Override - public String apply(Artifact artifact) { - ArtifactLocation location = makeArtifactLocation(artifact); - return Joiner.on(",").join( - location.getRootExecutionPathFragment(), - location.getRelativePath(), - location.getRootPath() - ); - } - }; - private static Artifact derivedArtifact(ConfiguredTarget base, RuleContext ruleContext, String suffix) { BuildConfiguration configuration = ruleContext.getConfiguration(); @@ -495,28 +471,16 @@ public class AndroidStudioInfoAspect implements ConfiguredNativeAspectFactory { } private static ArtifactLocation makeArtifactLocation(Artifact artifact) { - return makeArtifactLocation(artifact.getRoot(), artifact.getRootRelativePath()); - } - - private static ArtifactLocation makeArtifactLocation(Package pkg) { - Root root = Root.asSourceRoot(pkg.getSourceRoot()); - PathFragment relativePath = pkg.getBuildFile().getPath().relativeTo(root.getPath()); - return makeArtifactLocation(root, relativePath); - } - - private static ArtifactLocation makeArtifactLocation(Root root, PathFragment relativePath) { return ArtifactLocation.newBuilder() - .setRootPath(root.getPath().toString()) - .setRootExecutionPathFragment(root.getExecPath().toString()) - .setRelativePath(relativePath.toString()) - .setIsSource(root.isSourceRoot()) + .setRootPath(artifact.getRoot().getPath().toString()) + .setRelativePath(artifact.getRootRelativePathString()) + .setIsSource(artifact.isSourceArtifact()) .build(); } private static ArtifactLocation makeArtifactLocation(SourceDirectory resourceDir) { return ArtifactLocation.newBuilder() .setRootPath(resourceDir.getRootPath().toString()) - .setRootExecutionPathFragment(resourceDir.getRootExecutionPathFragment().toString()) .setRelativePath(resourceDir.getRelativePath().toString()) .setIsSource(resourceDir.isSource()) .build(); |