Skip to content

Commit

Permalink
Put all Android native provider SkylarkCallable methods behind the
Browse files Browse the repository at this point in the history
FlagIdentifier.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS flag.

RELNOTES: None.
PiperOrigin-RevId: 239482490
  • Loading branch information
Googler authored and copybara-github committed Mar 20, 2019
1 parent 03ff878 commit d93c190
Show file tree
Hide file tree
Showing 28 changed files with 488 additions and 156 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory;
import com.google.devtools.build.lib.syntax.EvalException;
import com.google.devtools.build.lib.syntax.SkylarkNestedSet;
import com.google.devtools.build.lib.syntax.StarlarkSemantics.FlagIdentifier;
import javax.annotation.Nullable;

/** Provides information about transitive Android assets. */
Expand All @@ -43,7 +44,12 @@ public interface AndroidAssetsInfoApi<FileT extends FileApi, AssetsT extends Par
/** The name of the provider for this info object. */
String NAME = "AndroidAssetsInfo";

@SkylarkCallable(name = "label", structField = true, doc = "", documented = false)
@SkylarkCallable(
name = "label",
structField = true,
doc = "",
documented = false,
enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS)
Label getLabel();

@SkylarkCallable(
Expand All @@ -57,11 +63,17 @@ public interface AndroidAssetsInfoApi<FileT extends FileApi, AssetsT extends Par
+ " in native code, this artifact is added to the top-level output group (so"
+ " validation is only done if the target is requested on the command line). The"
+ " contents of this artifact are subject to change and should not be relied upon.",
documented = false)
documented = false,
enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS)
@Nullable
FileApi getValidationResult();

@SkylarkCallable(name = "direct_parsed_assets", structField = true, doc = "", documented = false)
@SkylarkCallable(
name = "direct_parsed_assets",
structField = true,
doc = "",
documented = false,
enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS)
NestedSet<AssetsT> getDirectParsedAssets();

/** Returns the local assets for the target. */
Expand All @@ -70,7 +82,8 @@ public interface AndroidAssetsInfoApi<FileT extends FileApi, AssetsT extends Par
doc = "Returns the local assets for the target.",
documented = false,
allowReturnNones = true,
structField = true)
structField = true,
enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS)
ImmutableList<FileT> getLocalAssets();

/** Returns the local asset dir for the target. */
Expand All @@ -79,23 +92,40 @@ public interface AndroidAssetsInfoApi<FileT extends FileApi, AssetsT extends Par
doc = "Returns the local asset directory for the target.",
documented = false,
allowReturnNones = true,
structField = true)
structField = true,
enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS)
String getLocalAssetDir();

@SkylarkCallable(
name = "transitive_parsed_assets",
structField = true,
doc = "",
documented = false)
documented = false,
enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS)
NestedSet<AssetsT> getTransitiveParsedAssets();

@SkylarkCallable(name = "assets", structField = true, doc = "", documented = false)
@SkylarkCallable(
name = "assets",
structField = true,
doc = "",
documented = false,
enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS)
NestedSet<FileT> getAssets();

@SkylarkCallable(name = "symbols", structField = true, doc = "", documented = false)
@SkylarkCallable(
name = "symbols",
structField = true,
doc = "",
documented = false,
enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS)
NestedSet<FileT> getSymbols();

@SkylarkCallable(name = "compiled_symbols", structField = true, doc = "", documented = false)
@SkylarkCallable(
name = "compiled_symbols",
structField = true,
doc = "",
documented = false,
enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS)
NestedSet<FileT> getCompiledSymbols();

/** The provider implementing this can construct the AndroidAssetsInfo provider. */
Expand All @@ -112,6 +142,7 @@ public interface Provider<FileT extends FileApi, AssetsT extends ParsedAndroidAs
name = NAME,
doc = "The <code>AndroidAssetsInfo</code> constructor.",
documented = false,
enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS,
parameters = {
@Param(
name = "label",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable;
import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory;
import com.google.devtools.build.lib.syntax.StarlarkSemantics.FlagIdentifier;

/**
* Provides information on Android resource, asset, and manifest information specific to binaries.
Expand All @@ -40,13 +41,15 @@ public interface AndroidBinaryDataInfoApi<FileT extends FileApi> extends StructA
name = "resource_apk",
structField = true,
doc = "The resource apk.",
documented = false)
documented = false,
enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS)
FileT getApk();

@SkylarkCallable(
name = "resource_proguard_config",
structField = true,
doc = "Proguard config generated for the resources.",
documented = false)
documented = false,
enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS)
FileT getResourceProguardConfig();
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.google.devtools.build.lib.skylarkinterface.SkylarkModule;
import com.google.devtools.build.lib.skylarkinterface.SkylarkModuleCategory;
import com.google.devtools.build.lib.syntax.EvalException;
import com.google.devtools.build.lib.syntax.StarlarkSemantics.FlagIdentifier;

/** A target that provides C++ libraries to be linked into Android targets. */
@SkylarkModule(
Expand All @@ -38,7 +39,12 @@ public interface AndroidCcLinkParamsProviderApi<T extends CcInfoApi> extends Str
String NAME = "AndroidCcLinkParamsInfo";

/** Returns the cc link params. */
@SkylarkCallable(name = "link_params", structField = true, doc = "", documented = false)
@SkylarkCallable(
name = "link_params",
structField = true,
doc = "",
documented = false,
enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS)
T getLinkParams();

/** The provider implementing this can construct the AndroidCcLinkParamsInfo provider. */
Expand All @@ -54,6 +60,7 @@ public interface Provider<T extends CcInfoApi> extends ProviderApi {
name = NAME,
doc = "The <code>AndroidCcLinkParamsInfo</code> constructor.",
documented = false,
enableOnlyWithFlag = FlagIdentifier.EXPERIMENTAL_ENABLE_ANDROID_MIGRATION_APIS,
parameters = {
@Param(
name = "store",
Expand Down
Loading

0 comments on commit d93c190

Please sign in to comment.