Skip to content

Commit

Permalink
Prepare for release 1.6.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Iurii Makhno committed Apr 28, 2021
1 parent 06296d8 commit 950c8d6
Show file tree
Hide file tree
Showing 103 changed files with 4,225 additions and 446 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ https://developer.android.com/studio/command-line/bundletool

## Releases

Latest release: [1.5.0](https://github.com/google/bundletool/releases)
Latest release: [1.6.0](https://github.com/google/bundletool/releases)
23 changes: 14 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
Expand All @@ -19,7 +19,7 @@ apply plugin: "java"
apply plugin: "maven"

repositories {
jcenter()
mavenCentral()
google()
}

Expand All @@ -31,19 +31,20 @@ configurations {

// The repackaging rules are defined in the "shadowJar" task below.
dependencies {
compile "com.android.tools:common:30.0.0-alpha10"
compile "com.android.tools:r8:2.1.66"
compile "com.android.tools.build:apkzlib:4.2.0-alpha13"
compile "com.android.tools.build:apksig:4.2.0-alpha13"
compile "com.android.tools.ddms:ddmlib:26.2.0"
compile "com.android.tools.ddms:ddmlib:30.0.0-alpha10"
compile "com.android:zipflinger:4.2.0-alpha11"

shadow "com.android.tools.build:aapt2-proto:4.1.0-alpha01-6193524"
shadow "com.google.auto.value:auto-value-annotations:1.6.2"
annotationProcessor "com.google.auto.value:auto-value:1.6.2"
shadow "com.google.errorprone:error_prone_annotations:2.3.1"
shadow "com.google.guava:guava:27.0.1-jre"
shadow "com.google.protobuf:protobuf-java:3.4.0"
shadow "com.google.protobuf:protobuf-java-util:3.4.0"
shadow "com.google.guava:guava:30.1-jre"
shadow "com.google.protobuf:protobuf-java:3.10.0"
shadow "com.google.protobuf:protobuf-java-util:3.10.0"
shadow "com.google.dagger:dagger:2.28.3"
annotationProcessor "com.google.dagger:dagger-compiler:2.28.3"
shadow "javax.inject:javax.inject:1"
Expand All @@ -56,12 +57,12 @@ dependencies {
testCompile "com.google.auto.value:auto-value-annotations:1.6.2"
testAnnotationProcessor "com.google.auto.value:auto-value:1.6.2"
testCompile "com.google.errorprone:error_prone_annotations:2.3.1"
testCompile "com.google.guava:guava:27.0.1-jre"
testCompile "com.google.guava:guava:30.1-jre"
testCompile "com.google.truth.extensions:truth-java8-extension:0.45"
testCompile "com.google.truth.extensions:truth-proto-extension:0.45"
testCompile "com.google.jimfs:jimfs:1.1"
testCompile "com.google.protobuf:protobuf-java:3.4.0"
testCompile "com.google.protobuf:protobuf-java-util:3.4.0"
testCompile "com.google.protobuf:protobuf-java:3.10.0"
testCompile "com.google.protobuf:protobuf-java-util:3.10.0"
testCompile "org.mockito:mockito-core:2.18.3"
testCompile "junit:junit:4.12"
testCompile "org.junit.jupiter:junit-jupiter-api:5.2.0"
Expand Down Expand Up @@ -160,6 +161,10 @@ shadowJar {
exclude 'com.android.vending.splits.required'
exclude 'com.android.dynamic.apk.fused.modules'
}

// Exclude ddmlib protos from maven jar
exclude 'app_processes.proto'
exclude 'instrumentation-data.proto'
}

// Artifact to use as standalone command line tool.
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.5.0
release_version = 1.6.0
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.android.tools.build.bundletool;

import com.android.tools.build.bundletool.commands.AddTransparencyCommand;
import com.android.tools.build.bundletool.commands.BuildApksCommand;
import com.android.tools.build.bundletool.commands.BuildBundleCommand;
import com.android.tools.build.bundletool.commands.CommandHelp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License
*/

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

import com.android.tools.build.bundletool.model.CommandExecutor.CommandOptions;
import com.android.tools.build.bundletool.androidtools.CommandExecutor.CommandOptions;
import com.google.common.collect.ImmutableList;
import java.nio.file.Path;
import java.time.Duration;
Expand All @@ -26,6 +26,8 @@ public interface Aapt2Command {

void convertApkProtoToBinary(Path protoApk, Path binaryApk);

void optimizeToSparseResourceTables(Path originalApk, Path outputApk);

/** Dumps the badging information of an .apk/.apex file, returning a String per line of out. */
default ImmutableList<String> dumpBadging(Path apkPath) {
throw new UnsupportedOperationException("Not implemented");
Expand All @@ -37,17 +39,33 @@ static Aapt2Command createFromExecutablePath(Path aapt2Path) {

@Override
public void convertApkProtoToBinary(Path protoApk, Path binaryApk) {
ImmutableList<String> convertCommand =
ImmutableList.of(
aapt2Path.toString(),
"convert",
"--output-format",
"binary",
"-o",
binaryApk.toString(),
protoApk.toString());

new DefaultCommandExecutor()
.execute(
ImmutableList.of(
aapt2Path.toString(),
"convert",
"--output-format",
"binary",
"-o",
binaryApk.toString(),
protoApk.toString()),
CommandOptions.builder().setTimeout(timeoutMillis).build());
.execute(convertCommand, CommandOptions.builder().setTimeout(timeoutMillis).build());
}

@Override
public void optimizeToSparseResourceTables(Path originalApk, Path outputApk) {
ImmutableList<String> convertCommand =
ImmutableList.of(
aapt2Path.toString(),
"optimize",
"--enable-sparse-encoding",
"-o",
outputApk.toString(),
originalApk.toString());

new DefaultCommandExecutor()
.execute(convertCommand, CommandOptions.builder().setTimeout(timeoutMillis).build());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License
*/

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

import com.android.tools.build.bundletool.model.CommandExecutor.CommandOptions;
import com.android.tools.build.bundletool.androidtools.CommandExecutor.CommandOptions;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
Expand All @@ -33,6 +33,7 @@ ImmutableList<String> installMultiPackage(
ImmutableListMultimap<String, String> apkToInstallByPackage,
boolean staged,
boolean enableRollback,
Optional<Duration> timeout,
Optional<String> deviceId);

static AdbCommand create(Path adbPath) {
Expand All @@ -53,16 +54,23 @@ public ImmutableList<String> installMultiPackage(
ImmutableListMultimap<String, String> apkToInstallByPackage,
boolean staged,
boolean enableRollback,
Optional<Duration> timeout,
Optional<String> deviceId) {
return installMultiPackage(
apkToInstallByPackage, staged, enableRollback, deviceId, new DefaultCommandExecutor());
apkToInstallByPackage,
staged,
enableRollback,
timeout,
deviceId,
new DefaultCommandExecutor());
}

@VisibleForTesting
ImmutableList<String> installMultiPackage(
ImmutableListMultimap<String, String> apkToInstallByPackage,
boolean staged,
boolean enableRollback,
Optional<Duration> timeout,
Optional<String> deviceId,
CommandExecutor commandExecutor) {
ImmutableList.Builder<String> commandBuilder =
Expand All @@ -75,6 +83,11 @@ ImmutableList<String> installMultiPackage(
if (enableRollback) {
commandBuilder.add("--enable-rollback");
}
if (timeout.isPresent()) {
commandBuilder
.add("--staged-ready-timeout")
.add(String.format("%d", timeout.get().toMillis()));
}
// Splits of a single package must be installed together.
apkToInstallByPackage
.keySet()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License
*/
package com.android.tools.build.bundletool.model;
package com.android.tools.build.bundletool.androidtools;

import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License
*/
package com.android.tools.build.bundletool.model;
package com.android.tools.build.bundletool.androidtools;

import static java.util.concurrent.TimeUnit.MILLISECONDS;

Expand Down
Loading

0 comments on commit 950c8d6

Please sign in to comment.