aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java
diff options
context:
space:
mode:
authorGravatar Googler <noreply@google.com>2017-03-29 22:59:45 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2017-03-31 17:06:51 +0200
commit6e35832df1fbafcde5812f013d0b3cecc8d6c6ec (patch)
tree7475fb5863ab095c2d434abf9262424380b56a70 /src/test/java
parent9ec917f10533c4cc68aacda4ca77ebeaec7bfa90 (diff)
Partial rollback of commit 5e1a420f1b385382a2df5359faf3ae773aa8d61e.
*** Reason for rollback *** Breaks tests that expected previous id generation order. RELNOTES: None. PiperOrigin-RevId: 151638886
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/com/google/devtools/build/lib/rules/android/AndroidLibraryTest.java77
1 files changed, 27 insertions, 50 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/rules/android/AndroidLibraryTest.java b/src/test/java/com/google/devtools/build/lib/rules/android/AndroidLibraryTest.java
index 8bba37d7d1..52cd935e2e 100644
--- a/src/test/java/com/google/devtools/build/lib/rules/android/AndroidLibraryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/rules/android/AndroidLibraryTest.java
@@ -718,10 +718,8 @@ public class AndroidLibraryTest extends AndroidBuildViewTestCase {
"<resources><string name = 'hello'>Hello Android!</string></resources>");
ConfiguredTarget resource = getConfiguredTarget("//c/b/m/a:r");
- List<String> args =
- getGeneratingSpawnAction(
- getImplicitOutputArtifact(resource, AndroidRuleClasses.ANDROID_RESOURCES_ZIP))
- .getArguments();
+ List<String> args = ((SpawnAction) getGeneratingAction(getResourceArtifact(resource)))
+ .getArguments();
assertPrimaryResourceDirs(resource, ImmutableList.of("c/b/m/a/b_/res"), args);
}
@@ -736,10 +734,8 @@ public class AndroidLibraryTest extends AndroidBuildViewTestCase {
"<resources><string name = 'hello'>Hello Android!</string></resources>");
ConfiguredTarget resource = getConfiguredTarget("//java/android:r");
- List<String> args =
- getGeneratingSpawnAction(
- getImplicitOutputArtifact(resource, AndroidRuleClasses.ANDROID_RESOURCES_ZIP))
- .getArguments();
+ List<String> args = ((SpawnAction) getGeneratingAction(getResourceArtifact(resource)))
+ .getArguments();
assertPrimaryResourceDirs(resource, ImmutableList.of("java/android/res"), args);
}
@@ -756,10 +752,8 @@ public class AndroidLibraryTest extends AndroidBuildViewTestCase {
"<resources><string name = 'hello'>Hello Android!</string></resources>");
ConfiguredTarget resource = getConfiguredTarget("//java/android:r");
- List<String> args =
- getGeneratingSpawnAction(
- getImplicitOutputArtifact(resource, AndroidRuleClasses.ANDROID_RESOURCES_ZIP))
- .getArguments();
+ List<String> args = ((SpawnAction) getGeneratingAction(getResourceArtifact(resource)))
+ .getArguments();
assertPrimaryResourceDirs(resource, ImmutableList.of("java/android/res"), args);
}
@@ -774,10 +768,8 @@ public class AndroidLibraryTest extends AndroidBuildViewTestCase {
"exports_files(['res/values/strings.xml'])");
ConfiguredTarget resource = getConfiguredTarget("//java/android:r");
- List<String> args =
- getGeneratingSpawnAction(
- getImplicitOutputArtifact(resource, AndroidRuleClasses.ANDROID_RESOURCES_ZIP))
- .getArguments();
+ List<String> args = ((SpawnAction) getGeneratingAction(getResourceArtifact(resource)))
+ .getArguments();
assertPrimaryResourceDirs(resource, ImmutableList.of("java/other/res"), args);
assertNoEvents();
}
@@ -795,10 +787,8 @@ public class AndroidLibraryTest extends AndroidBuildViewTestCase {
")");
ConfiguredTarget resource = getConfiguredTarget("//java/android:r");
- List<String> args =
- getGeneratingSpawnAction(
- getImplicitOutputArtifact(resource, AndroidRuleClasses.ANDROID_RESOURCES_ZIP))
- .getArguments();
+ List<String> args = ((SpawnAction) getGeneratingAction(getResourceArtifact(resource)))
+ .getArguments();
assertPrimaryResourceDirs(resource, ImmutableList.of("java/other/res"), args);
assertNoEvents();
}
@@ -817,10 +807,8 @@ public class AndroidLibraryTest extends AndroidBuildViewTestCase {
"exports_files(['res/values/strings.xml'])");
ConfiguredTarget resource = getConfiguredTarget("//java/android:r");
- List<String> args =
- getGeneratingSpawnAction(
- getImplicitOutputArtifact(resource, AndroidRuleClasses.ANDROID_RESOURCES_ZIP))
- .getArguments();
+ List<String> args = ((SpawnAction) getGeneratingAction(getResourceArtifact(resource)))
+ .getArguments();
assertPrimaryResourceDirs(resource, ImmutableList.of("java/other/res"), args);
assertNoEvents();
}
@@ -841,10 +829,8 @@ public class AndroidLibraryTest extends AndroidBuildViewTestCase {
")");
ConfiguredTarget resource = getConfiguredTarget("//java/android:r");
- List<String> args =
- getGeneratingSpawnAction(
- getImplicitOutputArtifact(resource, AndroidRuleClasses.ANDROID_RESOURCES_ZIP))
- .getArguments();
+ List<String> args = ((SpawnAction) getGeneratingAction(getResourceArtifact(resource)))
+ .getArguments();
assertPrimaryResourceDirs(resource, ImmutableList.of("java/other/res"), args);
assertNoEvents();
}
@@ -1086,27 +1072,22 @@ public class AndroidLibraryTest extends AndroidBuildViewTestCase {
target.getProvider(AndroidResourcesProvider.class).getDirectAndroidResources());
SpawnAction resourceParserAction =
- getGeneratingSpawnAction(
- getImplicitOutputArtifact(target, AndroidRuleClasses.ANDROID_MERGED_SYMBOLS));
-
- SpawnAction mergeAction =
- getGeneratingSpawnAction(
- getImplicitOutputArtifact(target, AndroidRuleClasses.ANDROID_RESOURCES_ZIP));
-
+ (SpawnAction)
+ actionsTestUtil()
+ .getActionForArtifactEndingWith(artifacts,
+ "/" + resources.getSymbols().getFilename());
SpawnAction resourceClassJarAction =
(SpawnAction)
actionsTestUtil()
- .getActionForArtifactEndingWith(
- artifacts, "/" + resources.getJavaClassJar().getFilename());
-
+ .getActionForArtifactEndingWith(artifacts,
+ "/" + resources.getJavaClassJar().getFilename());
SpawnAction resourceSrcJarAction =
(SpawnAction)
actionsTestUtil()
- .getActionForArtifactEndingWith(
- artifacts, "/" + resources.getJavaSourceJar().getFilename());
+ .getActionForArtifactEndingWith(artifacts,
+ "/" + resources.getJavaSourceJar().getFilename());
assertThat(resourceParserAction.getMnemonic()).isEqualTo("AndroidResourceParser");
- assertThat(mergeAction.getMnemonic()).isEqualTo("AndroidResourceMerger");
- assertThat(resourceClassJarAction.getMnemonic()).isEqualTo("LibraryRClassGenerator");
+ assertThat(resourceClassJarAction.getMnemonic()).isEqualTo("AndroidResourceMerger");
assertThat(resourceSrcJarAction.getMnemonic()).isEqualTo("AndroidResourceValidator");
// Validator also generates an R.txt.
assertThat(resourceSrcJarAction.getOutputs()).contains(resources.getRTxt());
@@ -1376,10 +1357,8 @@ public class AndroidLibraryTest extends AndroidBuildViewTestCase {
" resource_files = ['d2-res/values/strings.xml'],",
" )");
ConfiguredTarget resource = getConfiguredTarget("//java/android/resources/d1:d1");
- List<String> args =
- getGeneratingSpawnAction(
- getImplicitOutputArtifact(resource, AndroidRuleClasses.ANDROID_RESOURCES_ZIP))
- .getArguments();
+ List<String> args = ((SpawnAction) getGeneratingAction(getResourceArtifact(resource)))
+ .getArguments();
assertPrimaryResourceDirs(resource, ImmutableList.of("java/android/resources/d1/d1-res"), args);
Truth.assertThat(getDirectDependentResourceDirs(resource, args))
.contains("java/android/resources/d2/d2-res");
@@ -1416,10 +1395,8 @@ public class AndroidLibraryTest extends AndroidBuildViewTestCase {
" )");
ConfiguredTarget resource = getConfiguredTarget("//java/android/resources/d1:d1");
- List<String> args =
- getGeneratingSpawnAction(
- getImplicitOutputArtifact(resource, AndroidRuleClasses.ANDROID_RESOURCES_ZIP))
- .getArguments();
+ List<String> args = ((SpawnAction) getGeneratingAction(getResourceArtifact(resource)))
+ .getArguments();
assertPrimaryResourceDirs(
resource, ImmutableList.of("java/android/resources/d1/d1-res"), args);
Truth.assertThat(getDirectDependentResourceDirs(resource, args))