Skip to content

Commit

Permalink
upgrade kotlin and compose
Browse files Browse the repository at this point in the history
  • Loading branch information
joaquim-verges committed Jan 17, 2022
1 parent 0628aa8 commit b9ac2b9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ repositories {

dependencies {
implementation("com.android.tools.build:gradle:7.0.2")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31")
}
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ object Versions {
const val targetSdk = 30

// kotlin std
const val kotlin = "1.5.21"
const val kotlin = "1.5.31"
const val coroutines = "1.5.0"

// test
Expand All @@ -27,7 +27,7 @@ object Versions {
const val constraint_layout = "2.0.0"
const val material_lib = "1.2.0-alpha05"
const val navigation = "2.3.1"
const val compose = "1.0.2"
const val compose = "1.0.5"
const val compose_activity = "1.3.0"
const val compose_constraint_layout = "1.0.0-beta02"
const val accompanist = "0.15.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ inline fun <reified P : ViewModel> Context.getRetainedLogicBlock(): P {
is FragmentActivity -> {
ViewModelProvider(this)[P::class.java]
}
is ComponentActivity -> {
ViewModelProvider(this)[P::class.java]
}
is Fragment -> {
ViewModelProvider(this)[P::class.java]
}
Expand Down
19 changes: 9 additions & 10 deletions samples/multiplatform_app/common/common.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Pod::Spec.new do |spec|
spec.license = ''
spec.summary = 'Common code for multiplatform news app'

spec.static_framework = true
spec.vendored_frameworks = "build/cocoapods/framework/NewsCommon.framework"
spec.libraries = "c++"
spec.module_name = "#{spec.name}_umbrella"
Expand All @@ -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' => ':samples:multiplatform_app:common',
'PRODUCT_MODULE_NAME' => 'common',
}

spec.script_phases = [
Expand All @@ -32,10 +26,15 @@ 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" :samples:multiplatform_app:common:syncFramework \
-Pkotlin.native.cocoapods.target=$KOTLIN_TARGET \
"$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.cflags="$OTHER_CFLAGS" \
-Pkotlin.native.cocoapods.paths.headers="$HEADER_SEARCH_PATHS" \
Expand Down

0 comments on commit b9ac2b9

Please sign in to comment.