Skip to content

Commit

Permalink
Merge pull request #189 from joreilly/dependency_updates
Browse files Browse the repository at this point in the history
dependency updates
  • Loading branch information
joreilly authored Dec 22, 2024
2 parents 90d7c73 + d45b245 commit 4a3e46e
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 48 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ jobs:
run: ./gradlew assembleDebug


- name: Build iOS shared code
run: ./gradlew :shared:compileKotlinIosArm64

- name: Tests
run: ./gradlew :shared:jvmTest

Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: iOS CI

on: pull_request

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Build iOS shared code
run: ./gradlew :shared:compileKotlinIosArm64

2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ kotlin.code.style=official
xcodeproj=./iosApp

kotlin.mpp.stability.nowarn=true
kotlin.native.toolchain.enabled=false

org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"
kotlin.mpp.androidSourceSetLayoutVersion=2
android.useAndroidX=true
Expand Down
19 changes: 10 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
[versions]
kotlin = "2.0.21"
ksp = "2.0.21-1.0.25"
kotlin = "2.1.0"
ksp = "2.1.0-1.0.29"
kotlinx-coroutines = "1.9.0"

androidGradlePlugin = "8.7.1"
androidGradlePlugin = "8.7.3"
koin = "4.0.0"
koinComposeMultiplatform = "4.0.0"
apollo = "4.0.1"
kmpNativeCoroutines = "1.0.0-ALPHA-37"
apollo = "4.1.0"
apolloMockServer = "0.1.0"
kmpNativeCoroutines = "1.0.0-ALPHA-38"

androidxActivity = "1.9.3"
androidxComposeBom = "2024.10.00"
androidxComposeBom = "2024.12.01"
androidx-navigation = "2.8.0-alpha08"
androidx-lifecycle = "2.8.3"
androidx-lifecycle = "2.8.4"
accompanist = "0.30.1"
horologist = "0.6.20"
wearCompose = "1.4.0"
composeMultiplatform = "1.7.0"
composeMultiplatform = "1.7.3"
composeWindowSize = "0.5.0"

junit = "4.13.2"
Expand Down Expand Up @@ -67,7 +68,7 @@ koin-test = { module = "io.insert-koin:koin-test", version.ref = "koin" }
apollo-runtime = { group = "com.apollographql.apollo", name = "apollo-runtime", version.ref = "apollo" }
apollo-normalized-cache = { group = "com.apollographql.apollo", name = "apollo-normalized-cache", version.ref = "apollo" }
apollo-normalized-cache-sqlite = { group = "com.apollographql.apollo", name = "apollo-normalized-cache-sqlite", version.ref = "apollo" }
apollo-mockserver = { group = "com.apollographql.apollo", name = "apollo-mockserver", version.ref = "apollo" }
apollo-mockserver = { group = "com.apollographql.mockserver", name = "apollo-mockserver", version.ref = "apolloMockServer" }
apollo-testing-support = { group = "com.apollographql.apollo", name = "apollo-testing-support", version.ref = "apollo" }

