Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release paging and core #600

Merged
merged 3 commits into from
Jan 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 66 additions & 3 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.dokka.gradle.DokkaTask

plugins {
kotlin("multiplatform")
Expand All @@ -6,12 +8,14 @@ plugins {
id("com.vanniktech.maven.publish")
id("org.jetbrains.dokka")
id("org.jetbrains.kotlinx.kover")
id("co.touchlab.faktory.kmmbridge") version("0.3.2")
`maven-publish`
kotlin("native.cocoapods")
id("kotlinx-atomicfu")
}

kotlin {
androidTarget()
android()
jvm()
iosArm64()
iosX64()
Expand All @@ -32,8 +36,67 @@ kotlin {
}

android {

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
compileSdk = 33

sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
defaultConfig {
minSdk = 24
targetSdk = 33
}

lint {
disable += "ComposableModifierFactory"
disable += "ModifierFactoryExtensionFunction"
disable += "ModifierFactoryReturnType"
disable += "ModifierFactoryUnreferencedReceiver"
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}

tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets.configureEach {
reportUndocumented.set(false)
skipDeprecated.set(true)
jdkVersion.set(11)
}
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.S01)
signAllPublications()
}

addGithubPackagesRepository()
kmmbridge {
githubReleaseArtifacts()
githubReleaseVersions()
versionPrefix.set(libs.versions.store.get())
spm()
}

koverMerged {
enable()

xmlReport {
onCheck.set(true)
reportFile.set(layout.projectDirectory.file("kover/coverage.xml"))
}

htmlReport {
onCheck.set(true)
reportDir.set(layout.projectDirectory.dir("kover/html"))
}

verify {
onCheck.set(true)
}
}

atomicfu {
transformJvm = false
transformJs = false
}
3 changes: 3 additions & 0 deletions core/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_NAME=org.mobilenativefoundation.store
POM_ARTIFACT_ID=core5
POM_PACKAGING=jar
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ testCore = "1.5.0"
kmmBridge = "0.3.2"
ktlint = "0.39.0"
kover = "0.6.0"
store = "5.0.0"
store = "5.1.0-alpha01"
truth = "1.1.3"

[libraries]
Expand Down Expand Up @@ -53,4 +53,4 @@ kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-cor
junit = { group = "junit", name = "junit", version.ref = "junit" }
google-truth = { group = "com.google.truth", name = "truth", version.ref = "truth" }
touchlab-kermit = { group = "co.touchlab", name = "kermit", version.ref = "kermit" }
turbine = "app.cash.turbine:turbine:0.12.3"
turbine = "app.cash.turbine:turbine:1.0.0"
82 changes: 67 additions & 15 deletions paging/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.dokka.gradle.DokkaTask

plugins {
kotlin("multiplatform")
Expand All @@ -6,42 +8,47 @@ plugins {
id("com.vanniktech.maven.publish")
id("org.jetbrains.dokka")
id("org.jetbrains.kotlinx.kover")
id("co.touchlab.faktory.kmmbridge") version("0.3.2")
`maven-publish`
kotlin("native.cocoapods")
id("kotlinx-atomicfu")
id("org.jetbrains.compose") version("1.5.1")
}

kotlin {
androidTarget()
android()
jvm()
iosArm64()
iosX64()
linuxX64()
iosSimulatorArm64()
js {
browser()
nodejs()
}
cocoapods {
summary = "Store5/Paging"
homepage = "https://github.com/MobileNativeFoundation/Store"
ios.deploymentTarget = "13"
version = libs.versions.store.get()
}

sourceSets {
val commonMain by getting {
dependencies {
implementation(libs.kotlin.stdlib)
implementation(project(":store"))
implementation(project(":cache"))
implementation(compose.runtime)
implementation(compose.ui)
implementation(compose.foundation)
implementation(compose.material)
api(project(":core"))
implementation(libs.kotlinx.coroutines.core)
}
}

val androidMain by getting {
dependencies {
implementation(libs.androidx.paging.runtime)
implementation(libs.androidx.paging.compose)
}
}
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
val androidMain by getting
val commonTest by getting {
dependencies {
implementation(kotlin("test"))
implementation(libs.turbine)
implementation(libs.kotlinx.coroutines.test)
implementation(compose.uiTestJUnit4)
implementation(compose.ui)
}
}
}
Expand All @@ -53,6 +60,7 @@ android {

defaultConfig {
minSdk = 24
targetSdk = 33
}

lint {
Expand All @@ -67,3 +75,47 @@ android {
targetCompatibility = JavaVersion.VERSION_11
}
}

tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets.configureEach {
reportUndocumented.set(false)
skipDeprecated.set(true)
jdkVersion.set(11)
}
}

mavenPublishing {
publishToMavenCentral(SonatypeHost.S01)
signAllPublications()
}

addGithubPackagesRepository()
kmmbridge {
githubReleaseArtifacts()
githubReleaseVersions()
versionPrefix.set(libs.versions.store.get())
spm()
}

koverMerged {
enable()

xmlReport {
onCheck.set(true)
reportFile.set(layout.projectDirectory.file("kover/coverage.xml"))
}

htmlReport {
onCheck.set(true)
reportDir.set(layout.projectDirectory.dir("kover/html"))
}

verify {
onCheck.set(true)
}
}

atomicfu {
transformJvm = false
transformJs = false
}
3 changes: 3 additions & 0 deletions paging/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POM_NAME=org.mobilenativefoundation.store
POM_ARTIFACT_ID=paging5
POM_PACKAGING=jar
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.runTest
import org.junit.Before
import org.junit.Test
import org.mobilenativefoundation.store.core5.ExperimentalStoreApi
import org.mobilenativefoundation.store.paging5.util.FakePostApi
import org.mobilenativefoundation.store.paging5.util.FakePostDatabase
import org.mobilenativefoundation.store.paging5.util.PostApi
Expand All @@ -15,12 +14,13 @@ import org.mobilenativefoundation.store.paging5.util.PostDatabase
import org.mobilenativefoundation.store.paging5.util.PostKey
import org.mobilenativefoundation.store.paging5.util.PostPutRequestResult
import org.mobilenativefoundation.store.paging5.util.PostStoreFactory
import org.mobilenativefoundation.store.core5.ExperimentalStoreApi
import org.mobilenativefoundation.store.store5.MutableStore
import org.mobilenativefoundation.store.store5.StoreReadRequest
import org.mobilenativefoundation.store.store5.StoreReadResponse
import org.mobilenativefoundation.store.store5.StoreReadResponseOrigin
import org.mobilenativefoundation.store.store5.StoreWriteRequest
import kotlin.test.BeforeTest
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertIs

Expand All @@ -33,7 +33,7 @@ class LaunchPagingStoreTests {
private lateinit var db: PostDatabase
private lateinit var store: MutableStore<PostKey, PostData>

@Before
@BeforeTest
fun setup() {
api = FakePostApi()
db = FakePostDatabase(userId)
Expand Down
2 changes: 1 addition & 1 deletion store/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ addGithubPackagesRepository()
kmmbridge {
githubReleaseArtifacts()
githubReleaseVersions()
versionPrefix.set("5.0.0")
versionPrefix.set(libs.versions.store.get())
spm()
}

Expand Down
Loading