Skip to content

Commit 1de340a

Browse files
committed
Prepare for release 1.18.1.
1 parent e5819d7 commit 1de340a

File tree

5 files changed

+35
-3
lines changed

5 files changed

+35
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ https://developer.android.com/studio/command-line/bundletool
4646

4747
## Releases
4848

49-
Latest release: [1.18.0](https://github.com/google/bundletool/releases)
49+
Latest release: [1.18.1](https://github.com/google/bundletool/releases)

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
release_version = 1.18.0
1+
release_version = 1.18.1

src/main/java/com/android/tools/build/bundletool/commands/BuildBundleCommand.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import com.android.tools.build.bundletool.model.utils.files.BufferedIo;
4444
import com.android.tools.build.bundletool.model.utils.files.FileUtils;
4545
import com.android.tools.build.bundletool.model.version.BundleToolVersion;
46+
import com.android.tools.build.bundletool.validation.AppBundleValidator;
4647
import com.android.tools.build.bundletool.validation.BundleModulesValidator;
4748
import com.google.auto.value.AutoValue;
4849
import com.google.common.collect.ImmutableList;
@@ -256,6 +257,9 @@ public void execute() {
256257
AppBundle.buildFromModules(
257258
modulesWithTargeting.build(), bundleConfig, getBundleMetadata());
258259

260+
// Validate the bundle content before writing it to disk.
261+
AppBundleValidator.create().validate(appBundle);
262+
259263
Path outputDirectory = getOutputPath().toAbsolutePath().getParent();
260264
if (Files.notExists(outputDirectory)) {
261265
logger.info("Output directory '" + outputDirectory + "' does not exist, creating it.");

src/main/java/com/android/tools/build/bundletool/model/version/BundleToolVersion.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
public final class BundleToolVersion {
2828

29-
private static final String CURRENT_VERSION = "1.18.0";
29+
private static final String CURRENT_VERSION = "1.18.1";
3030

3131

3232
/** Returns the version of BundleTool being run. */

src/test/java/com/android/tools/build/bundletool/commands/BuildBundleCommandTest.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,34 @@ public void assetsTargeting_generated_deviceTier() throws Exception {
518518
}
519519
}
520520

521+
@Test
522+
public void assetsTargeting_invalidDeviceGroupName_throws() throws Exception {
523+
XmlNode manifest = androidManifest(PKG_NAME, withHasCode(true));
524+
Path module =
525+
new ZipBuilder()
526+
.addFileWithContent(ZipPath.create("assets/anything.dat"), "any".getBytes(UTF_8))
527+
.addFileWithContent(
528+
ZipPath.create("assets/texture#tcf_atc/device#group_@$%!/file.dat"),
529+
"any2".getBytes(UTF_8))
530+
.addFileWithContent(ZipPath.create("dex/classes.dex"), "dex".getBytes(UTF_8))
531+
.addFileWithProtoContent(ZipPath.create("manifest/AndroidManifest.xml"), manifest)
532+
.writeTo(tmpDir.resolve("base.zip"));
533+
534+
InvalidBundleException exception =
535+
assertThrows(
536+
InvalidBundleException.class,
537+
() ->
538+
BuildBundleCommand.builder()
539+
.setOutputPath(bundlePath)
540+
.setModulesPaths(ImmutableList.of(module))
541+
.build()
542+
.execute());
543+
544+
assertThat(exception)
545+
.hasMessageThat()
546+
.contains("Device group names should start with a letter");
547+
}
548+
521549
@Test
522550
public void assetsTargeting_generated_deviceGroup() throws Exception {
523551
XmlNode manifest = androidManifest(PKG_NAME, withHasCode(true));

0 commit comments

Comments
 (0)