Skip to content

Commit

Permalink
Remove @nullable annotation from aapt2 provider
Browse files Browse the repository at this point in the history
    Per bazelbuild/bazel#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
  • Loading branch information
Luca Di Grazia committed Sep 4, 2022
1 parent a21db7c commit 367adcd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.google.devtools.build.lib.packages.BuiltinProvider;
import com.google.devtools.build.lib.packages.NativeInfo;
import com.google.devtools.build.lib.packages.RuleClass.ConfiguredTargetFactory.RuleErrorException;
import com.google.devtools.build.lib.rules.java.BootClassPathInfo;
import com.google.devtools.build.lib.skylarkbuildapi.android.AndroidSdkProviderApi;
import com.google.devtools.build.lib.syntax.EvalException;
import javax.annotation.Nullable;
Expand Down Expand Up @@ -53,7 +52,6 @@ public final class AndroidSdkProvider extends NativeInfo
private final FilesToRunProvider apkSigner;
private final FilesToRunProvider proguard;
private final FilesToRunProvider zipalign;
@Nullable private final BootClassPathInfo system;

public AndroidSdkProvider(
String buildToolsVersion,
Expand All @@ -72,8 +70,7 @@ public AndroidSdkProvider(
@Nullable FilesToRunProvider apkBuilder,
FilesToRunProvider apkSigner,
FilesToRunProvider proguard,
FilesToRunProvider zipalign,
@Nullable BootClassPathInfo system) {
FilesToRunProvider zipalign) {
super(PROVIDER);
this.buildToolsVersion = buildToolsVersion;
this.frameworkAidl = frameworkAidl;
Expand All @@ -92,7 +89,6 @@ public AndroidSdkProvider(
this.apkSigner = apkSigner;
this.proguard = proguard;
this.zipalign = zipalign;
this.system = system;
}

/**
Expand Down Expand Up @@ -199,10 +195,6 @@ public FilesToRunProvider getZipalign() {
return zipalign;
}

public BootClassPathInfo getSystem() {
return system;
}

/** The provider can construct the Android SDK provider. */
public static class Provider extends BuiltinProvider<AndroidSdkProvider>
implements AndroidSdkProviderApi.Provider<
Expand Down Expand Up @@ -230,8 +222,7 @@ public AndroidSdkProvider createInfo(
Object apkBuilder,
FilesToRunProvider apkSigner,
FilesToRunProvider proguard,
FilesToRunProvider zipalign,
Object system)
FilesToRunProvider zipalign)
throws EvalException {
return new AndroidSdkProvider(
buildToolsVersion,
Expand All @@ -250,8 +241,7 @@ public AndroidSdkProvider createInfo(
fromNoneable(apkBuilder, FilesToRunProvider.class),
apkSigner,
proguard,
zipalign,
fromNoneable(system, BootClassPathInfo.class));
zipalign);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

import com.google.devtools.build.lib.skylarkbuildapi.FileApi;
import com.google.devtools.build.lib.skylarkbuildapi.FilesToRunProviderApi;
import com.google.devtools.build.lib.skylarkbuildapi.core.ProviderApi;
import com.google.devtools.build.lib.skylarkbuildapi.core.StructApi;
import com.google.devtools.build.lib.skylarkbuildapi.core.TransitiveInfoCollectionApi;
import com.google.devtools.build.lib.skylarkbuildapi.ProviderApi;
import com.google.devtools.build.lib.skylarkbuildapi.StructApi;
import com.google.devtools.build.lib.skylarkbuildapi.TransitiveInfoCollectionApi;
import com.google.devtools.build.lib.skylarkinterface.Param;
import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable;
import com.google.devtools.build.lib.skylarkinterface.SkylarkConstructor;
Expand Down Expand Up @@ -126,7 +126,7 @@ public interface AndroidSdkProviderApi<
"Do not use this module. It is intended for migration purposes only. If you depend on "
+ "it, you will be broken when it is removed.",
documented = false)
interface Provider<
public interface Provider<
FileT extends FileApi,
FilesToRunProviderT extends FilesToRunProviderApi<FileT>,
TransT extends TransitiveInfoCollectionApi>
Expand Down

0 comments on commit 367adcd

Please sign in to comment.