Setup iOS platform correctly
This commit is contained in:
parent
40ca00e470
commit
d51ad29b3a
|
@ -11,6 +11,15 @@ kotlin {
|
||||||
kotlinOptions.jvmTarget = "1.8"
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ios {
|
||||||
|
binaries {
|
||||||
|
framework {
|
||||||
|
baseName = "EpcQrCode"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
js {
|
js {
|
||||||
browser {
|
browser {
|
||||||
testTask {
|
testTask {
|
||||||
|
@ -21,6 +30,12 @@ kotlin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
js("nodeJs") {
|
||||||
|
nodejs {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val hostOs = System.getProperty("os.name")
|
val hostOs = System.getProperty("os.name")
|
||||||
val isMingwX64 = hostOs.startsWith("Windows")
|
val isMingwX64 = hostOs.startsWith("Windows")
|
||||||
val nativeTarget = when {
|
val nativeTarget = when {
|
||||||
|
@ -30,26 +45,7 @@ kotlin {
|
||||||
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
|
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
js("nodeJs") {
|
|
||||||
nodejs {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
iosArm64 {
|
|
||||||
binaries {
|
|
||||||
framework {
|
|
||||||
baseName = "EpcQrCode"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
iosX64 {
|
|
||||||
binaries {
|
|
||||||
framework {
|
|
||||||
baseName = "EpcQrCode"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
val commonMain by getting
|
val commonMain by getting
|
||||||
val commonTest by getting {
|
val commonTest by getting {
|
||||||
|
@ -58,32 +54,38 @@ kotlin {
|
||||||
implementation(kotlin("test-annotations-common"))
|
implementation(kotlin("test-annotations-common"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val jvmMain by getting
|
val jvmMain by getting
|
||||||
val jvmTest by getting {
|
val jvmTest by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("test-junit"))
|
implementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val iosMain by getting
|
||||||
|
val iosTest by getting
|
||||||
|
|
||||||
val jsMain by getting
|
val jsMain by getting
|
||||||
val jsTest by getting {
|
val jsTest by getting {
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("test-js"))
|
implementation(kotlin("test-js"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val nativeMain by getting
|
|
||||||
val nativeTest by getting
|
|
||||||
val nodeJsMain by getting
|
val nodeJsMain by getting
|
||||||
val nodeJsTest by getting
|
val nodeJsTest by getting
|
||||||
val iosArm64Main by getting
|
|
||||||
val iosArm64Test by getting
|
val nativeMain by getting
|
||||||
val iosX64Main by getting
|
val nativeTest by getting
|
||||||
val iosX64Test by getting
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val packForXcode by tasks.creating(Sync::class) {
|
val packForXcode by tasks.creating(Sync::class) {
|
||||||
group = "build"
|
group = "build"
|
||||||
val mode = System.getenv("CONFIGURATION") ?: "DEBUG"
|
val mode = System.getenv("CONFIGURATION") ?: "DEBUG"
|
||||||
val framework = kotlin.targets.getByName<KotlinNativeTarget>("iosArm64").binaries.getFramework(mode)
|
val sdkName = System.getenv("SDK_NAME") ?: "iphonesimulator"
|
||||||
|
val targetName = "ios" + if (sdkName.startsWith("iphoneos")) "Arm64" else "X64"
|
||||||
|
val framework = kotlin.targets.getByName<KotlinNativeTarget>(targetName).binaries.getFramework(mode)
|
||||||
inputs.property("mode", mode)
|
inputs.property("mode", mode)
|
||||||
dependsOn(framework.linkTask)
|
dependsOn(framework.linkTask)
|
||||||
val targetDir = File(buildDir, "xcode-frameworks")
|
val targetDir = File(buildDir, "xcode-frameworks")
|
||||||
|
|
|
@ -485,6 +485,7 @@
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
DEVELOPMENT_ASSET_PATHS = "\"EpcQrCodeiOSApp/Preview Content\"";
|
DEVELOPMENT_ASSET_PATHS = "\"EpcQrCodeiOSApp/Preview Content\"";
|
||||||
|
DEVELOPMENT_TEAM = 7WVYN7QA7Z;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../EpcQrCode/build/xcode-frameworks";
|
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../EpcQrCode/build/xcode-frameworks";
|
||||||
INFOPLIST_FILE = EpcQrCodeiOSApp/Info.plist;
|
INFOPLIST_FILE = EpcQrCodeiOSApp/Info.plist;
|
||||||
|
@ -492,7 +493,8 @@
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = orgIdentifier.EpcQrCodeiOSApp;
|
MARKETING_VERSION = 1.0.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = net.codinux.banking.epcqrcode.ios;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
@ -505,6 +507,7 @@
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
DEVELOPMENT_ASSET_PATHS = "\"EpcQrCodeiOSApp/Preview Content\"";
|
DEVELOPMENT_ASSET_PATHS = "\"EpcQrCodeiOSApp/Preview Content\"";
|
||||||
|
DEVELOPMENT_TEAM = 7WVYN7QA7Z;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../EpcQrCode/build/xcode-frameworks";
|
FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/../EpcQrCode/build/xcode-frameworks";
|
||||||
INFOPLIST_FILE = EpcQrCodeiOSApp/Info.plist;
|
INFOPLIST_FILE = EpcQrCodeiOSApp/Info.plist;
|
||||||
|
@ -512,7 +515,8 @@
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = orgIdentifier.EpcQrCodeiOSApp;
|
MARKETING_VERSION = 1.0.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = net.codinux.banking.epcqrcode.ios;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
import EpcQrCode
|
||||||
|
|
||||||
|
|
||||||
struct ContentView: View {
|
struct ContentView: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Text("Hello, World!")
|
Text(MppTest().showMessage())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0</string>
|
<string>$(MARKETING_VERSION)</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>1</string>
|
<string>1</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
|
Loading…
Reference in New Issue