Skip to content

Commit

Permalink
Merge pull request #40 from stslex/dev
Browse files Browse the repository at this point in the history
Refactor Paging worker
  • Loading branch information
stslex authored Oct 27, 2024
2 parents bb9aa04 + 3400324 commit 299a827
Show file tree
Hide file tree
Showing 116 changed files with 2,170 additions and 2,185 deletions.
29 changes: 1 addition & 28 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,4 @@ jobs:
run: echo "$LOCAL_PROPERTIES" > ./local.properties

- name: Build with Gradle
run: ./gradlew assembleAndroidTest

build-desktop:

runs-on: ubuntu-latest

steps:

- name: Checkout branch
uses: actions/checkout@v2

- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: set up LOCAL_PROPERTIES
env:
LOCAL_PROPERTIES: ${{ secrets.LOCAL_PROPERTIES }}
run: echo "$LOCAL_PROPERTIES" > ./local.properties

- name: Build with Gradle
run: ./gradlew desktopMainClasses desktopSourcesJar desktopTestClasses
run: ./gradlew assembleAndroidTest
21 changes: 0 additions & 21 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat

plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidApplication)
Expand All @@ -16,8 +14,6 @@ kotlin {
}
}

jvm("desktop")

iosX64()
iosArm64()
iosSimulatorArm64()
Expand All @@ -35,11 +31,6 @@ kotlin {
}

sourceSets {
val desktopMain by getting

desktopMain.dependencies {
implementation(compose.desktop.currentOs)
}

commonMain.dependencies {
implementation(project(":core:core"))
Expand Down Expand Up @@ -106,18 +97,6 @@ dependencies {
implementation(project(":feature:settings"))
}

compose.desktop {
application {
mainClass = "MainKt"

nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "com.stslex.wizard"
packageVersion = "1.0.0"
}
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
compilerOptions.freeCompilerArgs.addAll(
"-P",
Expand Down
16 changes: 0 additions & 16 deletions composeApp/src/desktopMain/kotlin/main.kt

This file was deleted.

2 changes: 0 additions & 2 deletions core/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ kotlin {
}
}

jvm("desktop")

iosX64()
iosArm64()
iosSimulatorArm64()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ interface PagingCoreData<out T : PagingCoreItem> {
const val DEFAULT_PAGING_TYPE = "ItemPaging"
const val DEFAULT_APPEND_TYPE = "AppendPaging"
const val DEFAULT_BOTTOM_TYPE = "BottomPaging"
const val DEFAULT_PAGING_DELAY = 300L
const val DEFAULT_PAGING_LOAD_SIZE = 3
const val DEFAULT_QUERY_LOAD_SIZE = 2
}
}

This file was deleted.

2 changes: 0 additions & 2 deletions core/database/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ kotlin {
}
}

jvm("desktop")

iosX64()
iosArm64()
iosSimulatorArm64()
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions core/network/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ kotlin {
}
}

jvm("desktop")

iosX64()
iosArm64()
iosSimulatorArm64()
Expand Down
12 changes: 2 additions & 10 deletions core/ui/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.compose.ExperimentalComposeLibrary

plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidLibrary)
Expand All @@ -16,8 +14,6 @@ kotlin {
}
}

jvm("desktop")

iosX64()
iosArm64()
iosSimulatorArm64()
Expand All @@ -33,11 +29,6 @@ kotlin {
}

sourceSets {
val desktopMain by getting

desktopMain.dependencies {
implementation(compose.desktop.currentOs)
}

commonMain.dependencies {
implementation(project(":core:core"))
Expand All @@ -47,10 +38,11 @@ kotlin {
api(compose.foundation)
api(compose.material)
api(compose.material3)
@OptIn(ExperimentalComposeLibrary::class)
api(compose.components.resources)
api(libs.bundles.voyager)
api(libs.kamel)

implementation("org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose:2.8.0-beta02")
}
commonTest.dependencies {
implementation(libs.kotlin.test)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.stslex.core.ui.mvi

import androidx.lifecycle.ViewModel
import org.koin.androidx.viewmodel.dsl.viewModel
import org.koin.core.definition.Definition
import org.koin.core.definition.KoinDefinition
import org.koin.core.module.Module
import org.koin.core.qualifier.Qualifier

actual inline fun <reified T : ViewModel> Module.viewModelDefinition(
qualifier: Qualifier?,
noinline definition: Definition<T>,
): KoinDefinition<T> = viewModel(
qualifier = qualifier,
definition = definition
)
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@ import com.stslex.core.core.paging.PagingCoreData
@Stable
data class PagingConfig(
val pageSize: Int,
val pageOffset: Float = PagingCoreData.DEFAULT_PAGE_OFFSET
val pageOffset: Float = PagingCoreData.DEFAULT_PAGE_OFFSET,
val delay: Long = PagingCoreData.DEFAULT_PAGING_DELAY,
val defaultLoadSize: Int = PagingCoreData.DEFAULT_PAGING_LOAD_SIZE,
val queryLoadSize: Int = PagingCoreData.DEFAULT_QUERY_LOAD_SIZE
) {

companion object {

val DEFAULT = PagingConfig(
pageSize = PagingCoreData.DEFAULT_PAGE_SIZE,
pageOffset = PagingCoreData.DEFAULT_PAGE_OFFSET
pageOffset = PagingCoreData.DEFAULT_PAGE_OFFSET,
delay = PagingCoreData.DEFAULT_PAGING_DELAY,
defaultLoadSize = PagingCoreData.DEFAULT_PAGING_LOAD_SIZE,
queryLoadSize = PagingCoreData.DEFAULT_QUERY_LOAD_SIZE
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@ package com.stslex.core.ui.di

import com.stslex.core.ui.pager.pager.StorePagerFactory
import com.stslex.core.ui.pager.pager.StorePagerFactoryImpl
import com.stslex.core.ui.pager.paging_worker.PagingWorkerFactory
import com.stslex.core.ui.pager.paging_worker.PagingWorkerFactoryImpl
import org.koin.dsl.module

val coreUiModule = module {
factory<PagingWorkerFactory> {
PagingWorkerFactoryImpl()
}
factory<StorePagerFactory> {
StorePagerFactoryImpl()
StorePagerFactoryImpl(
workerFactory = get()
)
}
}
134 changes: 0 additions & 134 deletions core/ui/src/commonMain/kotlin/com/stslex/core/ui/mvi/BaseStore.kt

This file was deleted.

Loading

0 comments on commit 299a827

Please sign in to comment.