From e3bbfdb839a483f1a418a94d857c25794006fbe0 Mon Sep 17 00:00:00 2001 From: dannark Date: Sat, 10 Feb 2018 21:54:35 -0800 Subject: Add custom_package attribute to android_local_test. android_local_test generates and R.class file and so this is necessary for projects that don't nest their BUILD files under a java/ or javatests/ root. Fixes #4618 RELNOTES: None PiperOrigin-RevId: 185281836 --- .../devtools/build/lib/rules/android/AndroidLocalTestBaseRule.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/com') diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLocalTestBaseRule.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLocalTestBaseRule.java index 0ef779b4f2..3d758f1fa9 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLocalTestBaseRule.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidLocalTestBaseRule.java @@ -129,6 +129,12 @@ public class AndroidLocalTestBaseRule implements RuleDefinition { the libraries under test have a minSdkVersion tag in them. */ .add(attr("manifest", LABEL).allowedFileTypes(FileTypeSet.ANY_FILE)) + /* + Java package in which the R class will be generated. By default the package is inferred + from the directory where the BUILD file containing the rule is. If you use this attribute, + you will likely need to use test_class as well. + */ + .add(attr("custom_package", STRING)) .add( attr("resource_files", LABEL_LIST) .allowedFileTypes(FileTypeSet.ANY_FILE) -- cgit v1.2.3