aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Dmitry Shevchenko <dmishe@google.com>2017-01-09 17:54:26 +0000
committerGravatar Marcel Hlopko <hlopko@google.com>2017-01-10 10:21:40 +0000
commit441dac4afac458042b093c9a3fc689aa72a90d41 (patch)
treed7660a1ba3ee09585affe0b0f80533e0a8427c96 /src
parentc9dbd4c1a4a4b4345c0b3924f86e01612ae12807 (diff)
Expose DEVELOPER_DIR to Skylark
* Also make constants private since they both have getters now. -- PiperOrigin-RevId: 143973536 MOS_MIGRATED_REVID=143973536
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/apple/AppleToolchain.java17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/apple/AppleToolchain.java b/src/main/java/com/google/devtools/build/lib/rules/apple/AppleToolchain.java
index abf6f975dc..55a82c9611 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/apple/AppleToolchain.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/apple/AppleToolchain.java
@@ -49,8 +49,8 @@ public class AppleToolchain {
// These next two strings are shared secrets with the xcrunwrapper.sh to allow
// expansion of DeveloperDir and SDKRoot and runtime, since they aren't known
// until compile time on any given build machine.
- @VisibleForTesting public static final String DEVELOPER_DIR = "__BAZEL_XCODE_DEVELOPER_DIR__";
- @VisibleForTesting public static final String SDKROOT_DIR = "__BAZEL_XCODE_SDKROOT__";
+ private static final String DEVELOPER_DIR = "__BAZEL_XCODE_DEVELOPER_DIR__";
+ private static final String SDKROOT_DIR = "__BAZEL_XCODE_SDKROOT__";
// These two paths are framework paths relative to SDKROOT.
@VisibleForTesting
@@ -82,7 +82,7 @@ public class AppleToolchain {
/** Returns the platform directory inside of Xcode for a platform name. */
public static String platformDir(String platformName) {
- return DEVELOPER_DIR + "/Platforms/" + platformName + ".platform";
+ return developerDir() + "/Platforms/" + platformName + ".platform";
}
/**
@@ -97,6 +97,17 @@ public class AppleToolchain {
}
/**
+ * Returns the Developer directory inside of Xcode for a given configuration.
+ */
+ @SkylarkCallable(
+ name = "developer_dir",
+ doc = "Returns the Developer directory inside of Xcode for a given configuration."
+ )
+ public static String developerDir() {
+ return DEVELOPER_DIR;
+ }
+
+ /**
* Returns the platform frameworks directory inside of Xcode for a given configuration.
*/
@SkylarkCallable(