Move to XCode 9.4, add CoreML and ClassKit. (#1637)

* Move to XCode 9.4, add CoreML and ClassKit.

* Add assertSame and assertNotSame to stdlib.

* Fix SDK properties.
This commit is contained in:
Nikolay Igotti
2018-05-31 23:21:17 +03:00
committed by GitHub
parent f3115a100a
commit b8fa1bcdd3
7 changed files with 68 additions and 13 deletions
+10 -10
View File
@@ -35,10 +35,10 @@ llvmVersion = 5.0.0
# Mac OS X.
llvmHome.macos_x64 = clang-llvm-5.0.0-darwin-macos
targetToolchain.macos_x64 = target-toolchain-5-macos_x64
targetToolchain.macos_x64 = target-toolchain-6-macos_x64
arch.macos_x64 = x86_64
targetSysRoot.macos_x64 = target-sysroot-5-macos_x64
targetSysRoot.macos_x64 = target-sysroot-6-macos_x64
libffiDir.macos_x64 = libffi-3.2.1-2-darwin-macos
llvmLtoFlags.macos_x64 =
llvmLtoOptFlags.macos_x64 = -O3 -function-sections
@@ -56,24 +56,24 @@ dependencies.macos_x64 = \
libffi-3.2.1-2-darwin-macos \
clang-llvm-5.0.0-darwin-macos
target-sysroot-5-macos_x64.default = \
target-sysroot-6-macos_x64.default = \
remote:internal
target-toolchain-5-macos_x64.default = \
target-toolchain-6-macos_x64.default = \
remote:internal
# Apple iOS.
targetToolchain.macos_x64-ios_arm64 = target-toolchain-5-macos_x64
targetToolchain.macos_x64-ios_arm64 = target-toolchain-6-macos_x64
dependencies.macos_x64-ios_arm64 = \
libffi-3.2.1-2-darwin-ios \
clang-llvm-5.0.0-darwin-macos
target-sysroot-5-ios_arm64.default = \
target-sysroot-6-ios_arm64.default = \
remote:internal
arch.ios_arm64 = arm64
entrySelector.ios_arm64 = -alias _Konan_main _main
targetSysRoot.ios_arm64 = target-sysroot-5-ios_arm64
targetSysRoot.ios_arm64 = target-sysroot-6-ios_arm64
libffiDir.ios_arm64 = libffi-3.2.1-2-darwin-ios
llvmLtoFlags.ios_arm64 =
llvmLtoOptFlags.ios_arm64 = -O3 -function-sections
@@ -88,17 +88,17 @@ osVersionMinFlagClang.ios_arm64 = -miphoneos-version-min
osVersionMin.ios_arm64 = 8.0
# Apple iOS simulator.
targetToolchain.macos_x64-ios_x64 = target-toolchain-5-macos_x64
targetToolchain.macos_x64-ios_x64 = target-toolchain-6-macos_x64
dependencies.macos_x64-ios_x64 = \
libffi-3.2.1-1-darwin-ios_sim \
clang-llvm-5.0.0-darwin-macos
target-sysroot-5-ios_x64.default = \
target-sysroot-6-ios_x64.default = \
remote:internal
arch.ios_x64 = x86_64
entrySelector.ios_x64 = -alias _Konan_main _main
targetSysRoot.ios_x64 = target-sysroot-5-ios_x64
targetSysRoot.ios_x64 = target-sysroot-6-ios_x64
libffiDir.ios_x64 = libffi-3.2.1-1-darwin-ios_sim
llvmLtoFlags.ios_x64 =
llvmLtoOptFlags.ios_x64 = -O3 -function-sections
@@ -0,0 +1,9 @@
depends = CoreFoundation Foundation darwin posix
language = Objective-C
package = platform.ClassKit
headers = ClassKit/ClassKit.h
headerFilter = ClassKit/**
compilerOpts = -framework ClassKit
linkerOpts = -framework ClassKit
+9
View File
@@ -0,0 +1,9 @@
depends = CoreVideo CoreFoundation Foundation darwin posix
language = Objective-C
package = platform.CoreML
headers = CoreML/CoreML.h
headerFilter = CoreML/**
compilerOpts = -framework CoreML
linkerOpts = -framework CoreML
+9
View File
@@ -0,0 +1,9 @@
depends = CoreVideo CoreFoundation Foundation darwin posix
language = Objective-C
package = platform.CoreML
headers = CoreML/CoreML.h
headerFilter = CoreML/**
compilerOpts = -framework CoreML
linkerOpts = -framework CoreML
@@ -61,6 +61,16 @@ fun <@OnlyInputTypes T> assertNotEquals(illegal: T, actual: T, message: String?
asserter.assertNotEquals(message, illegal, actual)
}
/** Asserts that [expected] is the same instance as [actual], with an optional [message]. */
fun <@OnlyInputTypes T> assertSame(expected: T, actual: T, message: String? = null) {
asserter.assertSame(message, expected, actual)
}
/** Asserts that [actual] is not the same instance as [illegal], with an optional [message]. */
fun <@OnlyInputTypes T> assertNotSame(illegal: T, actual: T, message: String? = null) {
asserter.assertNotSame(message, illegal, actual)
}
/** Asserts that the [actual] value is not `null`, with an optional [message]. */
fun <T : Any> assertNotNull(actual: T?, message: String? = null): T {
asserter.assertNotNull(message, actual)
@@ -203,6 +213,24 @@ interface Asserter {
assertTrue({ messagePrefix(message) + "Illegal value: <$actual>." }, actual != illegal)
}
/**
* Asserts that the specified values are the same instance.
*
* @param message the message to report if the assertion fails.
*/
fun assertSame(message: String?, expected: Any?, actual: Any?): Unit {
assertTrue({ messagePrefix(message) + "Expected <$expected>, actual <$actual> is not same." }, actual === expected)
}
/**
* Asserts that the specified values are not the same instance.
*
* @param message the message to report if the assertion fails.
*/
fun assertNotSame(message: String?, illegal: Any?, actual: Any?): Unit {
assertTrue({ messagePrefix(message) + "Expected not same as <$actual>." }, actual !== illegal)
}
/**
* Asserts that the specified value is `null`.
*
@@ -67,7 +67,7 @@ fun Properties.keepOnlyDefaultProfiles() {
// Force build to use only 'default' profile:
this.setProperty(DEPENDENCY_PROFILES_KEY, "default")
// Force build to use fixed Xcode version:
this.setProperty("useFixedXcodeVersion", "9.3.1")
this.setProperty("useFixedXcodeVersion", "9.4")
// TODO: it actually affects only resolution made in :dependencies,
// that's why we assume that 'default' profile comes first (and check this above).
}
+2 -2
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
KONAN_TOOLCHAIN_VERSION=5
KONAN_TOOLCHAIN_VERSION=6
SDKS="macosx iphoneos iphonesimulator watchos watchsimulator"
TARBALL_macosx=target-sysroot-$KONAN_TOOLCHAIN_VERSION-macos_x64
TARBALL_iphoneos=target-sysroot-$KONAN_TOOLCHAIN_VERSION-ios_arm64
@@ -24,4 +24,4 @@ t=`dirname $t`
t=`grealpath $t/../..`
tarball=$TARBALL_xcode
echo "Packing toolchain $OUT/$tarball.tar.gz..."
$SHELL -c "tar czf $OUT/$tarball.tar.gz -C $t -s '/^\./$tarball/' ."
$SHELL -c "tar czf $OUT/$tarball.tar.gz -C $t -s '/^\./$tarball/' ."