From a4ba24e286b7e9a7a09e333d8eb64a8cf7e81895 Mon Sep 17 00:00:00 2001 From: Damien Martin-Guillerez Date: Mon, 15 Feb 2016 12:27:10 +0000 Subject: 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 --- .../lib/ideinfo/AndroidStudioInfoAspectTest.java | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'src/test/java/com/google/devtools/build/lib/ideinfo') diff --git a/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java b/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java index 22416fc896..6810d5d50d 100644 --- a/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java +++ b/src/test/java/com/google/devtools/build/lib/ideinfo/AndroidStudioInfoAspectTest.java @@ -43,7 +43,6 @@ import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.StandardCharsets; -import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -70,10 +69,6 @@ public class AndroidStudioInfoAspectTest extends AndroidStudioInfoAspectTestBase "//com/google/example:simple", ruleIdeInfos); if (isNativeTest()) { assertThat(ruleIdeInfo.getBuildFile()).isEqualTo(buildFilePath.toString()); - ArtifactLocation location = ruleIdeInfo.getBuildFileArtifactLocation(); - assertThat(Paths.get(location.getRootPath(), location.getRelativePath()).toString()) - .isEqualTo(buildFilePath.toString()); - assertThat(location.getRelativePath()).isEqualTo("com/google/example/BUILD"); } assertThat(ruleIdeInfo.getKind()).isEqualTo(Kind.JAVA_LIBRARY); assertThat(ruleIdeInfo.getDependenciesCount()).isEqualTo(0); @@ -912,21 +907,26 @@ public class AndroidStudioInfoAspectTest extends AndroidStudioInfoAspectTestBase ")"); Map ruleIdeInfos = buildRuleIdeInfo("//com/google/example:lib"); RuleIdeInfo ruleIdeInfo = getRuleInfoAndVerifyLabel("//com/google/example:lib", ruleIdeInfos); - // todo(dslomov): Skylark aspect implementation does not yet return a correct root path. - assertThat(ruleIdeInfo.getJavaRuleIdeInfo().getSourcesList()).containsExactly( - ArtifactLocation.newBuilder() - .setRootPath( - isNativeTest() ? targetConfig.getGenfilesDirectory().getPath().getPathString() : "") - .setRootExecutionPathFragment( - isNativeTest() ? targetConfig.getGenfilesDirectory().getExecPathString() : "") - .setRelativePath("com/google/example/gen.java") - .setIsSource(false) - .build(), - ArtifactLocation.newBuilder() - .setRootPath(isNativeTest() ? directories.getWorkspace().getPathString() : "") - .setRelativePath("com/google/example/Test.java") - .setIsSource(true) - .build()); + assertThat(ruleIdeInfo.getJavaRuleIdeInfo().getSourcesList()) + .containsExactly( + expectedArtifactLocationWithRootPath( + targetConfig.getGenfilesDirectory().getPath().getPathString()) + .setRelativePath("com/google/example/gen.java") + .setIsSource(false) + .build(), + expectedArtifactLocationWithRootPath(directories.getWorkspace().getPathString()) + .setRelativePath("com/google/example/Test.java") + .setIsSource(true) + .build()); + } + + private ArtifactLocation.Builder expectedArtifactLocationWithRootPath(String pathString) { + if (isNativeTest()) { + return ArtifactLocation.newBuilder().setRootPath(pathString); + } else { + // todo(dslomov): Skylark aspect implementation does not yet return a correct root path. + return ArtifactLocation.newBuilder(); + } } @Test -- cgit v1.2.3