aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/apple/XcodeVersionProperties.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/apple/XcodeVersionProperties.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/apple/XcodeVersionProperties.java43
1 files changed, 41 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/apple/XcodeVersionProperties.java b/src/main/java/com/google/devtools/build/lib/rules/apple/XcodeVersionProperties.java
index 9194a33e45..5da51a5b41 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/apple/XcodeVersionProperties.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/apple/XcodeVersionProperties.java
@@ -25,9 +25,15 @@ import javax.annotation.Nullable;
*/
public class XcodeVersionProperties {
@VisibleForTesting public static final String DEFAULT_IOS_SDK_VERSION = "8.4";
+ @VisibleForTesting public static final String DEFAULT_WATCHOS_SDK_VERSION = "2.0";
+ @VisibleForTesting public static final String DEFAULT_MACOSX_SDK_VERSION = "10.10";
+ @VisibleForTesting public static final String DEFAULT_TVOS_SDK_VERSION = "1.0";
private final Optional<DottedVersion> xcodeVersion;
private final DottedVersion defaultIosSdkVersion;
+ private final DottedVersion defaultWatchosSdkVersion;
+ private final DottedVersion defaultTvosSdkVersion;
+ private final DottedVersion defaultMacosxSdkVersion;
/**
* Creates and returns a tuple representing no known xcode property information (defaults are
@@ -46,7 +52,7 @@ public class XcodeVersionProperties {
* is specified.
*/
XcodeVersionProperties(DottedVersion xcodeVersion) {
- this(xcodeVersion, null);
+ this(xcodeVersion, null, null, null, null);
}
/**
@@ -54,11 +60,23 @@ public class XcodeVersionProperties {
* a semi-sensible default will be assigned to the property value.
*/
XcodeVersionProperties(DottedVersion xcodeVersion,
- @Nullable String defaultIosSdkVersion) {
+ @Nullable String defaultIosSdkVersion,
+ @Nullable String defaultWatchosSdkVersion,
+ @Nullable String defaultTvosSdkVersion,
+ @Nullable String defaultMacosxSdkVersion) {
this.xcodeVersion = Optional.fromNullable(xcodeVersion);
this.defaultIosSdkVersion = (Strings.isNullOrEmpty(defaultIosSdkVersion))
? DottedVersion.fromString(DEFAULT_IOS_SDK_VERSION)
: DottedVersion.fromString(defaultIosSdkVersion);
+ this.defaultWatchosSdkVersion = (Strings.isNullOrEmpty(defaultWatchosSdkVersion))
+ ? DottedVersion.fromString(DEFAULT_WATCHOS_SDK_VERSION)
+ : DottedVersion.fromString(defaultWatchosSdkVersion);
+ this.defaultTvosSdkVersion = (Strings.isNullOrEmpty(defaultTvosSdkVersion))
+ ? DottedVersion.fromString(DEFAULT_TVOS_SDK_VERSION)
+ : DottedVersion.fromString(defaultTvosSdkVersion);
+ this.defaultMacosxSdkVersion = (Strings.isNullOrEmpty(defaultMacosxSdkVersion))
+ ? DottedVersion.fromString(DEFAULT_MACOSX_SDK_VERSION)
+ : DottedVersion.fromString(defaultMacosxSdkVersion);
}
/**
@@ -74,4 +92,25 @@ public class XcodeVersionProperties {
public DottedVersion getDefaultIosSdkVersion() {
return defaultIosSdkVersion;
}
+
+ /**
+ * Returns the default watchos sdk version to use if this xcode version is in use.
+ */
+ public DottedVersion getDefaultWatchosSdkVersion() {
+ return defaultWatchosSdkVersion;
+ }
+
+ /**
+ * Returns the default tvos sdk version to use if this xcode version is in use.
+ */
+ public DottedVersion getDefaultTvosSdkVersion() {
+ return defaultTvosSdkVersion;
+ }
+
+ /**
+ * Returns the default macosx sdk version to use if this xcode version is in use.
+ */
+ public DottedVersion getDefaultMacosxSdkVersion() {
+ return defaultMacosxSdkVersion;
+ }
}