diff --git a/androidFood2Fork/build.gradle.kts b/androidFood2Fork/build.gradle.kts index 9f966e8..31b5e69 100644 --- a/androidFood2Fork/build.gradle.kts +++ b/androidFood2Fork/build.gradle.kts @@ -7,11 +7,11 @@ plugins { } android { - compileSdkVersion(Application.compileSdk) + compileSdk = Application.compileSdk defaultConfig { applicationId = Application.appId - minSdkVersion(Application.minSdk) - targetSdkVersion(Application.targetSdk) + minSdk = Application.minSdk + targetSdk = Application.targetSdk versionCode = Application.versionCode versionName = Application.versionName } @@ -29,7 +29,6 @@ android { } kotlinOptions { jvmTarget = "1.8" - useIR = true } composeOptions { kotlinCompilerExtensionVersion = Compose.composeVersion @@ -63,14 +62,7 @@ dependencies { implementation(Kotlinx.datetime) - implementation(Ktor.android) + implementation(Ktor.clientCIO) debugImplementation(SquareUp.leakCanary) } - - - - - - - diff --git a/buildSrc/src/main/kotlin/Application.kt b/buildSrc/src/main/kotlin/Application.kt index 20c3750..16f5d6f 100644 --- a/buildSrc/src/main/kotlin/Application.kt +++ b/buildSrc/src/main/kotlin/Application.kt @@ -3,6 +3,6 @@ object Application { const val versionCode = 1 const val versionName = "1.0" const val minSdk = 21 - const val compileSdk = 30 + const val compileSdk = 31 const val targetSdk = 29 } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Build.kt b/buildSrc/src/main/kotlin/Build.kt index 8d713dc..053a269 100644 --- a/buildSrc/src/main/kotlin/Build.kt +++ b/buildSrc/src/main/kotlin/Build.kt @@ -1,5 +1,5 @@ object Build { - private const val gradleBuildTools = "7.1.0-alpha03" + private const val gradleBuildTools = "7.1.0" const val buildTools = "com.android.tools.build:gradle:${gradleBuildTools}" const val kotlinGradlePlugin = "org.jetbrains.kotlin:kotlin-gradle-plugin:${Kotlin.version}" const val sqlDelightGradlePlugin = "com.squareup.sqldelight:gradle-plugin:${SQLDelight.sqlDelightVersion}" diff --git a/buildSrc/src/main/kotlin/Compose.kt b/buildSrc/src/main/kotlin/Compose.kt index 2faccca..e7cb4a7 100644 --- a/buildSrc/src/main/kotlin/Compose.kt +++ b/buildSrc/src/main/kotlin/Compose.kt @@ -1,5 +1,5 @@ object Compose { - const val composeVersion = "1.0.0-beta09" + const val composeVersion = "1.1.0-rc01" const val runtime = "androidx.compose.runtime:runtime:${composeVersion}" const val runtimeLiveData = "androidx.compose.runtime:runtime-livedata:${composeVersion}" const val ui = "androidx.compose.ui:ui:${composeVersion}" diff --git a/buildSrc/src/main/kotlin/Hilt.kt b/buildSrc/src/main/kotlin/Hilt.kt index 6c38063..38c3e3a 100644 --- a/buildSrc/src/main/kotlin/Hilt.kt +++ b/buildSrc/src/main/kotlin/Hilt.kt @@ -1,5 +1,5 @@ object Hilt { - const val version = "2.37" + const val version = "2.40.5" const val hiltAndroid = "com.google.dagger:hilt-android:$version" const val hiltCompiler = "com.google.dagger:hilt-compiler:$version" diff --git a/buildSrc/src/main/kotlin/Kotlin.kt b/buildSrc/src/main/kotlin/Kotlin.kt index a67fe8b..887fe19 100644 --- a/buildSrc/src/main/kotlin/Kotlin.kt +++ b/buildSrc/src/main/kotlin/Kotlin.kt @@ -1,3 +1,3 @@ object Kotlin { - const val version = "1.5.10" + const val version = "1.6.0" } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Kotlinx.kt b/buildSrc/src/main/kotlin/Kotlinx.kt index 941d232..94ea454 100644 --- a/buildSrc/src/main/kotlin/Kotlinx.kt +++ b/buildSrc/src/main/kotlin/Kotlinx.kt @@ -1,4 +1,4 @@ object Kotlinx { - private const val kotlinxDatetimeVersion = "0.2.1" + private const val kotlinxDatetimeVersion = "0.3.2" const val datetime = "org.jetbrains.kotlinx:kotlinx-datetime:${kotlinxDatetimeVersion}" } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Ktor.kt b/buildSrc/src/main/kotlin/Ktor.kt index 8f7bd0e..7a36dc6 100644 --- a/buildSrc/src/main/kotlin/Ktor.kt +++ b/buildSrc/src/main/kotlin/Ktor.kt @@ -1,7 +1,11 @@ object Ktor { - private const val ktorVersion = "1.5.2" + private const val ktorVersion = "2.0.0-beta-1" const val core = "io.ktor:ktor-client-core:${ktorVersion}" - const val clientSerialization = "io.ktor:ktor-client-serialization:${ktorVersion}" - const val android = "io.ktor:ktor-client-android:${ktorVersion}" - const val ios = "io.ktor:ktor-client-ios:${ktorVersion}" + const val jsonSerialization = "io.ktor:ktor-serialization-kotlinx-json:${ktorVersion}" + const val contentNegotiation = "io.ktor:ktor-client-content-negotiation:${ktorVersion}" + const val clientCIO = "io.ktor:ktor-client-cio:${ktorVersion}" + const val clientDarwin = "io.ktor:ktor-client-darwin:${ktorVersion}" +// const val clientSerialization = "io.ktor:ktor-client-serialization:${ktorVersion}" +// const val android = "io.ktor:ktor-client-android:${ktorVersion}" +// const val ios = "io.ktor:ktor-client-ios:${ktorVersion}" } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/SQLDelight.kt b/buildSrc/src/main/kotlin/SQLDelight.kt index e689130..cee28bc 100644 --- a/buildSrc/src/main/kotlin/SQLDelight.kt +++ b/buildSrc/src/main/kotlin/SQLDelight.kt @@ -1,5 +1,5 @@ object SQLDelight { - const val sqlDelightVersion = "1.4.3" + const val sqlDelightVersion = "1.5.3" const val runtime = "com.squareup.sqldelight:runtime:${sqlDelightVersion}" const val androidDriver = "com.squareup.sqldelight:android-driver:${sqlDelightVersion}" const val nativeDriver = "com.squareup.sqldelight:native-driver:${sqlDelightVersion}" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 618db10..f077e75 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue Apr 27 12:58:23 PDT 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-rc-1-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME diff --git a/iosFood2Fork/Podfile.lock b/iosFood2Fork/Podfile.lock index 033783d..5c865b8 100644 --- a/iosFood2Fork/Podfile.lock +++ b/iosFood2Fork/Podfile.lock @@ -22,8 +22,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d SDWebImageSwiftUI: 8a3923c95108312b03a599ec1498754af55a6819 - shared: 29346581d099b8843a69aab157c4d0577c3c8287 + shared: 7b4d6aa8aa7ada5f9dae3229e2524d316cb9f063 PODFILE CHECKSUM: 9d85554c190eff2c79cf4349dccaaae321fe44fa -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.0 diff --git a/iosFood2Fork/Pods/Local Podspecs/shared.podspec.json b/iosFood2Fork/Pods/Local Podspecs/shared.podspec.json index d9caef0..2e951fb 100644 --- a/iosFood2Fork/Pods/Local Podspecs/shared.podspec.json +++ b/iosFood2Fork/Pods/Local Podspecs/shared.podspec.json @@ -9,7 +9,6 @@ "authors": "", "license": "", "summary": "Some description for the Shared Module", - "static_framework": true, "vendored_frameworks": "build/cocoapods/framework/shared.framework", "libraries": "c++", "module_name": "shared_umbrella", @@ -17,20 +16,15 @@ "ios": "14.1" }, "pod_target_xcconfig": { - "KOTLIN_TARGET[sdk=iphonesimulator*]": "ios_x64", - "KOTLIN_TARGET[sdk=iphoneos*]": "ios_arm", - "KOTLIN_TARGET[sdk=watchsimulator*]": "watchos_x64", - "KOTLIN_TARGET[sdk=watchos*]": "watchos_arm", - "KOTLIN_TARGET[sdk=appletvsimulator*]": "tvos_x64", - "KOTLIN_TARGET[sdk=appletvos*]": "tvos_arm64", - "KOTLIN_TARGET[sdk=macosx*]": "macos_x64" + "KOTLIN_PROJECT_PATH": ":shared", + "PRODUCT_MODULE_NAME": "shared" }, "script_phases": [ { "name": "Build shared", "execution_position": "before_compile", "shell_path": "/bin/sh", - "script": " set -ev\n REPO_ROOT=\"$PODS_TARGET_SRCROOT\"\n \"$REPO_ROOT/../gradlew\" -p \"$REPO_ROOT\" :shared:syncFramework -Pkotlin.native.cocoapods.target=$KOTLIN_TARGET -Pkotlin.native.cocoapods.configuration=$CONFIGURATION -Pkotlin.native.cocoapods.cflags=\"$OTHER_CFLAGS\" -Pkotlin.native.cocoapods.paths.headers=\"$HEADER_SEARCH_PATHS\" -Pkotlin.native.cocoapods.paths.frameworks=\"$FRAMEWORK_SEARCH_PATHS\"\n" + "script": " if [ \"YES\" = \"$COCOAPODS_SKIP_KOTLIN_BUILD\" ]; then\n echo \"Skipping Gradle build task invocation due to COCOAPODS_SKIP_KOTLIN_BUILD environment variable set to \"YES\"\"\n exit 0\n fi\n set -ev\n REPO_ROOT=\"$PODS_TARGET_SRCROOT\"\n \"$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\n" } ] } diff --git a/iosFood2Fork/Pods/Manifest.lock b/iosFood2Fork/Pods/Manifest.lock index 033783d..5c865b8 100644 --- a/iosFood2Fork/Pods/Manifest.lock +++ b/iosFood2Fork/Pods/Manifest.lock @@ -22,8 +22,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d SDWebImageSwiftUI: 8a3923c95108312b03a599ec1498754af55a6819 - shared: 29346581d099b8843a69aab157c4d0577c3c8287 + shared: 7b4d6aa8aa7ada5f9dae3229e2524d316cb9f063 PODFILE CHECKSUM: 9d85554c190eff2c79cf4349dccaaae321fe44fa -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.0 diff --git a/iosFood2Fork/Pods/Pods.xcodeproj/project.pbxproj b/iosFood2Fork/Pods/Pods.xcodeproj/project.pbxproj index de907e9..fef11e6 100644 --- a/iosFood2Fork/Pods/Pods.xcodeproj/project.pbxproj +++ b/iosFood2Fork/Pods/Pods.xcodeproj/project.pbxproj @@ -9,9 +9,9 @@ /* Begin PBXAggregateTarget section */ 8777C9F6889E59EFFD631D80AEE9048B /* shared */ = { isa = PBXAggregateTarget; - buildConfigurationList = C12F82084A1D789106266CAAF7274FD2 /* Build configuration list for PBXAggregateTarget "shared" */; + buildConfigurationList = 9FAF69EFFAE27522789F3CA719BA83DE /* Build configuration list for PBXAggregateTarget "shared" */; buildPhases = ( - F2F266D90E96E94E3FEEA4EF908A1753 /* [CP-User] Build shared */, + 4552119A071AC6BAB7327E6434237EC3 /* [CP-User] Build shared */, ); dependencies = ( ); @@ -778,8 +778,8 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 7141F4085DE07864C237DFED24207902 /* SDWebImageSwiftUI-umbrella.h in Headers */, D9A9F890AE47129340C203C1EAA482EE /* SDWebImageSwiftUI.h in Headers */, + 7141F4085DE07864C237DFED24207902 /* SDWebImageSwiftUI-umbrella.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -802,8 +802,8 @@ 1F55097C4490DCFB8BA4B3D8D284ED33 /* SDAnimatedImage.h in Headers */, DDABCEDA1455A7213CC6411BEE294CCB /* SDAnimatedImagePlayer.h in Headers */, B74F4E473F8A8EE8922DE009ADBA3AB0 /* SDAnimatedImageRep.h in Headers */, - 18D1D252617EE8076F60E5F13462A79F /* SDAnimatedImageView+WebCache.h in Headers */, 870F8CC125713185231805CA5F1A3005 /* SDAnimatedImageView.h in Headers */, + 18D1D252617EE8076F60E5F13462A79F /* SDAnimatedImageView+WebCache.h in Headers */, 6D807F4E3245C11DF14F39F681BAEA23 /* SDAssociatedObject.h in Headers */, 71C95FB341142F6C81587F4A60DC189F /* SDAsyncBlockOperation.h in Headers */, 7771562E8212237F9D71DFA61B548766 /* SDDeviceHelper.h in Headers */, @@ -836,8 +836,8 @@ 482390939D521EDC7E4197436C13C005 /* SDMemoryCache.h in Headers */, B13000184102BC002BDF251521D52FBE /* SDmetamacros.h in Headers */, 3D375A85D8162BC44D045F53781D006A /* SDWeakProxy.h in Headers */, - B964F75E0BEC223C3DDD199C6342AE0F /* SDWebImage-umbrella.h in Headers */, A128F49AA0C69EC677B7CBE89E876B42 /* SDWebImage.h in Headers */, + B964F75E0BEC223C3DDD199C6342AE0F /* SDWebImage-umbrella.h in Headers */, 04762E2F6696F6B57AC647288F800D2D /* SDWebImageCacheKeyFilter.h in Headers */, 08414C28164CC487E519E30C48342B08 /* SDWebImageCacheSerializer.h in Headers */, 84B3C925CCA883C89A4FAF942D952371 /* SDWebImageCompat.h in Headers */, @@ -939,8 +939,8 @@ BFDFE7DC352907FC980B868725387E98 /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1100; - LastUpgradeCheck = 1100; + LastSwiftUpdateCheck = 1240; + LastUpgradeCheck = 1240; }; buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; compatibilityVersion = "Xcode 10.0"; @@ -988,7 +988,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - F2F266D90E96E94E3FEEA4EF908A1753 /* [CP-User] Build shared */ = { + 4552119A071AC6BAB7327E6434237EC3 /* [CP-User] Build shared */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -996,7 +996,7 @@ name = "[CP-User] Build shared"; runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = " set -ev\n REPO_ROOT=\"$PODS_TARGET_SRCROOT\"\n \"$REPO_ROOT/../gradlew\" -p \"$REPO_ROOT\" :shared:syncFramework -Pkotlin.native.cocoapods.target=$KOTLIN_TARGET -Pkotlin.native.cocoapods.configuration=$CONFIGURATION -Pkotlin.native.cocoapods.cflags=\"$OTHER_CFLAGS\" -Pkotlin.native.cocoapods.paths.headers=\"$HEADER_SEARCH_PATHS\" -Pkotlin.native.cocoapods.paths.frameworks=\"$FRAMEWORK_SEARCH_PATHS\"\n"; + shellScript = " if [ \"YES\" = \"$COCOAPODS_SKIP_KOTLIN_BUILD\" ]; then\n echo \"Skipping Gradle build task invocation due to COCOAPODS_SKIP_KOTLIN_BUILD environment variable set to \"YES\"\"\n exit 0\n fi\n set -ev\n REPO_ROOT=\"$PODS_TARGET_SRCROOT\"\n \"$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\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -1013,8 +1013,8 @@ 4F00ED583882C1B74A2BA97EE0637416 /* ImageViewWrapper.swift in Sources */, 28BECC3D1820CD67D8A3D9D50F9C73A4 /* Indicator.swift in Sources */, 551C4389AFD1B7AEE39E409444643206 /* ProgressIndicator.swift in Sources */, - 61D5775A223AAF6DCCAC900613F1B0CF /* SDWebImageSwiftUI-dummy.m in Sources */, 189A148F892169776B8789F0C6175595 /* SDWebImageSwiftUI.swift in Sources */, + 61D5775A223AAF6DCCAC900613F1B0CF /* SDWebImageSwiftUI-dummy.m in Sources */, 798F4BDE3A509E1F9F02A4075C0DD4B5 /* SwiftUICompatibility.swift in Sources */, FE13F4069DEF171E3AC81FE9E04A9781 /* Transition.swift in Sources */, 4F0774F9C65915286144135BCBAE8D74 /* WebImage.swift in Sources */, @@ -1040,8 +1040,8 @@ 6AC5D2781167F9081FBA570FC8B89C90 /* SDAnimatedImage.m in Sources */, D91024E2275D2B62BB8CDFAADDA9F999 /* SDAnimatedImagePlayer.m in Sources */, E3C7DC809034DACD9D1FF1856DAD3ED2 /* SDAnimatedImageRep.m in Sources */, - 1F7AFE861609115DF7D756769A553F87 /* SDAnimatedImageView+WebCache.m in Sources */, E57482DCBAB73E4AC9A8EB0816998D8F /* SDAnimatedImageView.m in Sources */, + 1F7AFE861609115DF7D756769A553F87 /* SDAnimatedImageView+WebCache.m in Sources */, 02292FC1E8CF700F59D154DF2C841F75 /* SDAssociatedObject.m in Sources */, AF855A5EDCAEFF0EFCD1F6AC49D664B5 /* SDAsyncBlockOperation.m in Sources */, A8C8A2C92F70DFC3E67E1CCB0A5FBDA3 /* SDDeviceHelper.m in Sources */, @@ -1205,6 +1205,24 @@ }; name = Release; }; + 1B6EAB28480B60AB33A8B63338687E30 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B34BE5C5BA69C336E915FC8011CC0AC3 /* shared.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ENABLE_OBJC_WEAK = NO; + IPHONEOS_DEPLOYMENT_TARGET = 14.1; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; 24BEEDFABA9607E02FAA35007BC34E75 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = A231A3C087B578A27DF40542C1FF5C24 /* SDWebImageSwiftUI.release.xcconfig */; @@ -1341,24 +1359,6 @@ }; name = Release; }; - 8D3CE62BF39AD67694AD6D9C12796B95 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B34BE5C5BA69C336E915FC8011CC0AC3 /* shared.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; - CLANG_ENABLE_OBJC_WEAK = NO; - IPHONEOS_DEPLOYMENT_TARGET = 14.1; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; A0374B8CF9A7D6A45F6D116D698D1C19 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1497,7 +1497,7 @@ }; name = Debug; }; - CDCC3BDADC08CA648A703CE57218742D /* Debug */ = { + F80DE7EBDDFC80B4D52BCACF2249C6B6 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = E288A42FCA6973CB35B18FA55E8C3EED /* shared.debug.xcconfig */; buildSettings = { @@ -1544,11 +1544,11 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C12F82084A1D789106266CAAF7274FD2 /* Build configuration list for PBXAggregateTarget "shared" */ = { + 9FAF69EFFAE27522789F3CA719BA83DE /* Build configuration list for PBXAggregateTarget "shared" */ = { isa = XCConfigurationList; buildConfigurations = ( - CDCC3BDADC08CA648A703CE57218742D /* Debug */, - 8D3CE62BF39AD67694AD6D9C12796B95 /* Release */, + F80DE7EBDDFC80B4D52BCACF2249C6B6 /* Debug */, + 1B6EAB28480B60AB33A8B63338687E30 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/iosFood2Fork/Pods/Target Support Files/shared/shared.debug.xcconfig b/iosFood2Fork/Pods/Target Support Files/shared/shared.debug.xcconfig index 6eb8d9a..4948448 100644 --- a/iosFood2Fork/Pods/Target Support Files/shared/shared.debug.xcconfig +++ b/iosFood2Fork/Pods/Target Support Files/shared/shared.debug.xcconfig @@ -2,18 +2,14 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/shared FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../shared/build/cocoapods/framework" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -KOTLIN_TARGET[sdk=appletvos*] = tvos_arm64 -KOTLIN_TARGET[sdk=appletvsimulator*] = tvos_x64 -KOTLIN_TARGET[sdk=iphoneos*] = ios_arm -KOTLIN_TARGET[sdk=iphonesimulator*] = ios_x64 -KOTLIN_TARGET[sdk=macosx*] = macos_x64 -KOTLIN_TARGET[sdk=watchos*] = watchos_arm -KOTLIN_TARGET[sdk=watchsimulator*] = watchos_x64 +KOTLIN_PROJECT_PATH = :shared +OTHER_LDFLAGS = $(inherited) -l"c++" PODS_BUILD_DIR = ${BUILD_DIR} PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../shared PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +PRODUCT_MODULE_NAME = shared SKIP_INSTALL = YES USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/iosFood2Fork/Pods/Target Support Files/shared/shared.release.xcconfig b/iosFood2Fork/Pods/Target Support Files/shared/shared.release.xcconfig index 6eb8d9a..4948448 100644 --- a/iosFood2Fork/Pods/Target Support Files/shared/shared.release.xcconfig +++ b/iosFood2Fork/Pods/Target Support Files/shared/shared.release.xcconfig @@ -2,18 +2,14 @@ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/shared FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/../../shared/build/cocoapods/framework" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 -KOTLIN_TARGET[sdk=appletvos*] = tvos_arm64 -KOTLIN_TARGET[sdk=appletvsimulator*] = tvos_x64 -KOTLIN_TARGET[sdk=iphoneos*] = ios_arm -KOTLIN_TARGET[sdk=iphonesimulator*] = ios_x64 -KOTLIN_TARGET[sdk=macosx*] = macos_x64 -KOTLIN_TARGET[sdk=watchos*] = watchos_arm -KOTLIN_TARGET[sdk=watchsimulator*] = watchos_x64 +KOTLIN_PROJECT_PATH = :shared +OTHER_LDFLAGS = $(inherited) -l"c++" PODS_BUILD_DIR = ${BUILD_DIR} PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) PODS_ROOT = ${SRCROOT} PODS_TARGET_SRCROOT = ${PODS_ROOT}/../../shared PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +PRODUCT_MODULE_NAME = shared SKIP_INSTALL = YES USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/iosFood2Fork/iosFood2Fork.xcodeproj/project.pbxproj b/iosFood2Fork/iosFood2Fork.xcodeproj/project.pbxproj index d6c48f9..f943cb8 100644 --- a/iosFood2Fork/iosFood2Fork.xcodeproj/project.pbxproj +++ b/iosFood2Fork/iosFood2Fork.xcodeproj/project.pbxproj @@ -427,7 +427,6 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 8ZVFT372F9; ENABLE_PREVIEWS = YES; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; INFOPLIST_FILE = iosFood2Fork/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -456,7 +455,6 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 8ZVFT372F9; ENABLE_PREVIEWS = YES; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; INFOPLIST_FILE = iosFood2Fork/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 21d6ffb..7715876 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -11,11 +11,11 @@ plugins { version = "1.0" android { - compileSdkVersion(Application.compileSdk) + compileSdk = Application.compileSdk sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") defaultConfig { - minSdkVersion(Application.minSdk) - targetSdkVersion(Application.targetSdk) + minSdk = Application.minSdk + targetSdk = Application.targetSdk } compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 @@ -34,11 +34,11 @@ android { kotlin { android() - val iosTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget = - if (System.getenv("SDK_NAME")?.startsWith("iphoneos") == true) - ::iosArm64 - else - ::iosX64 + val iosTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget = when { + System.getenv("SDK_NAME")?.startsWith("iphoneos") == true -> ::iosArm64 + System.getenv("NATIVE_ARCH")?.startsWith("arm") == true -> ::iosSimulatorArm64 + else -> ::iosX64 + } iosTarget("ios") {} @@ -46,7 +46,9 @@ kotlin { summary = "Some description for the Shared Module" homepage = "Link to the Shared Module homepage" ios.deploymentTarget = "14.1" - frameworkName = "shared" + framework { + baseName = "shared" + } podfile = project.file("../iosFood2Fork/Podfile") } @@ -54,20 +56,21 @@ kotlin { val commonMain by getting { dependencies{ implementation(Ktor.core) - implementation(Ktor.clientSerialization) + implementation(Ktor.jsonSerialization) + implementation(Ktor.contentNegotiation) implementation(Kotlinx.datetime) implementation(SQLDelight.runtime) } } val androidMain by getting { dependencies{ - implementation(Ktor.android) + implementation(Ktor.clientCIO) implementation(SQLDelight.androidDriver) } } val iosMain by getting{ dependencies { - implementation(Ktor.ios) + implementation(Ktor.clientDarwin) implementation(SQLDelight.nativeDriver) } } diff --git a/shared/shared.podspec b/shared/shared.podspec index 9fe033e..84e76f1 100644 --- a/shared/shared.podspec +++ b/shared/shared.podspec @@ -7,8 +7,7 @@ Pod::Spec.new do |spec| spec.license = '' spec.summary = 'Some description for the Shared Module' - spec.static_framework = true - spec.vendored_frameworks = "build\cocoapods\framework/shared.framework" + spec.vendored_frameworks = "build/cocoapods/framework/shared.framework" spec.libraries = "c++" spec.module_name = "#{spec.name}_umbrella" @@ -17,13 +16,8 @@ Pod::Spec.new do |spec| spec.pod_target_xcconfig = { - 'KOTLIN_TARGET[sdk=iphonesimulator*]' => 'ios_x64', - 'KOTLIN_TARGET[sdk=iphoneos*]' => 'ios_arm', - 'KOTLIN_TARGET[sdk=watchsimulator*]' => 'watchos_x64', - 'KOTLIN_TARGET[sdk=watchos*]' => 'watchos_arm', - 'KOTLIN_TARGET[sdk=appletvsimulator*]' => 'tvos_x64', - 'KOTLIN_TARGET[sdk=appletvos*]' => 'tvos_arm64', - 'KOTLIN_TARGET[sdk=macosx*]' => 'macos_x64' + 'KOTLIN_PROJECT_PATH' => ':shared', + 'PRODUCT_MODULE_NAME' => 'shared', } spec.script_phases = [ @@ -32,14 +26,16 @@ Pod::Spec.new do |spec| :execution_position => :before_compile, :shell_path => '/bin/sh', :script => <<-SCRIPT + if [ "YES" = "$COCOAPODS_SKIP_KOTLIN_BUILD" ]; then + echo "Skipping Gradle build task invocation due to COCOAPODS_SKIP_KOTLIN_BUILD environment variable set to \"YES\"" + exit 0 + fi set -ev REPO_ROOT="$PODS_TARGET_SRCROOT" - "$REPO_ROOT/..\gradlew" -p "$REPO_ROOT" :shared:syncFramework \ - -Pkotlin.native.cocoapods.target=$KOTLIN_TARGET \ - -Pkotlin.native.cocoapods.configuration=$CONFIGURATION \ - -Pkotlin.native.cocoapods.cflags="$OTHER_CFLAGS" \ - -Pkotlin.native.cocoapods.paths.headers="$HEADER_SEARCH_PATHS" \ - -Pkotlin.native.cocoapods.paths.frameworks="$FRAMEWORK_SEARCH_PATHS" + "$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 SCRIPT } ] diff --git a/shared/src/androidMain/kotlin/com/codingwithmitch/food2forkkmm/datasource/network/KtorClientFactory.kt b/shared/src/androidMain/kotlin/com/codingwithmitch/food2forkkmm/datasource/network/KtorClientFactory.kt index d652b63..3813d2b 100644 --- a/shared/src/androidMain/kotlin/com/codingwithmitch/food2forkkmm/datasource/network/KtorClientFactory.kt +++ b/shared/src/androidMain/kotlin/com/codingwithmitch/food2forkkmm/datasource/network/KtorClientFactory.kt @@ -1,17 +1,20 @@ package com.codingwithmitch.food2forkkmm.datasource.network -import io.ktor.client.* -import io.ktor.client.engine.android.* -import io.ktor.client.features.json.* -import io.ktor.client.features.json.serializer.* +import io.ktor.client.HttpClient +import io.ktor.client.engine.cio.CIO +import io.ktor.client.plugins.ContentNegotiation +import io.ktor.serialization.kotlinx.json.json +import kotlinx.serialization.json.Json actual class KtorClientFactory { actual fun build(): HttpClient { - return HttpClient(Android) { - install(JsonFeature) { - serializer = KotlinxSerializer( - kotlinx.serialization.json.Json { + return HttpClient(CIO) { + install(ContentNegotiation) { + json( + Json { ignoreUnknownKeys = true // if the server sends extra fields, ignore them + prettyPrint = true + isLenient = true } ) } diff --git a/shared/src/commonMain/kotlin/com/codingwithmitch/food2forkkmm/datasource/network/RecipeServiceImpl.kt b/shared/src/commonMain/kotlin/com/codingwithmitch/food2forkkmm/datasource/network/RecipeServiceImpl.kt index d14c7da..f59fa21 100644 --- a/shared/src/commonMain/kotlin/com/codingwithmitch/food2forkkmm/datasource/network/RecipeServiceImpl.kt +++ b/shared/src/commonMain/kotlin/com/codingwithmitch/food2forkkmm/datasource/network/RecipeServiceImpl.kt @@ -3,27 +3,29 @@ package com.codingwithmitch.food2forkkmm.datasource.network import com.codingwithmitch.food2forkkmm.datasource.network.model.RecipeDto import com.codingwithmitch.food2forkkmm.datasource.network.model.RecipeSearchResponse import com.codingwithmitch.food2forkkmm.domain.model.Recipe -import io.ktor.client.* -import io.ktor.client.request.* +import io.ktor.client.HttpClient +import io.ktor.client.call.body +import io.ktor.client.request.get +import io.ktor.client.request.header +import io.ktor.client.request.url class RecipeServiceImpl( private val httpClient: HttpClient, private val baseUrl: String, -): RecipeService { +) : RecipeService { override suspend fun search(page: Int, query: String): List { - return httpClient.get{ + return httpClient.get { url("$baseUrl/search?page=$page&query=$query") header("Authorization", TOKEN) - } - .results.toRecipeList() + }.body().results.toRecipeList() } override suspend fun get(id: Int): Recipe { - return httpClient.get{ + return httpClient.get { url("$baseUrl/get?id=$id") header("Authorization", TOKEN) - }.toRecipe() + }.body().toRecipe() } companion object { @@ -31,10 +33,3 @@ class RecipeServiceImpl( const val BASE_URL = "https://food2fork.ca/api/recipe" } } - - - - - - - diff --git a/shared/src/iosMain/kotlin/com/codingwithmitch/food2forkkmm/datasource/network/KtorClientFactory.kt b/shared/src/iosMain/kotlin/com/codingwithmitch/food2forkkmm/datasource/network/KtorClientFactory.kt index 6e4b854..7382d2a 100644 --- a/shared/src/iosMain/kotlin/com/codingwithmitch/food2forkkmm/datasource/network/KtorClientFactory.kt +++ b/shared/src/iosMain/kotlin/com/codingwithmitch/food2forkkmm/datasource/network/KtorClientFactory.kt @@ -1,17 +1,20 @@ package com.codingwithmitch.food2forkkmm.datasource.network import io.ktor.client.* -import io.ktor.client.engine.ios.* -import io.ktor.client.features.json.* -import io.ktor.client.features.json.serializer.* +import io.ktor.client.engine.darwin.* +import io.ktor.client.plugins.* +import io.ktor.serialization.kotlinx.json.* +import kotlinx.serialization.json.Json actual class KtorClientFactory { actual fun build(): HttpClient { - return HttpClient(Ios) { - install(JsonFeature) { - serializer = KotlinxSerializer( - kotlinx.serialization.json.Json { + return HttpClient(Darwin) { + install(ContentNegotiation) { + json( + Json { ignoreUnknownKeys = true // if the server sends extra fields, ignore them + prettyPrint = true + isLenient = true } ) }