From e0647e6aa20587432ab712e9ab4fda2d95c0a297 Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov Date: Wed, 12 Jul 2023 19:58:36 +0200 Subject: [PATCH 1/2] Replace cocoapods with regular framework --- .gitignore | 3 -- gradle.properties | 3 +- iosApp/Podfile | 5 -- iosApp/iosApp.xcodeproj/project.pbxproj | 72 ++++++++++--------------- settings.gradle.kts | 5 +- shared/build.gradle.kts | 19 +++---- 6 files changed, 37 insertions(+), 70 deletions(-) delete mode 100644 iosApp/Podfile diff --git a/.gitignore b/.gitignore index 6e5f304..98816d3 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,6 @@ build/ /captures .externalNativeBuild .cxx -iosApp/Podfile.lock -iosApp/Pods/* iosApp/iosApp.xcworkspace/* iosApp/iosApp.xcodeproj/* !iosApp/iosApp.xcodeproj/project.pbxproj -shared/shared.podspec diff --git a/gradle.properties b/gradle.properties index f753e06..ae7f399 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,6 @@ kotlin.mpp.androidSourceSetLayoutVersion=2 #Compose org.jetbrains.compose.experimental.uikit.enabled=true -kotlin.native.cacheKind=none #Android android.useAndroidX=true @@ -22,4 +21,4 @@ android.minSdk=24 #Versions kotlin.version=1.9.0 agp.version=7.4.2 -compose.version=1.4.3 \ No newline at end of file +compose.version=1.5.0-beta02 \ No newline at end of file diff --git a/iosApp/Podfile b/iosApp/Podfile deleted file mode 100644 index aff9c51..0000000 --- a/iosApp/Podfile +++ /dev/null @@ -1,5 +0,0 @@ -target 'iosApp' do - use_frameworks! - platform :ios, '14.1' - pod 'shared', :path => '../shared' -end \ No newline at end of file diff --git a/iosApp/iosApp.xcodeproj/project.pbxproj b/iosApp/iosApp.xcodeproj/project.pbxproj index df8fc26..c852042 100644 --- a/iosApp/iosApp.xcodeproj/project.pbxproj +++ b/iosApp/iosApp.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ @@ -11,20 +11,16 @@ 058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; }; 2152FB042600AC8F00CF470E /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2152FB032600AC8F00CF470E /* iOSApp.swift */; }; 7555FF83242A565900829871 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7555FF82242A565900829871 /* ContentView.swift */; }; - CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = ""; }; - 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.debug.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.debug.xcconfig"; sourceTree = ""; }; - 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_iosApp.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 7555FF7B242A565900829871 /* My application.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "My application.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = ""; }; - FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iosApp.release.xcconfig"; path = "Target Support Files/Pods-iosApp/Pods-iosApp.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -32,7 +28,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - CFDB58B53BB94DE262B13C24 /* Pods_iosApp.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -50,7 +45,6 @@ 42799AB246E5F90AF97AA0EF /* Frameworks */ = { isa = PBXGroup; children = ( - 6B1049432C0C2B312090ABF6 /* Pods_iosApp.framework */, ); name = Frameworks; sourceTree = ""; @@ -61,7 +55,6 @@ AB1DB47929225F7C00F7AF9C /* Configuration */, 7555FF7D242A565900829871 /* iosApp */, 7555FF7C242A565900829871 /* Products */, - FEFF387C0A8D172AA4D59CAE /* Pods */, 42799AB246E5F90AF97AA0EF /* Frameworks */, ); sourceTree = ""; @@ -94,15 +87,6 @@ path = Configuration; sourceTree = ""; }; - FEFF387C0A8D172AA4D59CAE /* Pods */ = { - isa = PBXGroup; - children = ( - 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */, - FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -110,11 +94,10 @@ isa = PBXNativeTarget; buildConfigurationList = 7555FFA5242A565B00829871 /* Build configuration list for PBXNativeTarget "iosApp" */; buildPhases = ( - 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */, + 05D91A912A5EF49C00F138EB /* Compile Kotlin */, 7555FF77242A565900829871 /* Sources */, 7555FF79242A565900829871 /* Resources */, F85CB1118929364A9C6EFABC /* Frameworks */, - 2134C13603D0B299603D9F49 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -171,24 +154,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 2134C13603D0B299603D9F49 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iosApp/Pods-iosApp-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 98D614C51D2DA07C614CC46E /* [CP] Check Pods Manifest.lock */ = { + 05D91A912A5EF49C00F138EB /* Compile Kotlin */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -196,19 +162,15 @@ inputFileListPaths = ( ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", ); - name = "[CP] Check Pods Manifest.lock"; + name = "Compile Kotlin"; outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-iosApp-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; + shellScript = "cd \"$SRCROOT/..\"\n./gradlew :shared:embedAndSignAppleFrameworkForXcode\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -345,7 +307,6 @@ }; 7555FFA6242A565B00829871 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4FF3202A603A284706412EDC /* Pods-iosApp.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; @@ -353,12 +314,23 @@ DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)\n", + "$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\n", + ); INFOPLIST_FILE = iosApp/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.1; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); + OTHER_LDFLAGS = ( + "$(inherited)", + "-framework", + "shared\n$(inherited)", + "-framework", + "shared\n", + ); PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -369,7 +341,6 @@ }; 7555FFA7242A565B00829871 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = FF8CA3F5360CEAB49D74065F /* Pods-iosApp.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; @@ -377,12 +348,23 @@ DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\""; DEVELOPMENT_TEAM = "${TEAM_ID}"; ENABLE_PREVIEWS = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)\n", + "$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)\n", + ); INFOPLIST_FILE = iosApp/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.1; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); + OTHER_LDFLAGS = ( + "$(inherited)", + "-framework", + "shared\n$(inherited)", + "-framework", + "shared\n", + ); PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}"; PRODUCT_NAME = "${APP_NAME}"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/settings.gradle.kts b/settings.gradle.kts index 85648e3..9342167 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -6,8 +6,9 @@ include(":shared") pluginManagement { repositories { gradlePluginPortal() - maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") + mavenCentral() google() + maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") } plugins { @@ -28,8 +29,8 @@ pluginManagement { dependencyResolutionManagement { repositories { - google() mavenCentral() + google() maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") } } diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 24b8e1c..5252806 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -1,6 +1,5 @@ plugins { kotlin("multiplatform") - kotlin("native.cocoapods") id("com.android.library") id("org.jetbrains.compose") } @@ -8,21 +7,15 @@ plugins { kotlin { androidTarget() - iosX64() - iosArm64() - iosSimulatorArm64() - - cocoapods { - version = "1.0.0" - summary = "Some description for the Shared Module" - homepage = "Link to the Shared Module homepage" - ios.deploymentTarget = "14.1" - podfile = project.file("../iosApp/Podfile") - framework { + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64() + ).forEach { iosTarget -> + iosTarget.binaries.framework { baseName = "shared" isStatic = true } - extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']" } sourceSets { From 2c96d18c7b25cf3e58824bcbdd39adccf4181ceb Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov Date: Fri, 18 Aug 2023 16:17:57 +0200 Subject: [PATCH 2/2] Update to 1.5.0-rc01 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index ae7f399..f25548b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,4 +21,4 @@ android.minSdk=24 #Versions kotlin.version=1.9.0 agp.version=7.4.2 -compose.version=1.5.0-beta02 \ No newline at end of file +compose.version=1.5.0-rc01 \ No newline at end of file