diff options
author | 2018-06-13 04:54:12 -0700 | |
---|---|---|
committer | 2018-06-13 04:55:07 -0700 | |
commit | 8f5b096c0aeef427c08398e6c3ecf8befec7fded (patch) | |
tree | 5437902ea618fb273e0f589df9711d66301a2e0f /src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp | |
parent | 6c282b9ec2d2b11108b038e8551f26fa961c0538 (diff) |
Return Strings from C++ Skylark APIs, not PathFragments
PathFragments are not well supported in Skylark, quite the opposite, the Skylark
team tries hard to not use path fragments if possible. All existing users I
looked into had to convert the PathFragment to string using str() anyway.
Because of that this cl should not break anybody.
RELNOTES: None.
PiperOrigin-RevId: 200372447
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/skylarkbuildapi/cpp/CcToolchainProviderApi.java | 26 |
1 files changed, 11 insertions, 15 deletions
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 fefb424a57..cb6287e612 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 @@ -20,28 +20,24 @@ import com.google.devtools.build.lib.skylarkinterface.SkylarkCallable; import com.google.devtools.build.lib.skylarkinterface.SkylarkModule; import com.google.devtools.build.lib.syntax.EvalException; -/** - * Information about the C++ toolchain. - */ +/** Information about the C++ toolchain. */ @SkylarkModule(name = "CcToolchainInfo", doc = "Information about the C++ compiler being used.") -public interface CcToolchainProviderApi<PathFragmentT> extends ToolchainInfoApi { +public interface CcToolchainProviderApi extends ToolchainInfoApi { @SkylarkCallable( name = "built_in_include_directories", doc = "Returns the list of built-in directories of the compiler.", - structField = true - ) - public ImmutableList<PathFragmentT> getBuiltInIncludeDirectories(); + structField = true) + public ImmutableList<String> getBuiltInIncludeDirectoriesAsStrings(); @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 PathFragmentT getSysroot(); + 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(); @SkylarkCallable(name = "compiler", structField = true, doc = "C++ compiler.", allowReturnNones = true) |