Search in sources :

Example 16 with CommandExecutionException

use of com.android.tools.build.bundletool.model.exceptions.CommandExecutionException in project bundletool by google.

the class MergingUtilsTest method mergeShardTargetings_nonAbiNonDensityNonLanguageTargeting_throws.

@Test
public void mergeShardTargetings_nonAbiNonDensityNonLanguageTargeting_throws() {
    ApkTargeting targeting = apkMinSdkTargeting(21);
    CommandExecutionException exception = assertThrows(CommandExecutionException.class, () -> MergingUtils.mergeShardTargetings(targeting, apkLanguageTargeting("en")));
    assertThat(exception).hasMessageThat().contains("Expecting only ABI, screen density, language and texture compression format" + " targeting");
}
Also used : ApkTargeting(com.android.bundle.Targeting.ApkTargeting) TargetingUtils.mergeApkTargeting(com.android.tools.build.bundletool.testing.TargetingUtils.mergeApkTargeting) CommandExecutionException(com.android.tools.build.bundletool.model.exceptions.CommandExecutionException) Test(org.junit.Test)

Aggregations

CommandExecutionException (com.android.tools.build.bundletool.model.exceptions.CommandExecutionException)16 Test (org.junit.Test)16 Path (java.nio.file.Path)6 AndroidManifest (com.android.tools.build.bundletool.model.AndroidManifest)3 BundleModuleName (com.android.tools.build.bundletool.model.BundleModuleName)3 ApkTargeting (com.android.bundle.Targeting.ApkTargeting)2 BundleModule (com.android.tools.build.bundletool.model.BundleModule)2 BundleModuleBuilder (com.android.tools.build.bundletool.testing.BundleModuleBuilder)2 TargetingUtils.mergeApkTargeting (com.android.tools.build.bundletool.testing.TargetingUtils.mergeApkTargeting)2 FlagParser (com.android.tools.build.bundletool.flags.FlagParser)1