diff options
author | 2016-06-22 15:36:36 +0000 | |
---|---|---|
committer | 2016-06-23 11:03:26 +0000 | |
commit | 0861282d10265201ac3c307668ac553e597d14a8 (patch) | |
tree | 1609fcd9a6bca38b0f25a853df09bd9d72a366ac | |
parent | dba6223afff671df63901814c7424dc7a7243004 (diff) |
Remove application_id, version_code and version_name attributes from android_binary rule. They have been replaced by manifest_values.
--
MOS_MIGRATED_REVID=125568465
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java | 15 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinaryOnlyRule.java | 34 |
2 files changed, 3 insertions, 46 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java index b074379bc3..500c60165d 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinary.java @@ -14,7 +14,6 @@ package com.google.devtools.build.lib.rules.android; import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Strings.isNullOrEmpty; import static com.google.devtools.build.lib.analysis.OutputGroupProvider.INTERNAL_SUFFIX; import com.google.common.base.Function; @@ -192,9 +191,9 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { LocalResourceContainer.validateRuleContext(ruleContext); ApplicationManifest ruleManifest = androidSemantics.getManifestForRule(ruleContext); - String applicationId = ruleContext.attributes().get("application_id", Type.STRING); - String versionCode = getExpandedMakeVarsForAttr(ruleContext, "version_code"); - String versionName = getExpandedMakeVarsForAttr(ruleContext, "version_name"); + String applicationId = null; + String versionCode = null; + String versionName = null; Map<String, String> manifestValues = ruleContext.attributes().get("manifest_values", Type.STRING_DICT); if (manifestValues != null) { @@ -904,14 +903,6 @@ public abstract class AndroidBinary implements RuleConfiguredTargetFactory { return deployJar; } - private static String getExpandedMakeVarsForAttr(RuleContext context, String attr) { - final String value = context.attributes().get(attr, Type.STRING); - if (isNullOrEmpty(value)) { - return null; - } - return context.expandMakeVariables(attr, value); - } - private static JavaOptimizationMode getJavaOptimizationMode(RuleContext ruleContext) { return ruleContext.getConfiguration().getFragment(JavaConfiguration.class) .getJavaOptimizationMode(); diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinaryOnlyRule.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinaryOnlyRule.java index c1c812d0de..a558b05664 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinaryOnlyRule.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidBinaryOnlyRule.java @@ -35,40 +35,6 @@ public final class AndroidBinaryOnlyRule implements RuleDefinition { @Override public RuleClass build(RuleClass.Builder builder, final RuleDefinitionEnvironment env) { return builder -// /* <!-- #BLAZE_RULE(android_binary).ATTRIBUTE(application_id) --> -// A full Java-language-style package name for the application. The name should be unique. -// The name may contain uppercase or lowercase letters ('A' through 'Z'), numbers, and -// underscores ('_'). However, individual package name parts may only start with letters. -// The package name serves as a unique identifier for the application. It's also the default -// name for the application process (see the <application> element's process attribute) -// and the default task affinity of an activity. -// -// This overrides the value declared in the manifest. -// <!-- #END_BLAZE_RULE.ATTRIBUTE --> */ - .add(attr("application_id", STRING).undocumented("not ready for production use")) -// /* <!-- #BLAZE_RULE(android_binary).ATTRIBUTE(version_code) --> -// An internal version number. This number is used only to determine whether one version is -// more recent than another, with higher numbers indicating more recent versions. This is not -// the version number shown to users; that number is set by the version_name attribute. -// The value must be set as an integer, such as "100". Each successive version must have a -// higher number. -// This overrides the value declared in the manifest. -// -// Subject to <a href="${link make-variables}">"Make" variable</a> substitution. -// Suggested practice is to declare a varrdef and reference it here so that a particular build -// invocation will be used to generate apks for release. -// <!-- #END_BLAZE_RULE.ATTRIBUTE --> */ - .add(attr("version_code", STRING).undocumented("not ready for production use")) -// /* <!-- #BLAZE_RULE(android_binary).ATTRIBUTE(version_name) --> -// The version number shown to users. The string has no other purpose than to be displayed to -// users. The version_code attribute holds the significant version number used internally. -// This overrides the value declared in the manifest. -// -// Subject to <a href="${link make-variables}">"Make" variable</a> substitution. -// Suggested practice is to declare a varrdef and reference it here so that a particular build -// invocation will be used to generate apks for release. -// <!-- #END_BLAZE_RULE.ATTRIBUTE --> */ - .add(attr("version_name", STRING).undocumented("not ready for production use")) // /* <!-- #BLAZE_RULE(android_binary).ATTRIBUTE(manifest_values) --> // A dictionary of values to be overridden in the manifest. Any instance of ${name} in the // manifest will be replaced with the value corresponding to name in this dictionary. |