diff --git a/README.md b/README.md index 0a8d863a..12e0c017 100755 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ buildscript { } dependencies { - classpath "dev.icerock.moko:resources-generator:0.19.1" + classpath "dev.icerock.moko:resources-generator:0.20.0" } } @@ -63,10 +63,10 @@ project build.gradle apply plugin: "dev.icerock.mobile.multiplatform-resources" dependencies { - commonMainApi("dev.icerock.moko:resources:0.19.1") - androidMainApi("dev.icerock.moko:resources-compose:0.19.1") - jvmMainApi("dev.icerock.moko:resources-compose:0.19.1") - commonTestImplementation("dev.icerock.moko:resources-test:0.19.1") + commonMainApi("dev.icerock.moko:resources:0.20.0") + androidMainApi("dev.icerock.moko:resources-compose:0.20.0") + jvmMainApi("dev.icerock.moko:resources-compose:0.20.0") + commonTestImplementation("dev.icerock.moko:resources-test:0.20.0") } multiplatformResources { @@ -135,6 +135,18 @@ you also need to pass extra properties: -Pkotlin.native.cocoapods.configuration=$CONFIGURATION ``` +### iOS executable +When you use `executable` kotlin target you should add custom build phase to xcode, after kotlin +compilation: +```shell +"$SRCROOT/../gradlew" -p "$SRCROOT/../" :shared:copyResourcesDebugExecutableIosSimulatorArm64 \ + -Pmoko.resources.BUILT_PRODUCTS_DIR=$BUILT_PRODUCTS_DIR \ + -Pmoko.resources.CONTENTS_FOLDER_PATH=$CONTENTS_FOLDER_PATH +``` +`copyResourcesDebugExecutableIosSimulatorArm64` should be configured depends on target. + +Configured sample you can see in `sample/ios-app` - `TestKotlinApp` target + ## Usage ### Example 1 - simple localization string The first step is a create a file `strings.xml` in `commonMain/resources/MR/base` with the following content: diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index e59e0ca0..6628fb1b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -36,8 +36,8 @@ robolectricVersion = "4.7.3" mokoGraphicsVersion = "0.9.0" mokoParcelizeVersion = "0.8.0" mokoTestVersion = "0.5.0" -mokoResourcesVersion = "0.19.1" -mokoMultiplatformPluginVersion = "0.13.0" +mokoResourcesVersion = "0.20.0" +mokoMultiplatformPluginVersion = "0.14.1" [libraries] # kotlinx diff --git a/resources-generator/src/main/kotlin/dev/icerock/gradle/generator/apple/AppleMRGenerator.kt b/resources-generator/src/main/kotlin/dev/icerock/gradle/generator/apple/AppleMRGenerator.kt index 990ef1be..f80be641 100644 --- a/resources-generator/src/main/kotlin/dev/icerock/gradle/generator/apple/AppleMRGenerator.kt +++ b/resources-generator/src/main/kotlin/dev/icerock/gradle/generator/apple/AppleMRGenerator.kt @@ -12,6 +12,7 @@ import com.squareup.kotlinpoet.STRING import com.squareup.kotlinpoet.TypeSpec import dev.icerock.gradle.MultiplatformResourcesPluginExtension import dev.icerock.gradle.generator.MRGenerator +import dev.icerock.gradle.tasks.CopyExecutableResourcesToApp import dev.icerock.gradle.tasks.CopyFrameworkResourcesToAppEntryPointTask import dev.icerock.gradle.tasks.CopyFrameworkResourcesToAppTask import dev.icerock.gradle.utils.calculateResourcesHash @@ -19,11 +20,13 @@ import org.gradle.api.Action import org.gradle.api.Project import org.gradle.api.Task import org.gradle.api.plugins.ExtensionAware +import org.gradle.kotlin.dsl.create import org.gradle.kotlin.dsl.findByType import org.gradle.kotlin.dsl.getByType import org.gradle.kotlin.dsl.withType import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension import org.jetbrains.kotlin.gradle.plugin.cocoapods.CocoapodsExtension +import org.jetbrains.kotlin.gradle.plugin.mpp.AbstractExecutable import org.jetbrains.kotlin.gradle.plugin.mpp.AbstractKotlinNativeCompilation import org.jetbrains.kotlin.gradle.plugin.mpp.Framework import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget @@ -90,6 +93,7 @@ class AppleMRGenerator( ) override fun apply(generationTask: Task, project: Project) { + createCopyResourcesToAppTask(project) setupKLibResources(generationTask) setupFrameworkResources() setupTestsResources() @@ -183,7 +187,6 @@ class AppleMRGenerator( linkTask.doLast(object : Action { override fun execute(task: Task) { task as KotlinNativeLink - copyKlibsResourcesIntoFramework(task) } }) @@ -234,7 +237,7 @@ $linkTask produces static framework, Xcode should have Build Phase with copyFram target = outputDir, overwrite = true ) - } catch (exc: kotlin.io.NoSuchFileException) { + } catch (exc: NoSuchFileException) { project.logger.info("resources in $inputFile not found") } catch (exc: java.nio.file.NoSuchFileException) { project.logger.info("resources in $inputFile not found (empty lib)") @@ -242,6 +245,29 @@ $linkTask produces static framework, Xcode should have Build Phase with copyFram } } + private fun createCopyResourcesToAppTask(project: Project) { + project.tasks.withType() + .matching { linkTask -> linkTask.binary is AbstractExecutable } + .all { linkTask -> + val copyTaskName = linkTask.name.replace("link", "copyResources") + + if (linkTask.project.tasks.any { it.name == copyTaskName }) return@all + + project.files(linkTask.intermediateLibrary) + + val copyResources = linkTask.project.tasks + .create(copyTaskName, CopyExecutableResourcesToApp::class) { + val libraries = linkTask.libraries + .plus(project.files(linkTask.intermediateLibrary)) + .filter { library -> library.extension == "klib" } + .filter(File::exists) + + it.libraries = libraries + } + copyResources.dependsOn(linkTask) + } + } + private fun createCopyFrameworkResourcesTask(linkTask: KotlinNativeLink) { val framework = linkTask.binary as Framework val project = linkTask.project diff --git a/resources-generator/src/main/kotlin/dev/icerock/gradle/tasks/CopyExecutableResourcesToApp.kt b/resources-generator/src/main/kotlin/dev/icerock/gradle/tasks/CopyExecutableResourcesToApp.kt new file mode 100644 index 00000000..e9cdef12 --- /dev/null +++ b/resources-generator/src/main/kotlin/dev/icerock/gradle/tasks/CopyExecutableResourcesToApp.kt @@ -0,0 +1,49 @@ +/* + * Copyright 2022 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. + */ + +package dev.icerock.gradle.tasks + +import org.gradle.api.DefaultTask +import org.gradle.api.file.FileCollection +import org.gradle.api.tasks.Internal +import org.gradle.api.tasks.TaskAction +import org.jetbrains.kotlin.library.impl.KotlinLibraryLayoutImpl +import java.io.File +import java.io.FileFilter + +open class CopyExecutableResourcesToApp : DefaultTask() { + @get:Internal + lateinit var libraries: FileCollection + + @TaskAction + fun copyResources() { + val buildProductsDir = + File(project.property("moko.resources.BUILT_PRODUCTS_DIR") as String) + val contentsFolderPath = + project.property("moko.resources.CONTENTS_FOLDER_PATH") as String + + val outputDir = File(buildProductsDir, contentsFolderPath) + + libraries + .filter { it.extension == "klib" } + .filter { it.exists() } + .forEach { inputFile -> + val klibKonan = org.jetbrains.kotlin.konan.file.File(inputFile.path) + val klib = KotlinLibraryLayoutImpl(klib = klibKonan, component = "default") + val layout = klib.extractingToTemp + + // extracting bundles + layout + .resourcesDir + .absolutePath + .let(::File) + .listFiles(FileFilter { it.extension == "bundle" }) + // copying bundles to app + ?.forEach { + logger.info("${it.absolutePath} copying to $outputDir") + it.copyRecursively(target = File(outputDir, it.name), overwrite = true) + } + } + } +} diff --git a/sample/ios-app/Podfile.lock b/sample/ios-app/Podfile.lock index 9f5c7381..1c3fdd0c 100644 --- a/sample/ios-app/Podfile.lock +++ b/sample/ios-app/Podfile.lock @@ -14,8 +14,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: mpp_hierarhical: 8ea2466bf26a2cf59d466e44ab634b755c435f07 - MultiPlatformLibrary: b3a7ad5042414b79af4b469037a116eae383fb08 + MultiPlatformLibrary: 2a9f43df7bd018c32611a2087c1e2ef74847394c PODFILE CHECKSUM: f0c3cdabcc5ee37fe65b6ecd54b1f04017dbea93 -COCOAPODS: 1.11.2 +COCOAPODS: 1.11.3 diff --git a/sample/ios-app/TestKotlinApp/Assets.xcassets/AccentColor.colorset/Contents.json b/sample/ios-app/TestKotlinApp/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/sample/ios-app/TestKotlinApp/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/sample/ios-app/TestKotlinApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/sample/ios-app/TestKotlinApp/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 00000000..9221b9bb --- /dev/null +++ b/sample/ios-app/TestKotlinApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/sample/ios-app/TestKotlinApp/Assets.xcassets/Contents.json b/sample/ios-app/TestKotlinApp/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/sample/ios-app/TestKotlinApp/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/sample/ios-app/TestKotlinApp/Base.lproj/LaunchScreen.storyboard b/sample/ios-app/TestKotlinApp/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..f25e499e --- /dev/null +++ b/sample/ios-app/TestKotlinApp/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/ios-app/TestKotlinApp/Info.plist b/sample/ios-app/TestKotlinApp/Info.plist new file mode 100644 index 00000000..0c67376e --- /dev/null +++ b/sample/ios-app/TestKotlinApp/Info.plist @@ -0,0 +1,5 @@ + + + + + diff --git a/sample/ios-app/TestKotlinApp/Main.storyboard b/sample/ios-app/TestKotlinApp/Main.storyboard new file mode 100644 index 00000000..055dd23e --- /dev/null +++ b/sample/ios-app/TestKotlinApp/Main.storyboard @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sample/ios-app/TestProj.xcodeproj/project.pbxproj b/sample/ios-app/TestProj.xcodeproj/project.pbxproj index 4a446b43..2e987632 100644 --- a/sample/ios-app/TestProj.xcodeproj/project.pbxproj +++ b/sample/ios-app/TestProj.xcodeproj/project.pbxproj @@ -24,6 +24,9 @@ 45F47921219463C7003D25FA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 45F4791A219463C7003D25FA /* Assets.xcassets */; }; 45F47922219463C7003D25FA /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45F4791B219463C7003D25FA /* AppDelegate.swift */; }; 77E5CCB183FB7BECF0D06678 /* Pods_TestHierarhical.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E7D09DAA14D4E64CD328EA9F /* Pods_TestHierarhical.framework */; }; + 7FCA39CB27F7B39800F4BB5B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7FCA39CA27F7B39800F4BB5B /* Main.storyboard */; }; + 7FD0DE8A27F45B08007F61A3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7FD0DE8927F45B08007F61A3 /* Assets.xcassets */; }; + 7FD0DE8D27F45B08007F61A3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7FD0DE8B27F45B08007F61A3 /* LaunchScreen.storyboard */; }; D12E949B70B48B1C73348710 /* Pods_TestProj.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 42EFA3EC31648151F2443F9D /* Pods_TestProj.framework */; }; /* End PBXBuildFile section */ @@ -53,6 +56,11 @@ 45F4791B219463C7003D25FA /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 45F4791C219463C7003D25FA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 6DE60CC1CE316F8CDC57E298 /* Pods-TestProj.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestProj.debug.xcconfig"; path = "Target Support Files/Pods-TestProj/Pods-TestProj.debug.xcconfig"; sourceTree = ""; }; + 7FCA39CA27F7B39800F4BB5B /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; + 7FD0DE7E27F45B06007F61A3 /* TestKotlinApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TestKotlinApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 7FD0DE8927F45B08007F61A3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 7FD0DE8C27F45B08007F61A3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 7FD0DE8E27F45B08007F61A3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A7AD8930FE9B24AEF6764C82 /* Pods-TestProj.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestProj.release.xcconfig"; path = "Target Support Files/Pods-TestProj/Pods-TestProj.release.xcconfig"; sourceTree = ""; }; C206BEEE1686BE166DF8AEC5 /* Pods-TestProj.stage.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestProj.stage.xcconfig"; path = "Target Support Files/Pods-TestProj/Pods-TestProj.stage.xcconfig"; sourceTree = ""; }; E4FC930E788011F7BBD38E8B /* Pods-TestHierarhical.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TestHierarhical.release.xcconfig"; path = "Target Support Files/Pods-TestHierarhical/Pods-TestHierarhical.release.xcconfig"; sourceTree = ""; }; @@ -85,6 +93,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 7FD0DE7B27F45B06007F61A3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -115,6 +130,7 @@ 45F47910219463C7003D25FA /* src */, 453177DB25020C530072545B /* TestHierarhical */, 22BE0C62279C026700CDA47A /* TestStaticXCFramework */, + 7FD0DE7F27F45B06007F61A3 /* TestKotlinApp */, 287628001F319065007FA12B /* Products */, 7CE340ED7AD97B012428C7FF /* Pods */, F139545F1315882E0F40C609 /* Frameworks */, @@ -130,6 +146,7 @@ 287627FF1F319065007FA12B /* mokoSampleResources.app */, 453177DA25020C530072545B /* TestHierarhical.app */, 22BE0C61279C026700CDA47A /* TestStaticXCFramework.app */, + 7FD0DE7E27F45B06007F61A3 /* TestKotlinApp.app */, ); name = Products; sourceTree = ""; @@ -182,6 +199,17 @@ path = Pods; sourceTree = ""; }; + 7FD0DE7F27F45B06007F61A3 /* TestKotlinApp */ = { + isa = PBXGroup; + children = ( + 7FD0DE8927F45B08007F61A3 /* Assets.xcassets */, + 7FD0DE8B27F45B08007F61A3 /* LaunchScreen.storyboard */, + 7FD0DE8E27F45B08007F61A3 /* Info.plist */, + 7FCA39CA27F7B39800F4BB5B /* Main.storyboard */, + ); + path = TestKotlinApp; + sourceTree = ""; + }; F139545F1315882E0F40C609 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -221,7 +249,7 @@ 287627FB1F319065007FA12B /* Sources */, 287627FC1F319065007FA12B /* Frameworks */, 287627FD1F319065007FA12B /* Resources */, - 50C0EB62D0124637A2F6DB8A /* [CP] Embed Pods Frameworks */, + 60469B5D01E4CFA464625DE0 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -251,13 +279,31 @@ productReference = 453177DA25020C530072545B /* TestHierarhical.app */; productType = "com.apple.product-type.application"; }; + 7FD0DE7D27F45B06007F61A3 /* TestKotlinApp */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7FD0DE8F27F45B08007F61A3 /* Build configuration list for PBXNativeTarget "TestKotlinApp" */; + buildPhases = ( + 7FD0DE9327F45EB2007F61A3 /* Compile Kotlin */, + 7FD0DE7B27F45B06007F61A3 /* Frameworks */, + 7FD0DE7C27F45B06007F61A3 /* Resources */, + 7F0DF74627F4A39A008C9F52 /* mokoResources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TestKotlinApp; + productName = TestKotlinApp; + productReference = 7FD0DE7E27F45B06007F61A3 /* TestKotlinApp.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 287627F71F319065007FA12B /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1310; + LastSwiftUpdateCheck = 1320; LastUpgradeCheck = 0830; ORGANIZATIONNAME = "IceRock Development"; TargetAttributes = { @@ -271,6 +317,9 @@ 453177D925020C530072545B = { CreatedOnToolsVersion = 11.6; }; + 7FD0DE7D27F45B06007F61A3 = { + CreatedOnToolsVersion = 13.2.1; + }; }; }; buildConfigurationList = 287627FA1F319065007FA12B /* Build configuration list for PBXProject "TestProj" */; @@ -291,6 +340,7 @@ 287627FE1F319065007FA12B /* TestProj */, 453177D925020C530072545B /* TestHierarhical */, 22BE0C60279C026700CDA47A /* TestStaticXCFramework */, + 7FD0DE7D27F45B06007F61A3 /* TestKotlinApp */, ); }; /* End PBXProject section */ @@ -325,6 +375,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 7FD0DE7C27F45B06007F61A3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7FD0DE8D27F45B08007F61A3 /* LaunchScreen.storyboard in Resources */, + 7FD0DE8A27F45B08007F61A3 /* Assets.xcassets in Resources */, + 7FCA39CB27F7B39800F4BB5B /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -428,7 +488,7 @@ shellPath = /bin/sh; shellScript = "\"$SRCROOT/../gradlew\" -p \"$SRCROOT/../../\" :sample:mpp-hierarhical:copyFrameworkResourcesToApp \\\n -Pmoko.resources.PLATFORM_NAME=$PLATFORM_NAME \\\n -Pmoko.resources.CONFIGURATION=$CONFIGURATION \\\n -Pmoko.resources.BUILT_PRODUCTS_DIR=$BUILT_PRODUCTS_DIR \\\n -Pmoko.resources.CONTENTS_FOLDER_PATH=$CONTENTS_FOLDER_PATH\n"; }; - 50C0EB62D0124637A2F6DB8A /* [CP] Embed Pods Frameworks */ = { + 60469B5D01E4CFA464625DE0 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -443,6 +503,44 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TestProj/Pods-TestProj-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; + 7F0DF74627F4A39A008C9F52 /* mokoResources */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = mokoResources; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$SRCROOT/../gradlew\" -p \"$SRCROOT/../\" :sample:ios-kotlin-app:copyResourcesDebugExecutableIosSimulatorArm64 \\\n -Pmoko.resources.BUILT_PRODUCTS_DIR=$BUILT_PRODUCTS_DIR \\\n -Pmoko.resources.CONTENTS_FOLDER_PATH=$CONTENTS_FOLDER_PATH\n"; + }; + 7FD0DE9327F45EB2007F61A3 /* Compile Kotlin */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Compile Kotlin"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "cd ..\n\n./gradlew linkDebugExecutableIosSimulatorArm64\n\ncp ios-kotlin-app/build/bin/iosSimulatorArm64/debugExecutable/ios-kotlin-app.kexe \"$TARGET_BUILD_DIR/$EXECUTABLE_PATH\"\n"; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -509,6 +607,14 @@ name = Main.storyboard; sourceTree = ""; }; + 7FD0DE8B27F45B08007F61A3 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 7FD0DE8C27F45B08007F61A3 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ @@ -1048,6 +1154,236 @@ }; name = Release; }; + 7FD0DE9027F45B08007F61A3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + 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; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = TestKotlinApp/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = dev.icerock.moko.resources.TestKotlinApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 7FD0DE9127F45B08007F61A3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + 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; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = TestKotlinApp/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = dev.icerock.moko.resources.TestKotlinApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 7FD0DE9227F45B08007F61A3 /* Stage */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + 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; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = TestKotlinApp/Info.plist; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = dev.icerock.moko.resources.TestKotlinApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Stage; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1091,6 +1427,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 7FD0DE8F27F45B08007F61A3 /* Build configuration list for PBXNativeTarget "TestKotlinApp" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7FD0DE9027F45B08007F61A3 /* Debug */, + 7FD0DE9127F45B08007F61A3 /* Release */, + 7FD0DE9227F45B08007F61A3 /* Stage */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 287627F71F319065007FA12B /* Project object */; diff --git a/sample/ios-kotlin-app/build.gradle.kts b/sample/ios-kotlin-app/build.gradle.kts new file mode 100644 index 00000000..322f536c --- /dev/null +++ b/sample/ios-kotlin-app/build.gradle.kts @@ -0,0 +1,46 @@ +/* + * Copyright 2019 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. + */ + +plugins { + kotlin("multiplatform") + id("dev.icerock.mobile.multiplatform-resources") + id("detekt-convention") +} + +kotlin { + val iosArm64 = iosArm64() + val iosSimulatorArm64 = iosSimulatorArm64() + val iosX64 = iosX64() + configure(listOf(iosArm64, iosSimulatorArm64, iosX64)) { + binaries { + executable { + entryPoint = "main" + } + } + } + + sourceSets { + val commonMain by getting + val iosMain by creating { + dependsOn(commonMain) + } + val iosArm64Main by getting { + dependsOn(iosMain) + } + val iosSimulatorArm64Main by getting { + dependsOn(iosMain) + } + val iosX64Main by getting { + dependsOn(iosMain) + } + } +} + +dependencies { + commonMainImplementation(projects.sample.mppLibrary) +} + +multiplatformResources { + multiplatformResourcesPackage = "com.icerockdev.app" +} diff --git a/sample/ios-kotlin-app/src/iosMain/kotlin/AppDelegate.kt b/sample/ios-kotlin-app/src/iosMain/kotlin/AppDelegate.kt new file mode 100644 index 00000000..702ac240 --- /dev/null +++ b/sample/ios-kotlin-app/src/iosMain/kotlin/AppDelegate.kt @@ -0,0 +1,37 @@ +import platform.UIKit.UIApplication +import platform.UIKit.UIApplicationDelegateProtocol +import platform.UIKit.UIApplicationDelegateProtocolMeta +import platform.UIKit.UIResponder +import platform.UIKit.UIResponderMeta +import platform.UIKit.UIScreen +import platform.UIKit.UIStoryboard +import platform.UIKit.UIWindow + +class AppDelegate : UIResponder, UIApplicationDelegateProtocol { + companion object : UIResponderMeta(), UIApplicationDelegateProtocolMeta + + @OverrideInit + constructor() : super() + + private var _window: UIWindow? = null + override fun window() = _window + override fun setWindow(window: UIWindow?) { + _window = window + } + + override fun application( + application: UIApplication, + didFinishLaunchingWithOptions: Map? + ): Boolean { + window = UIWindow(frame = UIScreen.mainScreen.bounds).apply { + screen = UIScreen.mainScreen + val storyboard = UIStoryboard.storyboardWithName(name = "Main", bundle = null) + val initialViewController = storyboard.instantiateViewControllerWithIdentifier( + identifier = "LabelViewController" + ) + rootViewController = initialViewController + makeKeyAndVisible() + } + return true + } +} diff --git a/sample/ios-kotlin-app/src/iosMain/kotlin/LabelViewController.kt b/sample/ios-kotlin-app/src/iosMain/kotlin/LabelViewController.kt new file mode 100644 index 00000000..dd7540f7 --- /dev/null +++ b/sample/ios-kotlin-app/src/iosMain/kotlin/LabelViewController.kt @@ -0,0 +1,27 @@ +/* + * Copyright 2022 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. + */ + +import com.icerockdev.library.Testing +import kotlinx.cinterop.ExportObjCClass +import kotlinx.cinterop.ObjCOutlet +import platform.Foundation.NSCoder +import platform.UIKit.UILabel +import platform.UIKit.UIViewController +import platform.UIKit.UIViewControllerMeta + +@ExportObjCClass +class LabelViewController : UIViewController { + companion object Meta : UIViewControllerMeta() + + @ObjCOutlet + lateinit var resourcesLabel: UILabel + + @OverrideInit + constructor(coder: NSCoder) : super(coder) + + override fun viewDidLoad() { + super.viewDidLoad() + resourcesLabel.text = Testing.getStringDesc().localized() + } +} diff --git a/sample/ios-kotlin-app/src/iosMain/kotlin/main.kt b/sample/ios-kotlin-app/src/iosMain/kotlin/main.kt new file mode 100644 index 00000000..3dea467e --- /dev/null +++ b/sample/ios-kotlin-app/src/iosMain/kotlin/main.kt @@ -0,0 +1,17 @@ +import kotlinx.cinterop.autoreleasepool +import kotlinx.cinterop.cstr +import kotlinx.cinterop.memScoped +import kotlinx.cinterop.toCValues +import platform.Foundation.NSStringFromClass +import platform.UIKit.UIApplicationMain + +fun main() { + val args = emptyArray() + memScoped { + val argc = args.size + 1 + val argv = (arrayOf("MokoKotlinApp") + args).map { it.cstr.ptr }.toCValues() + autoreleasepool { + UIApplicationMain(argc, argv, null, NSStringFromClass(AppDelegate)) + } + } +} diff --git a/sample/mpp-hierarhical/mpp_hierarhical.podspec b/sample/mpp-hierarhical/mpp_hierarhical.podspec index 3de85f0f..4e6460f2 100644 --- a/sample/mpp-hierarhical/mpp_hierarhical.podspec +++ b/sample/mpp-hierarhical/mpp_hierarhical.podspec @@ -2,20 +2,24 @@ Pod::Spec.new do |spec| spec.name = 'mpp_hierarhical' spec.version = '1.0' spec.homepage = 'Link to a Kotlin/Native module homepage' - spec.source = { :http=> ''} + spec.source = { :git => "Not Published", :tag => "Cocoapods/#{spec.name}/#{spec.version}" } spec.authors = '' spec.license = '' spec.summary = 'Some description for a Kotlin/Native module' - spec.vendored_frameworks = 'build/cocoapods/framework/mpp_hierarhical.framework' - spec.libraries = 'c++' - + + spec.vendored_frameworks = "build/cocoapods/framework/mpp_hierarhical.framework" + spec.libraries = "c++" + spec.module_name = "#{spec.name}_umbrella" + + + spec.pod_target_xcconfig = { 'KOTLIN_PROJECT_PATH' => ':sample:mpp-hierarhical', 'PRODUCT_MODULE_NAME' => 'mpp_hierarhical', } - + spec.script_phases = [ { :name => 'Build mpp_hierarhical', @@ -31,9 +35,8 @@ Pod::Spec.new do |spec| "$REPO_ROOT/../../gradlew" -p "$REPO_ROOT" $KOTLIN_PROJECT_PATH:syncFramework \ -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \ -Pkotlin.native.cocoapods.archs="$ARCHS" \ - -Pkotlin.native.cocoapods.configuration="$CONFIGURATION" + -Pkotlin.native.cocoapods.configuration=$CONFIGURATION SCRIPT } ] - end \ No newline at end of file diff --git a/sample/web-app-compose/src/jsMain/kotlin/com/icerockdev/web/Main.kt b/sample/web-app-compose/src/jsMain/kotlin/com/icerockdev/web/Main.kt index 7f4010ad..b8e0da20 100644 --- a/sample/web-app-compose/src/jsMain/kotlin/com/icerockdev/web/Main.kt +++ b/sample/web-app-compose/src/jsMain/kotlin/com/icerockdev/web/Main.kt @@ -9,8 +9,6 @@ import androidx.compose.runtime.remember import com.icerockdev.library.MR import com.icerockdev.library.Testing import dev.icerock.moko.resources.ColorResource -import kotlinx.coroutines.coroutineScope -import kotlinx.coroutines.launch import org.jetbrains.compose.web.css.DisplayStyle import org.jetbrains.compose.web.css.FlexDirection import org.jetbrains.compose.web.css.color @@ -73,12 +71,9 @@ suspend fun main() { } } - coroutineScope { - launch { - fileText.value = Testing.getTextFile().getText() + "\n" + - Testing.getTextsFromAssets()[1].getText() - } - } + fileText.value = Testing.getTextFile().getText() + "\n" + + Testing.getTextsFromAssets()[1].getText() + "\n" + + MR.files.some.getText() println(Testing.getTextFile().fileUrl) } diff --git a/settings.gradle.kts b/settings.gradle.kts index 000b477d..f09e269a 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -38,3 +38,4 @@ include(":sample:mpp-mixed") include(":sample:jvm-app") include(":sample:web-app-compose") include(":sample:test-utils") +include(":sample:ios-kotlin-app")