From 7d5f83cc06f9c8659ba818f928aea832460cd6e0 Mon Sep 17 00:00:00 2001 From: Jonas Franz Date: Mon, 2 Apr 2018 21:50:40 +0200 Subject: [PATCH] Add iOS Support --- gradle.properties | 2 +- .../project.pbxproj | 472 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + native/KotlinNativeDemo/AppDelegate.swift | 46 ++ .../AppIcon.appiconset/Contents.json | 93 ++++ .../Base.lproj/LaunchScreen.storyboard | 25 + .../Base.lproj/Main.storyboard | 24 + native/KotlinNativeDemo/Info.plist | 45 ++ native/KotlinNativeDemo/ViewController.swift | 28 ++ native/build.gradle | 4 + 10 files changed, 745 insertions(+), 1 deletion(-) create mode 100644 native/KotlinNativeDemo.xcodeproj/project.pbxproj create mode 100644 native/KotlinNativeDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 native/KotlinNativeDemo/AppDelegate.swift create mode 100644 native/KotlinNativeDemo/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 native/KotlinNativeDemo/Base.lproj/LaunchScreen.storyboard create mode 100644 native/KotlinNativeDemo/Base.lproj/Main.storyboard create mode 100644 native/KotlinNativeDemo/Info.plist create mode 100644 native/KotlinNativeDemo/ViewController.swift diff --git a/gradle.properties b/gradle.properties index 7c4bccb..bfdc630 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ npm_version = 5.5.1 kotlin.incremental.multiplatform=true -kotlin_native_version = 0.6 \ No newline at end of file +kotlin_native_version=+ \ No newline at end of file diff --git a/native/KotlinNativeDemo.xcodeproj/project.pbxproj b/native/KotlinNativeDemo.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e54c240 --- /dev/null +++ b/native/KotlinNativeDemo.xcodeproj/project.pbxproj @@ -0,0 +1,472 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + BD9680F02072B6D400D447AC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD9680EF2072B6D400D447AC /* AppDelegate.swift */; }; + BD9680F22072B6D400D447AC /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD9680F12072B6D400D447AC /* ViewController.swift */; }; + BD9680F52072B6D400D447AC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BD9680F32072B6D400D447AC /* Main.storyboard */; }; + BD9680F72072B6D400D447AC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BD9680F62072B6D400D447AC /* Assets.xcassets */; }; + BD9680FA2072B6D400D447AC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = BD9680F82072B6D400D447AC /* LaunchScreen.storyboard */; }; + BD96810D2072B6F200D447AC /* KotlinDemoFramework.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BD9681062072B6F200D447AC /* KotlinDemoFramework.framework */; }; + BD96810E2072B6F200D447AC /* KotlinDemoFramework.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = BD9681062072B6F200D447AC /* KotlinDemoFramework.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + BD96810B2072B6F200D447AC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BD9680E42072B6D400D447AC /* Project object */; + proxyType = 1; + remoteGlobalIDString = BD9681052072B6F200D447AC; + remoteInfo = KotlinDemoFramework; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + BD9681122072B6F200D447AC /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + BD96810E2072B6F200D447AC /* KotlinDemoFramework.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + BD9680EC2072B6D400D447AC /* KotlinNativeDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = KotlinNativeDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + BD9680EF2072B6D400D447AC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + BD9680F12072B6D400D447AC /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + BD9680F42072B6D400D447AC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + BD9680F62072B6D400D447AC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + BD9680F92072B6D400D447AC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + BD9680FB2072B6D400D447AC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + BD9681062072B6F200D447AC /* KotlinDemoFramework.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = KotlinDemoFramework.framework; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + BD9680E92072B6D400D447AC /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + BD96810D2072B6F200D447AC /* KotlinDemoFramework.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + BD9680E32072B6D400D447AC = { + isa = PBXGroup; + children = ( + BD9680EE2072B6D400D447AC /* KotlinNativeDemo */, + BD9680ED2072B6D400D447AC /* Products */, + ); + sourceTree = ""; + }; + BD9680ED2072B6D400D447AC /* Products */ = { + isa = PBXGroup; + children = ( + BD9680EC2072B6D400D447AC /* KotlinNativeDemo.app */, + BD9681062072B6F200D447AC /* KotlinDemoFramework.framework */, + ); + name = Products; + sourceTree = ""; + }; + BD9680EE2072B6D400D447AC /* KotlinNativeDemo */ = { + isa = PBXGroup; + children = ( + BD9680EF2072B6D400D447AC /* AppDelegate.swift */, + BD9680F12072B6D400D447AC /* ViewController.swift */, + BD9680F32072B6D400D447AC /* Main.storyboard */, + BD9680F62072B6D400D447AC /* Assets.xcassets */, + BD9680F82072B6D400D447AC /* LaunchScreen.storyboard */, + BD9680FB2072B6D400D447AC /* Info.plist */, + ); + path = KotlinNativeDemo; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + BD9680EB2072B6D400D447AC /* KotlinNativeDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = BD9680FE2072B6D400D447AC /* Build configuration list for PBXNativeTarget "KotlinNativeDemo" */; + buildPhases = ( + BD9680E82072B6D400D447AC /* Sources */, + BD9680E92072B6D400D447AC /* Frameworks */, + BD9680EA2072B6D400D447AC /* Resources */, + BD9681122072B6F200D447AC /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + BD96810C2072B6F200D447AC /* PBXTargetDependency */, + ); + name = KotlinNativeDemo; + productName = KotlinNativeDemo; + productReference = BD9680EC2072B6D400D447AC /* KotlinNativeDemo.app */; + productType = "com.apple.product-type.application"; + }; + BD9681052072B6F200D447AC /* KotlinDemoFramework */ = { + isa = PBXNativeTarget; + buildConfigurationList = BD96810F2072B6F200D447AC /* Build configuration list for PBXNativeTarget "KotlinDemoFramework" */; + buildPhases = ( + BD9681132072B78400D447AC /* Compile Kotlin/Native */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = KotlinDemoFramework; + productName = KotlinDemoFramework; + productReference = BD9681062072B6F200D447AC /* KotlinDemoFramework.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + BD9680E42072B6D400D447AC /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 0920; + ORGANIZATIONNAME = "Jonas Franz"; + TargetAttributes = { + BD9680EB2072B6D400D447AC = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + BD9681052072B6F200D447AC = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = BD9680E72072B6D400D447AC /* Build configuration list for PBXProject "KotlinNativeDemo" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = BD9680E32072B6D400D447AC; + productRefGroup = BD9680ED2072B6D400D447AC /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + BD9680EB2072B6D400D447AC /* KotlinNativeDemo */, + BD9681052072B6F200D447AC /* KotlinDemoFramework */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + BD9680EA2072B6D400D447AC /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BD9680FA2072B6D400D447AC /* LaunchScreen.storyboard in Resources */, + BD9680F72072B6D400D447AC /* Assets.xcassets in Resources */, + BD9680F52072B6D400D447AC /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + BD9681132072B78400D447AC /* Compile Kotlin/Native */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Compile Kotlin/Native"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$SRCROOT\"\necho \"$KONANTASK\"\n\"$SRCROOT/../gradlew\" -p \"$SRCROOT\" \"$KONAN_TASK\" -Pkonan.useEnvironmentVariables=true"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + BD9680E82072B6D400D447AC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BD9680F22072B6D400D447AC /* ViewController.swift in Sources */, + BD9680F02072B6D400D447AC /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + BD96810C2072B6F200D447AC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = BD9681052072B6F200D447AC /* KotlinDemoFramework */; + targetProxy = BD96810B2072B6F200D447AC /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + BD9680F32072B6D400D447AC /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + BD9680F42072B6D400D447AC /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + BD9680F82072B6D400D447AC /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + BD9680F92072B6D400D447AC /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + BD9680FC2072B6D400D447AC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + BD9680FD2072B6D400D447AC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + BD9680FF2072B6D400D447AC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = Z48VLBM2R7; + INFOPLIST_FILE = KotlinNativeDemo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = software.jonasfranz.KotlinNativeDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = arm64; + }; + name = Debug; + }; + BD9681002072B6D400D447AC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = Z48VLBM2R7; + INFOPLIST_FILE = KotlinNativeDemo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = software.jonasfranz.KotlinNativeDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = arm64; + }; + name = Release; + }; + BD9681102072B6F200D447AC /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = Z48VLBM2R7; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + KONAN_ENABLE_OPTIMIZATIONS = NO; + KONAN_TASK = ""; + "KONAN_TASK[sdk=iphoneos*]" = compileKonanKotlinDemoFrameworkIos_arm64; + "KONAN_TASK[sdk=iphonesimulator*]" = compileKonanKotlinDemoFrameworkIos_x64; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = software.jonasfranz.KotlinDemoFramework; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = arm64; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + BD9681112072B6F200D447AC /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = Z48VLBM2R7; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + KONAN_ENABLE_OPTIMIZATIONS = YES; + KONAN_TASK = ""; + "KONAN_TASK[sdk=iphoneos*]" = compileKonanKotlinDemoFrameworkIos_arm64; + "KONAN_TASK[sdk=iphonesimulator*]" = compileKonanKotlinDemoFrameworkIos_x64; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = software.jonasfranz.KotlinDemoFramework; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALID_ARCHS = arm64; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + BD9680E72072B6D400D447AC /* Build configuration list for PBXProject "KotlinNativeDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BD9680FC2072B6D400D447AC /* Debug */, + BD9680FD2072B6D400D447AC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + BD9680FE2072B6D400D447AC /* Build configuration list for PBXNativeTarget "KotlinNativeDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BD9680FF2072B6D400D447AC /* Debug */, + BD9681002072B6D400D447AC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + BD96810F2072B6F200D447AC /* Build configuration list for PBXNativeTarget "KotlinDemoFramework" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BD9681102072B6F200D447AC /* Debug */, + BD9681112072B6F200D447AC /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = BD9680E42072B6D400D447AC /* Project object */; +} diff --git a/native/KotlinNativeDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/native/KotlinNativeDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..a7be41d --- /dev/null +++ b/native/KotlinNativeDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/native/KotlinNativeDemo/AppDelegate.swift b/native/KotlinNativeDemo/AppDelegate.swift new file mode 100644 index 0000000..bdebb9c --- /dev/null +++ b/native/KotlinNativeDemo/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// KotlinNativeDemo +// +// Created by Jonas Franz on 02.04.18. +// Copyright © 2018 Jonas Franz. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/native/KotlinNativeDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/native/KotlinNativeDemo/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..1d060ed --- /dev/null +++ b/native/KotlinNativeDemo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,93 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/native/KotlinNativeDemo/Base.lproj/LaunchScreen.storyboard b/native/KotlinNativeDemo/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f83f6fd --- /dev/null +++ b/native/KotlinNativeDemo/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/native/KotlinNativeDemo/Base.lproj/Main.storyboard b/native/KotlinNativeDemo/Base.lproj/Main.storyboard new file mode 100644 index 0000000..03c13c2 --- /dev/null +++ b/native/KotlinNativeDemo/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/native/KotlinNativeDemo/Info.plist b/native/KotlinNativeDemo/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/native/KotlinNativeDemo/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/native/KotlinNativeDemo/ViewController.swift b/native/KotlinNativeDemo/ViewController.swift new file mode 100644 index 0000000..2e5f989 --- /dev/null +++ b/native/KotlinNativeDemo/ViewController.swift @@ -0,0 +1,28 @@ +// +// ViewController.swift +// KotlinNativeDemo +// +// Created by Jonas Franz on 02.04.18. +// Copyright © 2018 Jonas Franz. All rights reserved. +// + +import UIKit +import KotlinDemoFramework + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + print(KDFPlatform().platform()) + // Do any additional setup after loading the view, typically from a nib. + + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} + diff --git a/native/build.gradle b/native/build.gradle index c04806c..8bc2699 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -5,6 +5,10 @@ konanArtifacts { enableMultiplatform true } + framework('KotlinDemoFramework', targets: ['iphone', 'iphone_sim']) { + enableMultiplatform true + } + program('native-test') { srcDir 'src/test/kotlin' commonSourceSet 'test'