diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcToolchainProviderApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcToolchainProviderApi.java index 762a6364c7c9d6..078f5b6e3d9982 100644 --- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcToolchainProviderApi.java +++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcToolchainProviderApi.java @@ -16,9 +16,11 @@ import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.skylarkbuildapi.platform.ToolchainInfoApi; +import com.google.devtools.build.lib.skylarkinterface.Param; import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable; import com.google.devtools.build.lib.skylarkinterface.SkylarkModule; import com.google.devtools.build.lib.syntax.EvalException; +import com.google.devtools.build.lib.syntax.SkylarkList; /** Information about the C++ toolchain. */ @SkylarkModule(name = "CcToolchainInfo", doc = "Information about the C++ compiler being used.") @@ -54,8 +56,18 @@ public interface CcToolchainProviderApi extends ToolchainInfoApi { @SkylarkCallable( name = "unfiltered_compiler_options", doc = - "Returns the default list of options which cannot be filtered by BUILD " - + "rules. These should be appended to the command line after filtering.") + "Deprecated. Returns the default list of options which cannot be filtered by " + + "BUILD rules. These should be appended to the command line after filtering.", + parameters = { + @Param( + name = "features", + doc = "Unused.", + positional = true, + named = false, + type = SkylarkList.class + ) + } + ) // TODO(b/24373706): Remove this method once new C++ toolchain API is available public ImmutableList getUnfilteredCompilerOptionsWithSysroot( Iterable featuresNotUsedAnymore); @@ -109,7 +121,17 @@ public ImmutableList getUnfilteredCompilerOptionsWithSysroot( doc = "Returns the immutable list of linker options for fully statically linked " + "outputs. Does not include command-line options passed via --linkopt or " - + "--linkopts.") + + "--linkopts.", + parameters = { + @Param( + name = "shared_lib", + doc = "If true, returns the link options for a shared library.", + positional = true, + named = false, + type = Boolean.class + ) + } + ) @Deprecated public ImmutableList getFullyStaticLinkOptions(Boolean sharedLib) throws EvalException; @@ -118,7 +140,17 @@ public ImmutableList getUnfilteredCompilerOptionsWithSysroot( doc = "Returns the immutable list of linker options for mostly statically linked " + "outputs. Does not include command-line options passed via --linkopt or " - + "--linkopts.") + + "--linkopts.", + parameters = { + @Param( + name = "shared_lib", + doc = "If true, returns the link options for a shared library.", + positional = true, + named = false, + type = Boolean.class + ) + } + ) @Deprecated public ImmutableList getMostlyStaticLinkOptions(Boolean sharedLib); @@ -127,7 +159,16 @@ public ImmutableList getUnfilteredCompilerOptionsWithSysroot( doc = "Returns the immutable list of linker options for artifacts that are not " + "fully or mostly statically linked. Does not include command-line options " - + "passed via --linkopt or --linkopts." + + "passed via --linkopt or --linkopts.", + parameters = { + @Param( + name = "shared_lib", + doc = "If true, returns the link options for a shared library.", + positional = true, + named = false, + type = Boolean.class + ) + } ) @Deprecated public ImmutableList getDynamicLinkOptions(Boolean sharedLib); diff --git a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CppConfigurationApi.java b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CppConfigurationApi.java index 0b2e406fd5c228..3e85affcf6f661 100644 --- a/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CppConfigurationApi.java +++ b/src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CppConfigurationApi.java @@ -15,10 +15,12 @@ package com.google.devtools.build.lib.skylarkbuildapi.cpp; import com.google.common.collect.ImmutableList; +import com.google.devtools.build.lib.skylarkinterface.Param; 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.EvalException; +import com.google.devtools.build.lib.syntax.SkylarkList; /** * The C++ configuration fragment. @@ -62,10 +64,19 @@ public ImmutableList getBuiltInIncludeDirectoriesForSkylark() @SkylarkCallable( name = "compiler_options", doc = - "Returns the default options to use for compiling C, C++, and assembler. " - + "This is just the options that should be used for all three languages. " + "Deprecated. Returns the default options to use for compiling C, C++, and " + + "assembler. This is just the options that should be used for all three languages. " + "There may be additional C-specific or C++-specific options that should be used, " - + "in addition to the ones returned by this method" + + "in addition to the ones returned by this method", + parameters = { + @Param( + name = "features", + doc = "Unused.", + positional = true, + named = false, + type = SkylarkList.class + ) + } ) @Deprecated public ImmutableList getCompilerOptions(Iterable featuresNotUsedAnymore); @@ -84,7 +95,16 @@ public ImmutableList getBuiltInIncludeDirectoriesForSkylark() doc = "Returns the list of additional C++-specific options to use for compiling C++. " + "These should be go on the command line after the common options returned by " - + "compiler_options" + + "compiler_options", + parameters = { + @Param( + name = "features", + doc = "Unused.", + positional = true, + named = false, + type = SkylarkList.class + ) + } ) @Deprecated public ImmutableList getCxxOptions(Iterable featuresNotUsedAnymore); @@ -93,7 +113,16 @@ public ImmutableList getBuiltInIncludeDirectoriesForSkylark() name = "unfiltered_compiler_options", doc = "Returns the default list of options which cannot be filtered by BUILD " - + "rules. These should be appended to the command line after filtering." + + "rules. These should be appended to the command line after filtering.", + parameters = { + @Param( + name = "features", + doc = "Unused.", + positional = true, + named = false, + type = SkylarkList.class + ) + } ) public ImmutableList getUnfilteredCompilerOptionsWithLegacySysroot( Iterable featuresNotUsedAnymore); @@ -112,7 +141,23 @@ public ImmutableList getUnfilteredCompilerOptionsWithLegacySysroot( doc = "Returns the immutable list of linker options for fully statically linked " + "outputs. Does not include command-line options passed via --linkopt or " - + "--linkopts." + + "--linkopts.", + parameters = { + @Param( + name = "features", + doc = "Unused.", + positional = true, + named = false, + type = SkylarkList.class + ), + @Param( + name = "shared_lib", + doc = "If true, returns the link options for a shared library.", + positional = true, + named = false, + type = Boolean.class + ) + } ) @Deprecated public ImmutableList getFullyStaticLinkOptions( @@ -123,7 +168,23 @@ public ImmutableList getFullyStaticLinkOptions( doc = "Returns the immutable list of linker options for mostly statically linked " + "outputs. Does not include command-line options passed via --linkopt or " - + "--linkopts." + + "--linkopts.", + parameters = { + @Param( + name = "features", + doc = "Unused.", + positional = true, + named = false, + type = SkylarkList.class + ), + @Param( + name = "shared_lib", + doc = "If true, returns the link options for a shared library.", + positional = true, + named = false, + type = Boolean.class + ) + } ) @Deprecated public ImmutableList getMostlyStaticLinkOptions( @@ -134,7 +195,23 @@ public ImmutableList getMostlyStaticLinkOptions( doc = "Returns the immutable list of linker options for artifacts that are not " + "fully or mostly statically linked. Does not include command-line options " - + "passed via --linkopt or --linkopts." + + "passed via --linkopt or --linkopts.", + parameters = { + @Param( + name = "features", + doc = "Unused.", + positional = true, + named = false, + type = SkylarkList.class + ), + @Param( + name = "shared_lib", + doc = "If true, returns the link options for a shared library.", + positional = true, + named = false, + type = Boolean.class + ) + } ) @Deprecated public ImmutableList getDynamicLinkOptions(