Browse Source

Apple Silicon build fixes for todoapp (#1999)

* upgrade Reaktive to one that has better Apple Silicon support

* upgrade SQLDelight for Apple Silicon support

* Fix build to support Apple Silicon

Some of this code could be better centralized though I've been unable to
find a solution.

* simplify utils/build.gradle.kts

* workaround

* fix review comments

* sample todoapp: rename Todo.framework -> KotlinCommon.framework

Co-authored-by: dima.avdeev <dima.avdeev@jetbrains.com>
pull/2020/head
Travis Reitter 3 years ago committed by GitHub
parent
commit
6f00515736
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt
  2. 1
      examples/todoapp/buildSrc/gradle.properties
  3. 4
      examples/todoapp/common/main/build.gradle.kts
  4. 2
      examples/todoapp/common/root/build.gradle.kts
  5. 1
      examples/todoapp/gradle.properties
  6. 7
      examples/todoapp/ios/TodoApp.xcodeproj/project.pbxproj

4
examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt

@ -69,7 +69,7 @@ object Deps {
object Badoo { object Badoo {
object Reaktive { object Reaktive {
private const val VERSION = "1.1.22" private const val VERSION = "1.2.1"
const val reaktive = "com.badoo.reaktive:reaktive:$VERSION" const val reaktive = "com.badoo.reaktive:reaktive:$VERSION"
const val reaktiveTesting = "com.badoo.reaktive:reaktive-testing:$VERSION" const val reaktiveTesting = "com.badoo.reaktive:reaktive-testing:$VERSION"
const val utils = "com.badoo.reaktive:utils:$VERSION" const val utils = "com.badoo.reaktive:utils:$VERSION"
@ -79,7 +79,7 @@ object Deps {
object Squareup { object Squareup {
object SQLDelight { object SQLDelight {
private const val VERSION = "1.5.0" private const val VERSION = "1.5.3"
const val gradlePlugin = "com.squareup.sqldelight:gradle-plugin:$VERSION" const val gradlePlugin = "com.squareup.sqldelight:gradle-plugin:$VERSION"
const val androidDriver = "com.squareup.sqldelight:android-driver:$VERSION" const val androidDriver = "com.squareup.sqldelight:android-driver:$VERSION"

1
examples/todoapp/buildSrc/gradle.properties

@ -1,3 +1,4 @@
# TODO can we get rid of duplication with root gradle.properties? # TODO can we get rid of duplication with root gradle.properties?
#todo remove -Pkotlin.version=1.6.20 from Xcode project, when stable version on Compose with Koltin 1.6.20 or later released
kotlin.version=1.6.10 kotlin.version=1.6.10
compose.version=1.1.0 compose.version=1.1.0

4
examples/todoapp/common/main/build.gradle.kts

@ -26,8 +26,4 @@ kotlin {
} }
} }
} }
targets.getByName<KotlinNativeTarget>("iosX64").compilations.forEach {
it.kotlinOptions.freeCompilerArgs += arrayOf("-linker-options", "-lsqlite3")
}
} }

2
examples/todoapp/common/root/build.gradle.kts

@ -10,7 +10,7 @@ kotlin {
ios { ios {
binaries { binaries {
framework { framework {
baseName = "Todo" baseName = "KotlinCommon"
linkerOpts.add("-lsqlite3") linkerOpts.add("-lsqlite3")
export(project(":common:database")) export(project(":common:database"))
export(project(":common:main")) export(project(":common:main"))

1
examples/todoapp/gradle.properties

@ -23,5 +23,6 @@ org.gradle.parallel=true
org.gradle.caching=true org.gradle.caching=true
kotlin.native.disableCompilerDaemon=true kotlin.native.disableCompilerDaemon=true
#todo remove -Pkotlin.version=1.6.20 from Xcode project, when stable version on Compose with Koltin 1.6.20 or later released
kotlin.version=1.6.10 kotlin.version=1.6.10
compose.version=1.1.0 compose.version=1.1.0

7
examples/todoapp/ios/TodoApp.xcodeproj/project.pbxproj

@ -29,7 +29,7 @@
1F00F390257599DA00CFAF97 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 1F00F390257599DA00CFAF97 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
1F00F393257599DA00CFAF97 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; }; 1F00F393257599DA00CFAF97 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
1F00F395257599DA00CFAF97 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 1F00F395257599DA00CFAF97 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
1F00F3A325759FEC00CFAF97 /* Todo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Todo.framework; path = "../common/root/build/xcode-frameworks/Todo.framework"; sourceTree = "<group>"; }; 1F00F3A325759FEC00CFAF97 /* KotlinCommon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = KotlinCommon.framework; path = "../common/root/build/xcode-frameworks/KotlinCommon.framework"; sourceTree = "<group>"; };
1F00F3A72575A16400CFAF97 /* ObservableValue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ObservableValue.swift; sourceTree = "<group>"; }; 1F00F3A72575A16400CFAF97 /* ObservableValue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ObservableValue.swift; sourceTree = "<group>"; };
1F00F3A92575A71000CFAF97 /* MutableStateBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MutableStateBuilder.swift; sourceTree = "<group>"; }; 1F00F3A92575A71000CFAF97 /* MutableStateBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MutableStateBuilder.swift; sourceTree = "<group>"; };
1F00F3AB2575AA4500CFAF97 /* ListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListView.swift; sourceTree = "<group>"; }; 1F00F3AB2575AA4500CFAF97 /* ListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListView.swift; sourceTree = "<group>"; };
@ -101,7 +101,7 @@
1F00F3A225759FEC00CFAF97 /* Frameworks */ = { 1F00F3A225759FEC00CFAF97 /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
1F00F3A325759FEC00CFAF97 /* Todo.framework */, 1F00F3A325759FEC00CFAF97 /* KotlinCommon.framework */,
); );
name = Frameworks; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
@ -171,6 +171,7 @@
}; };
/* End PBXResourcesBuildPhase section */ /* End PBXResourcesBuildPhase section */
/* TODO Remove workaround -Pkotlin.version=1.6.20, when newer version of Compose released */
/* Begin PBXShellScriptBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */
1F00F39D25759BB300CFAF97 /* ShellScript */ = { 1F00F39D25759BB300CFAF97 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase; isa = PBXShellScriptBuildPhase;
@ -187,7 +188,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "cd $SRCROOT/..\n./gradlew :common:root:embedAndSignAppleFrameworkForXcode\n"; shellScript = "cd $SRCROOT/..\n./gradlew :common:root:embedAndSignAppleFrameworkForXcode -Pkotlin.version=1.6.20\n";
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */

Loading…
Cancel
Save