Skip to content

Commit

Permalink
Prepare for release 1.12.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
Iurii Makhno committed Oct 19, 2022
1 parent e809588 commit d01b978
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ https://developer.android.com/studio/command-line/bundletool

## Releases

Latest release: [1.12.0](https://github.com/google/bundletool/releases)
Latest release: [1.12.1](https://github.com/google/bundletool/releases)
5 changes: 5 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ def osName = System.getProperty("os.name").toLowerCase()
compileJava.options.encoding = "UTF-8"
compileTestJava.options.encoding = "UTF-8"

// Compile for Java 8.
if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
compileJava.options.release = 8;
}

test {
if (osName.contains("linux")) {
environment "AAPT2_PATH", "build/resources/main/linux/aapt2"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release_version = 1.12.0
release_version = 1.12.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ public abstract class AndroidManifest {
public static final String ANIMATE_LAYOUT_CHANGES_ATTRIBUTE_NAME = "animateLayoutChanges";
public static final String FITS_SYSTEM_WINDOWS_ATTRIBUTE_NAME = "fitsSystemWindows";
public static final String SRC_ATTRIBUTE_NAME = "src";
public static final String APP_COMPONENT_FACTORY_ATTRIBUTE_NAME = "appComponentFactory";

public static final String LEANBACK_FEATURE_NAME = "android.software.leanback";
public static final String TOUCHSCREEN_FEATURE_NAME = "android.hardware.touchscreen";
Expand Down Expand Up @@ -217,6 +218,7 @@ public abstract class AndroidManifest {
public static final int ANIMATE_LAYOUT_CHANGES_RESOURCE_ID = 0x010102f2;
public static final int FITS_SYSTEM_WINDOWS_RESOURCE_ID = 0x010100dd;
public static final int SRC_RESOURCE_ID = 0x01010119;
public static final int APP_COMPONENT_FACTORY_RESOURCE_ID = 0x0101057a;

// Matches the value of android.os.Build.VERSION_CODES.CUR_DEVELOPMENT, used when turning
// a manifest attribute which references a prerelease API version (e.g., "Q") into an integer.
Expand Down Expand Up @@ -921,6 +923,12 @@ public Optional<String> getCompatSdkProviderClassNameProperty() {
.map(XmlProtoAttribute::getValueAsString);
}

/** Gets the AppComponentFactory class name if it is set in the AndroidManifest. */
public Optional<String> getAppComponentFactoryAttribute() {
return getApplicationAttribute(APP_COMPONENT_FACTORY_RESOURCE_ID)
.map(XmlProtoAttribute::getValueAsString);
}

private Optional<XmlProtoAttribute> getPropertyValue(String attributeName) {
return getApplicationElementChildElements(PROPERTY_ELEMENT_NAME).stream()
.filter(element -> element.getAndroidAttribute(NAME_RESOURCE_ID).isPresent())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public final class BundleToolVersion {

private static final String CURRENT_VERSION = "1.12.0";
private static final String CURRENT_VERSION = "1.12.1";

/** Returns the version of BundleTool being run. */
public static Version getCurrentVersion() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package com.android.tools.build.bundletool.model;

import static com.android.tools.build.bundletool.model.AndroidManifest.APP_COMPONENT_FACTORY_ATTRIBUTE_NAME;
import static com.android.tools.build.bundletool.model.AndroidManifest.APP_COMPONENT_FACTORY_RESOURCE_ID;
import static com.android.tools.build.bundletool.model.AndroidManifest.DEBUGGABLE_RESOURCE_ID;
import static com.android.tools.build.bundletool.model.AndroidManifest.DESCRIPTION_ATTRIBUTE_NAME;
import static com.android.tools.build.bundletool.model.AndroidManifest.DESCRIPTION_RESOURCE_ID;
Expand Down Expand Up @@ -1418,4 +1420,32 @@ public void hasLocaleConfig_present() {

assertThat(androidManifest.hasLocaleConfig()).isTrue();
}

@Test
public void getAppComponentFactoryAttribute_returnsEmpty() {
AndroidManifest androidManifest =
AndroidManifest.create(xmlNode(xmlElement("manifest", xmlNode(xmlElement("application")))));

assertThat(androidManifest.getAppComponentFactoryAttribute()).isEmpty();
}

@Test
public void getAppComponentFactoryAttribute_present() {
AndroidManifest androidManifest =
AndroidManifest.create(
xmlNode(
xmlElement(
"manifest",
xmlNode(
xmlElement(
"application",
xmlAttribute(
ANDROID_NAMESPACE_URI,
APP_COMPONENT_FACTORY_ATTRIBUTE_NAME,
APP_COMPONENT_FACTORY_RESOURCE_ID,
"my.package.customFactory"))))));

assertThat(androidManifest.getAppComponentFactoryAttribute())
.hasValue("my.package.customFactory");
}
}

0 comments on commit d01b978

Please sign in to comment.