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/rules/android | |
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/rules/android')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java | 55 |
1 files changed, 15 insertions, 40 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java index 0cd44ad59d..7028a45eca 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java @@ -13,7 +13,6 @@ // limitations under the License. package com.google.devtools.build.lib.rules.android; -import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableCollection; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; @@ -40,29 +39,11 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider { @Immutable public static class SourceDirectory { final PathFragment relativePath; - final PathFragment rootExecutionPathFragment; final PathFragment rootPath; final boolean isSource; - @VisibleForTesting - public static SourceDirectory fromSourceRoot( - PathFragment rootPath, - PathFragment relativePath) { - return new SourceDirectory(rootPath, PathFragment.EMPTY_FRAGMENT, relativePath, true); - } - - public static SourceDirectory fromRoot(Root root, PathFragment relativePath) { - return new SourceDirectory( - root.getPath().asFragment(), root.getExecPath(), relativePath, root.isSourceRoot()); - } - - private SourceDirectory( - PathFragment rootPath, - PathFragment rootExecutionPathFragment, - PathFragment relativePath, - boolean isSource) { + public SourceDirectory(PathFragment rootPath, PathFragment relativePath, boolean isSource) { this.rootPath = rootPath; - this.rootExecutionPathFragment = rootExecutionPathFragment; this.relativePath = relativePath; this.isSource = isSource; } @@ -81,14 +62,6 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider { return rootPath; } - /** - * The path from the execution root to the actual root. For source roots, this returns - * the empty fragment, {@link Root#getExecPath()}. - */ - public PathFragment getRootExecutionPathFragment() { - return rootExecutionPathFragment; - } - /** Indicates if the directory is in the gen files tree. */ public boolean isSource() { return isSource; @@ -96,7 +69,7 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider { @Override public int hashCode() { - return Objects.hash(relativePath, rootPath, rootExecutionPathFragment, isSource); + return Objects.hash(relativePath, rootPath, isSource); } @Override @@ -104,7 +77,6 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider { if (other instanceof SourceDirectory) { SourceDirectory otherDir = (SourceDirectory) other; return Objects.equals(rootPath, otherDir.rootPath) - && Objects.equals(rootExecutionPathFragment, otherDir.rootExecutionPathFragment) && Objects.equals(relativePath, otherDir.relativePath) && Objects.equals(isSource, otherDir.isSource); } @@ -114,7 +86,7 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider { @Override public String toString() { return "SourceDirectory [relativePath=" + relativePath + ", rootPath=" + rootPath - + ", executionRootPrefix=" + rootExecutionPathFragment + ", isSource=" + isSource + "]"; + + ", isSource=" + isSource + "]"; } } @@ -207,9 +179,10 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider { private void addIdlDirs(Collection<Artifact> idlArtifacts) { for (Artifact idl : idlArtifacts) { this.idlDirs.add( - SourceDirectory.fromRoot( - idl.getRoot(), - idl.getRootRelativePath().getParentDirectory())); + new SourceDirectory( + idl.getRoot().getPath().asFragment(), + idl.getRootRelativePath().getParentDirectory(), + idl.isSourceArtifact())); } } @@ -226,9 +199,10 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider { public Builder addResourceSource(Artifact resource) { PathFragment resourceDir = LocalResourceContainer.Builder.findResourceDir(resource); resourceDirs.add( - SourceDirectory.fromRoot( - resource.getRoot(), - trimTo(resource.getRootRelativePath(), resourceDir))); + new SourceDirectory( + resource.getRoot().getPath().asFragment(), + trimTo(resource.getRootRelativePath(), resourceDir), + resource.isSourceArtifact())); return this; } @@ -248,9 +222,10 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider { public Builder addAssetSource(Artifact asset, PathFragment assetDir) { assetDirs.add( - SourceDirectory.fromRoot( - asset.getRoot(), - trimTo(asset.getRootRelativePath(), assetDir))); + new SourceDirectory( + asset.getRoot().getPath().asFragment(), + trimTo(asset.getRootRelativePath(), assetDir), + asset.isSourceArtifact())); return this; } |