junit = { module = "junit:junit", version.ref = "junit" }
Expand Down
24 changes: 8 additions & 16 deletions iosApp/iosApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
/* Begin PBXBuildFile section */
058557BB273AAA24004C7B11 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557BA273AAA24004C7B11 /* Assets.xcassets */; };
058557D9273AAEEB004C7B11 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */; };
1A431ABC2A2A7C1400FC6ED9 /* KMPNativeCoroutinesAsync in Frameworks */ = {isa = PBXBuildFile; productRef = 1A431ABB2A2A7C1400FC6ED9 /* KMPNativeCoroutinesAsync */; };
1A431ABE2A2A7C1400FC6ED9 /* KMPNativeCoroutinesCore in Frameworks */ = {isa = PBXBuildFile; productRef = 1A431ABD2A2A7C1400FC6ED9 /* KMPNativeCoroutinesCore */; };
1A5F2A772D174F8400F8ADD5 /* KMPNativeCoroutinesAsync in Frameworks */ = {isa = PBXBuildFile; productRef = 1A5F2A762D174F8400F8ADD5 /* KMPNativeCoroutinesAsync */; };
1AC5B19D2764A3C100A5A7C1 /* StarWarsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AC5B19B2764A3C100A5A7C1 /* StarWarsViewModel.swift */; };
1AC5B19E2764A3C100A5A7C1 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AC5B19C2764A3C100A5A7C1 /* ContentView.swift */; };
1AD3669927920DCA005A5CDA /* IosAppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1AD3669827920DCA005A5CDA /* IosAppTests.swift */; };
Expand Down Expand Up @@ -64,8 +63,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
1A431ABE2A2A7C1400FC6ED9 /* KMPNativeCoroutinesCore in Frameworks */,
1A431ABC2A2A7C1400FC6ED9 /* KMPNativeCoroutinesAsync in Frameworks */,
1A5F2A772D174F8400F8ADD5 /* KMPNativeCoroutinesAsync in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -167,8 +165,7 @@
);
name = iosApp;
packageProductDependencies = (
1A431ABB2A2A7C1400FC6ED9 /* KMPNativeCoroutinesAsync */,
1A431ABD2A2A7C1400FC6ED9 /* KMPNativeCoroutinesCore */,
1A5F2A762D174F8400F8ADD5 /* KMPNativeCoroutinesAsync */,
);
productName = iosApp;
productReference = 7555FF7B242A565900829871 /* iosApp.app */;
Expand Down Expand Up @@ -203,7 +200,7 @@
);
mainGroup = 7555FF72242A565900829871;
packageReferences = (
1A431ABA2A2A7C1400FC6ED9 /* XCRemoteSwiftPackageReference "KMP-NativeCoroutines" */,
1A5F2A752D174F8400F8ADD5 /* XCRemoteSwiftPackageReference "KMP-NativeCoroutines" */,
);
productRefGroup = 7555FF7C242A565900829871 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -561,27 +558,22 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
1A431ABA2A2A7C1400FC6ED9 /* XCRemoteSwiftPackageReference "KMP-NativeCoroutines" */ = {
1A5F2A752D174F8400F8ADD5 /* XCRemoteSwiftPackageReference "KMP-NativeCoroutines" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/rickclephas/KMP-NativeCoroutines.git";
requirement = {
kind = exactVersion;
version = "1.0.0-ALPHA-30";
version = "1.0.0-ALPHA-38";
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
1A431ABB2A2A7C1400FC6ED9 /* KMPNativeCoroutinesAsync */ = {
1A5F2A762D174F8400F8ADD5 /* KMPNativeCoroutinesAsync */ = {
isa = XCSwiftPackageProductDependency;
package = 1A431ABA2A2A7C1400FC6ED9 /* XCRemoteSwiftPackageReference "KMP-NativeCoroutines" */;
package = 1A5F2A752D174F8400F8ADD5 /* XCRemoteSwiftPackageReference "KMP-NativeCoroutines" */;
productName = KMPNativeCoroutinesAsync;
};
1A431ABD2A2A7C1400FC6ED9 /* KMPNativeCoroutinesCore */ = {
isa = XCSwiftPackageProductDependency;
package = 1A431ABA2A2A7C1400FC6ED9 /* XCRemoteSwiftPackageReference "KMP-NativeCoroutines" */;
productName = KMPNativeCoroutinesCore;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 7555FF73242A565900829871 /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/rickclephas/KMP-NativeCoroutines.git",
"state" : {
"revision" : "caf590ab2d260be1a9810c64cbcd9ed896330167",
"version" : "1.0.0-ALPHA-30"
"revision" : "a92a55c7054d806cba28bdaf2198e59d1f18df5e",
"version" : "1.0.0-ALPHA-38"
}
},
{
"identity" : "rxswift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ReactiveX/RxSwift.git",
"state" : {
"revision" : "9dcaa4b333db437b0fbfaf453fad29069044a8b4",
"version" : "6.6.0"
"revision" : "c7c7d2cf50a3211fe2843f76869c698e4e417930",
"version" : "6.8.0"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import com.apollographql.apollo.annotations.ApolloExperimental
import com.apollographql.apollo.api.toResponseJson
import com.apollographql.apollo.cache.normalized.api.MemoryCacheFactory
import com.apollographql.apollo.cache.normalized.normalizedCache
import com.apollographql.apollo.mockserver.MockResponse
import com.apollographql.apollo.mockserver.MockServer
import com.apollographql.mockserver.MockServer
import com.apollographql.mockserver.MockResponse
import dev.johnoreilly.starwars.shared.di.commonModule
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.test.runTest
import okio.use
import org.koin.core.context.startKoin
import org.koin.dsl.module
import org.koin.test.KoinTest
Expand All @@ -23,7 +24,6 @@ import kotlin.test.assertEquals
class StarWarsRepositoryTest: KoinTest {
private val repo : StarWarsRepository by inject()

private val mockServer = MockServer()
private lateinit var mockServerUrl: String

@BeforeTest
Expand All @@ -39,21 +39,24 @@ class StarWarsRepositoryTest: KoinTest {

@Test
fun testStarWarsRepository() = runTest {
mockServerUrl = mockServer.url()
MockServer().use { mockServer ->
mockServerUrl = mockServer.url()

mockServer.enqueue(MockResponse.Builder().body(getAllPeopleMockResponse.toResponseJson()).build())
val people = repo.people.first()
assertEquals(2, people.size)
assertEquals("Person 1", people[0].name)
assertEquals("Home World 1", people[0].homeworld.name)
println(people)
mockServer.enqueue(MockResponse.Builder().body(getAllPeopleMockResponse.toResponseJson()).build())
val people = repo.people.first()
assertEquals(2, people.size)
assertEquals("Person 1", people[0].name)
assertEquals("Home World 1", people[0].homeworld.name)
println(people)

mockServer.enqueue(MockResponse.Builder().body(getAllFilmsMockResponse.toResponseJson()).build())
val films = repo.films.first()
assertEquals(2, films.size)
assertEquals("Film 1", films[0].title)
assertEquals("Director 1", films[0].director)
println(films)
}

mockServer.enqueue(MockResponse.Builder().body(getAllFilmsMockResponse.toResponseJson()).build())
val films = repo.films.first()
assertEquals(2, films.size)
assertEquals("Film 1", films[0].title)
assertEquals("Director 1", films[0].director)
println(films)
}

private fun createMockApolloClient(url: String): ApolloClient {
Expand Down

0 comments on commit 4a3e46e

Please sign in to comment.