From f31d4713e04bfef02681e88e2a4d83d0630c28a1 Mon Sep 17 00:00:00 2001 From: dchai Date: Thu, 5 Dec 2019 17:41:02 -0800 Subject: [PATCH] Remove @Nullable annotation from aapt2 provider Per https://github.com/bazelbuild/bazel/issues/10000, aapt2 is the only Android asset packaging tool in use, and allowing the provider to be null just pushes errors downstream. PiperOrigin-RevId: 284091553 --- .../build/lib/rules/android/AndroidSdkProvider.java | 7 +++---- .../android/AndroidSdkProviderApi.java | 13 +++---------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSdkProvider.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSdkProvider.java index 6925119e8cf7de..771836743fc498 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSdkProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidSdkProvider.java @@ -66,7 +66,7 @@ public AndroidSdkProvider( FilesToRunProvider mainDexListCreator, FilesToRunProvider aidl, FilesToRunProvider aapt, - @Nullable FilesToRunProvider aapt2, + FilesToRunProvider aapt2, @Nullable FilesToRunProvider apkBuilder, FilesToRunProvider apkSigner, FilesToRunProvider proguard, @@ -170,7 +170,6 @@ public FilesToRunProvider getAapt() { } @Override - @Nullable public FilesToRunProvider getAapt2() { return aapt2; } @@ -219,7 +218,7 @@ public AndroidSdkProvider createInfo( FilesToRunProvider mainDexListCreator, FilesToRunProvider aidl, FilesToRunProvider aapt, - Object aapt2, + FilesToRunProvider aapt2, Object apkBuilder, FilesToRunProvider apkSigner, FilesToRunProvider proguard, @@ -238,7 +237,7 @@ public AndroidSdkProvider createInfo( mainDexListCreator, aidl, aapt, - fromNoneable(aapt2, FilesToRunProvider.class), + aapt2, fromNoneable(apkBuilder, FilesToRunProvider.class), apkSigner, proguard, diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/android/AndroidSdkProviderApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/android/AndroidSdkProviderApi.java index 9f7d1f0e962a51..fc25dc9e8274ca 100644 --- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/android/AndroidSdkProviderApi.java +++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/android/AndroidSdkProviderApi.java @@ -98,13 +98,7 @@ public interface AndroidSdkProviderApi< @SkylarkCallable(name = "aapt", structField = true, doc = "", documented = false) FilesToRunProviderT getAapt(); - @SkylarkCallable( - name = "aapt2", - structField = true, - doc = "", - documented = false, - allowReturnNones = true) - @Nullable + @SkylarkCallable(name = "aapt2", structField = true, doc = "", documented = false) FilesToRunProviderT getAapt2(); @SkylarkCallable( @@ -222,8 +216,7 @@ public interface Provider< doc = "A files to run provider of AAPT2.", positional = true, named = false, - type = FilesToRunProviderApi.class, - noneable = true), + type = FilesToRunProviderApi.class), @Param( name = "apk_builder", doc = "A files to run provider of the Apk builder.", @@ -265,7 +258,7 @@ AndroidSdkProviderApi createInfo( FilesToRunProviderT mainDexListCreator, FilesToRunProviderT aidl, FilesToRunProviderT aapt, - /*noneable*/ Object aapt2, + FilesToRunProviderT aapt2, /*noneable*/ Object apkBuilder, FilesToRunProviderT apkSigner, FilesToRunProviderT proguard,