diff options
author | lberki <lberki@google.com> | 2018-07-02 00:11:48 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-07-02 00:14:31 -0700 |
commit | e810ae5118f19d118260165608c1e840ccbe3f26 (patch) | |
tree | 3b071e27b5b07c9fbbd10afca3edba45c08e0600 /src/main/java/com/google/devtools/build/lib/skylarkbuildapi | |
parent | a5e2f1b3d0679ef82d658a7e02bffa8d515faf8d (diff) |
Add a flag to disable the parts of the Skylark API of the C++ configuration that depend on BUILD/CROSSTOOL files.
Also add @Deprecated tags for these methods and extract CppConfigurationSkylarkTest in a separate class so that it actually gets run (followup change with the explanation a-coming)
RELNOTES: None.
PiperOrigin-RevId: 202903559
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skylarkbuildapi')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CppConfigurationApi.java | 54 |
1 files changed, 28 insertions, 26 deletions
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 3e85affcf6..f8bcbedf5a 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 @@ -34,15 +34,15 @@ public interface CppConfigurationApi <InvalidConfigurationExceptionT extends Exc @SkylarkCallable(name = "compiler", structField = true, doc = "C++ compiler.") @Deprecated - public String getCompiler(); + String getCompiler() throws EvalException; @SkylarkCallable(name = "libc", structField = true, doc = "libc version string.") @Deprecated - public String getTargetLibc(); + String getTargetLibc() throws EvalException; @SkylarkCallable(name = "cpu", structField = true, doc = "Target CPU of the C++ toolchain.") @Deprecated - public String getTargetCpu(); + String getTargetCpu() throws EvalException; @SkylarkCallable( name = "built_in_include_directories", @@ -52,14 +52,14 @@ public interface CppConfigurationApi <InvalidConfigurationExceptionT extends Exc + " should be relative to the exec directory. They may be absolute if they are also" + " installed on the remote build nodes or for local compilation." ) - public ImmutableList<String> getBuiltInIncludeDirectoriesForSkylark() - throws InvalidConfigurationExceptionT; + ImmutableList<String> getBuiltInIncludeDirectoriesForSkylark() + throws InvalidConfigurationExceptionT, EvalException; @SkylarkCallable(name = "sysroot", structField = true, doc = "Returns the sysroot to be used. If the toolchain compiler does not support " + "different sysroots, or the sysroot is the same as the default sysroot, then " + "this method returns <code>None</code>.") - public String getSysroot(); + String getSysroot() throws EvalException; @SkylarkCallable( name = "compiler_options", @@ -79,7 +79,8 @@ public interface CppConfigurationApi <InvalidConfigurationExceptionT extends Exc } ) @Deprecated - public ImmutableList<String> getCompilerOptions(Iterable<String> featuresNotUsedAnymore); + ImmutableList<String> getCompilerOptions(Iterable<String> featuresNotUsedAnymore) + throws EvalException; @SkylarkCallable( name = "c_options", @@ -88,7 +89,7 @@ public interface CppConfigurationApi <InvalidConfigurationExceptionT extends Exc "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 " + "<code>compiler_options</code>") - public ImmutableList<String> getCOptions(); + ImmutableList<String> getCOptionsForSkylark() throws EvalException; @SkylarkCallable( name = "cxx_options", @@ -107,7 +108,8 @@ public interface CppConfigurationApi <InvalidConfigurationExceptionT extends Exc } ) @Deprecated - public ImmutableList<String> getCxxOptions(Iterable<String> featuresNotUsedAnymore); + ImmutableList<String> getCxxOptions(Iterable<String> featuresNotUsedAnymore) + throws EvalException; @SkylarkCallable( name = "unfiltered_compiler_options", @@ -124,8 +126,8 @@ public interface CppConfigurationApi <InvalidConfigurationExceptionT extends Exc ) } ) - public ImmutableList<String> getUnfilteredCompilerOptionsWithLegacySysroot( - Iterable<String> featuresNotUsedAnymore); + ImmutableList<String> getUnfilteredCompilerOptionsWithLegacySysroot( + Iterable<String> featuresNotUsedAnymore) throws EvalException; @SkylarkCallable( name = "link_options", @@ -134,7 +136,7 @@ public interface CppConfigurationApi <InvalidConfigurationExceptionT extends Exc "Returns the set of command-line linker options, including any flags " + "inferred from the command-line options." ) - public ImmutableList<String> getLinkOptionsWithLegacySysroot(); + ImmutableList<String> getLinkOptionsWithLegacySysroot() throws EvalException; @SkylarkCallable( name = "fully_static_link_options", @@ -160,7 +162,7 @@ public interface CppConfigurationApi <InvalidConfigurationExceptionT extends Exc } ) @Deprecated - public ImmutableList<String> getFullyStaticLinkOptions( + ImmutableList<String> getFullyStaticLinkOptions( Iterable<String> featuresNotUsedAnymore, Boolean sharedLib) throws EvalException; @SkylarkCallable( @@ -187,8 +189,8 @@ public interface CppConfigurationApi <InvalidConfigurationExceptionT extends Exc } ) @Deprecated - public ImmutableList<String> getMostlyStaticLinkOptions( - Iterable<String> featuresNotUsedAnymore, Boolean sharedLib); + ImmutableList<String> getMostlyStaticLinkOptions( + Iterable<String> featuresNotUsedAnymore, Boolean sharedLib) throws EvalException; @SkylarkCallable( name = "dynamic_link_options", @@ -214,63 +216,63 @@ public interface CppConfigurationApi <InvalidConfigurationExceptionT extends Exc } ) @Deprecated - public ImmutableList<String> getDynamicLinkOptions( - Iterable<String> featuresNotUsedAnymore, Boolean sharedLib); + ImmutableList<String> getDynamicLinkOptions( + Iterable<String> featuresNotUsedAnymore, Boolean sharedLib) throws EvalException; @SkylarkCallable(name = "ld_executable", structField = true, doc = "Path to the linker binary.") - public String getLdExecutableForSkylark(); + String getLdExecutableForSkylark() throws EvalException; @SkylarkCallable( name = "objcopy_executable", structField = true, doc = "Path to GNU binutils 'objcopy' binary." ) - public String getObjCopyExecutableForSkylark(); + String getObjCopyExecutableForSkylark() throws EvalException; @SkylarkCallable( name = "compiler_executable", structField = true, doc = "Path to C/C++ compiler binary." ) - public String getCppExecutableForSkylark(); + String getCppExecutableForSkylark() throws EvalException; @SkylarkCallable( name = "preprocessor_executable", structField = true, doc = "Path to C/C++ preprocessor binary." ) - public String getCpreprocessorExecutableForSkylark(); + String getCpreprocessorExecutableForSkylark() throws EvalException; @SkylarkCallable( name = "nm_executable", structField = true, doc = "Path to GNU binutils 'nm' binary." ) - public String getNmExecutableForSkylark(); + String getNmExecutableForSkylark() throws EvalException; @SkylarkCallable( name = "objdump_executable", structField = true, doc = "Path to GNU binutils 'objdump' binary." ) - public String getObjdumpExecutableForSkylark(); + String getObjdumpExecutableForSkylark() throws EvalException; @SkylarkCallable( name = "ar_executable", structField = true, doc = "Path to GNU binutils 'ar' binary." ) - public String getArExecutableForSkylark(); + String getArExecutableForSkylark() throws EvalException; @SkylarkCallable( name = "strip_executable", structField = true, doc = "Path to GNU binutils 'strip' binary." ) - public String getStripExecutableForSkylark(); + String getStripExecutableForSkylark() throws EvalException; @SkylarkCallable(name = "target_gnu_system_name", structField = true, doc = "The GNU System Name.") @Deprecated - public String getTargetGnuSystemName(); + String getTargetGnuSystemName() throws EvalException; } |