use of com.facebook.buck.rules.RuleKey in project buck by facebook.
the class AaptPackageResourcesTest method testThatChangingAndroidManifestChangesRuleKey.
@Test
public void testThatChangingAndroidManifestChangesRuleKey() {
// Generate a rule key for the defaults.
AaptConstructorArgs args = new AaptConstructorArgs();
args.manifest = createPathSourcePath("AndroidManifest.xml", "same_content");
RuleKey previousRuleKey = calculateRuleKey(args);
args.manifest = createPathSourcePath("other/AndroidManifest.xml", "same_content");
previousRuleKey = assertKeyChanged(previousRuleKey, args);
args.manifest = createPathSourcePath("other/AndroidManifest.xml", "different_content");
previousRuleKey = assertKeyChanged(previousRuleKey, args);
}
use of com.facebook.buck.rules.RuleKey in project buck by facebook.
the class AaptPackageResourcesTest method testThatChangingResourceDirectoryOrderChangesRulekey.
@Test
public void testThatChangingResourceDirectoryOrderChangesRulekey() {
// Generate a rule key for the defaults.
AaptConstructorArgs args = new AaptConstructorArgs();
RuleKey previousRuleKey = calculateRuleKey(args);
args.hasAndroidResourceDeps = ImmutableList.of(resource1, resource2);
args.filteredResourcesProvider = new IdentityResourcesProvider(ImmutableList.of(Paths.get("res1"), Paths.get("res2")));
previousRuleKey = assertKeyChanged(previousRuleKey, args);
args.hasAndroidResourceDeps = ImmutableList.of(resource1, resource2);
args.filteredResourcesProvider = new IdentityResourcesProvider(ImmutableList.of(Paths.get("res2"), Paths.get("res1")));
// TODO(cjhopman): AaptPackageResources' rulekey doesn't properly reflect changes in the
// ordering of resource-only dependencies.
// previousRuleKey = assertKeyChanged(previousRuleKey, args);
}
use of com.facebook.buck.rules.RuleKey in project buck by facebook.
the class AaptPackageResourcesTest method testThatChangingResourcesChangesRuleKey.
@Test
public void testThatChangingResourcesChangesRuleKey() {
// Generate a rule key for the defaults.
AaptConstructorArgs args = new AaptConstructorArgs();
RuleKey previousRuleKey = calculateRuleKey(args);
args.hasAndroidResourceDeps = ImmutableList.of(resource1);
previousRuleKey = assertKeyChanged(previousRuleKey, args);
createPathSourcePath("res1", "different_value");
previousRuleKey = assertKeyChanged(previousRuleKey, args);
}
use of com.facebook.buck.rules.RuleKey in project buck by facebook.
the class AaptPackageResourcesTest method testThatChangingManifestEntriesChangesRuleKey.
@Test
public void testThatChangingManifestEntriesChangesRuleKey() {
// Generate a rule key for the defaults.
AaptConstructorArgs args = new AaptConstructorArgs();
args.manifestEntries = ManifestEntries.builder().setDebugMode(false).build();
RuleKey previousRuleKey = calculateRuleKey(args);
args.manifestEntries = ManifestEntries.builder().setDebugMode(true).build();
previousRuleKey = assertKeyChanged(previousRuleKey, args);
}
use of com.facebook.buck.rules.RuleKey in project buck by facebook.
the class AaptPackageResourcesTest method testThatChangingAssetsChangesRuleKey.
@Test
public void testThatChangingAssetsChangesRuleKey() {
// Generate a rule key for the defaults.
AaptConstructorArgs args = new AaptConstructorArgs();
RuleKey previousRuleKey = calculateRuleKey(args);
args.hasAndroidResourceDeps = ImmutableList.of(resource1);
args.assetsDirectories = ImmutableSet.of(resource1.getAssets(), justAssets.getAssets());
// AndroidBinaryGraphEnhancer directly adds resource deps that have assets and no resources to
// extraDeps.
args.extraDeps = ImmutableSortedSet.of(justAssets);
previousRuleKey = assertKeyChanged(previousRuleKey, args);
createPathSourcePath("asset1", "different_value");
previousRuleKey = assertKeyChanged(previousRuleKey, args);
createPathSourcePath("justAssets", "different_value");
previousRuleKey = assertKeyChanged(previousRuleKey, args);
}
Aggregations