diff --git a/konan/konan.properties b/konan/konan.properties index 0f285ede650..00adb172680 100644 --- a/konan/konan.properties +++ b/konan/konan.properties @@ -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 diff --git a/platformLibs/src/platform/ios/ClassKit.def b/platformLibs/src/platform/ios/ClassKit.def new file mode 100644 index 00000000000..371dee66cdf --- /dev/null +++ b/platformLibs/src/platform/ios/ClassKit.def @@ -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 diff --git a/platformLibs/src/platform/ios/CoreML.def b/platformLibs/src/platform/ios/CoreML.def new file mode 100644 index 00000000000..08d5fefaf97 --- /dev/null +++ b/platformLibs/src/platform/ios/CoreML.def @@ -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 diff --git a/platformLibs/src/platform/osx/CoreML.def b/platformLibs/src/platform/osx/CoreML.def new file mode 100644 index 00000000000..08d5fefaf97 --- /dev/null +++ b/platformLibs/src/platform/osx/CoreML.def @@ -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 diff --git a/runtime/src/main/kotlin/kotlin/test/Assertions.kt b/runtime/src/main/kotlin/kotlin/test/Assertions.kt index 2477eda0ef7..f8f3d254df8 100644 --- a/runtime/src/main/kotlin/kotlin/test/Assertions.kt +++ b/runtime/src/main/kotlin/kotlin/test/Assertions.kt @@ -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 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`. * diff --git a/shared/src/main/kotlin/org/jetbrains/kotlin/konan/target/KonanProperties.kt b/shared/src/main/kotlin/org/jetbrains/kotlin/konan/target/KonanProperties.kt index b912da8e48c..2de7fa8ba56 100644 --- a/shared/src/main/kotlin/org/jetbrains/kotlin/konan/target/KonanProperties.kt +++ b/shared/src/main/kotlin/org/jetbrains/kotlin/konan/target/KonanProperties.kt @@ -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). } diff --git a/tools/scripts/update_xcode.sh b/tools/scripts/update_xcode.sh index 68c493f72be..0304db7fdf1 100755 --- a/tools/scripts/update_xcode.sh +++ b/tools/scripts/update_xcode.sh @@ -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/' ." \ No newline at end of file +$SHELL -c "tar czf $OUT/$tarball.tar.gz -C $t -s '/^\./$tarball/' ."