generated from nimblehq/git-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Chore] Generate & update sample project
- Loading branch information
1 parent
365405a
commit 2476689
Showing
33 changed files
with
278 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
object BuildTypes { | ||
const val DEBUG = "debug" | ||
const val RELEASE = "release" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
object Flavors { | ||
const val PRODUCTION = "production" | ||
const val STAGING = "staging" | ||
const val DIMENSION_VERSION = "version" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
object Modules { | ||
const val SHARED = ":shared" | ||
} |
15 changes: 0 additions & 15 deletions
15
.../buildSrc/src/main/java/Configurations.kt → sample/buildSrc/src/main/java/Plugins.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
object Versions { | ||
const val ANDROID_COMPILE_SDK = 33 | ||
const val ANDROID_MIN_SDK = 24 | ||
const val ANDROID_TARGET_SDK = 33 | ||
const val ANDROID_VERSION_CODE = 1 | ||
const val ANDROID_VERSION_NAME = "1.0.0" | ||
|
||
const val ANDROIDX_ACTIVITY_COMPOSE = "1.7.1" | ||
|
||
const val BUILD_KONFIG = "0.13.3" | ||
|
||
const val COMPOSE = "1.4.3" | ||
const val COMPOSE_COMPILER = "1.4.7" | ||
const val COMPOSE_NAVIGATION = "2.6.0" | ||
|
||
const val DETEKT = "1.23.0" | ||
|
||
const val GRADLE = "8.0.2" | ||
|
||
const val JUNIT = "4.13.2" | ||
|
||
const val KOIN = "3.3.2" | ||
const val KOIN_ANDROID = "3.3.2" | ||
const val KOIN_ANDROIDX_COMPOSE = "3.4.1" | ||
const val KOTLIN = "1.8.21" | ||
const val KOTLIN_COROUTINES = "1.7.3" | ||
const val KOTEST = "5.5.4" | ||
const val KOTLINX_RESOURCES = "0.2.4" | ||
const val KOVER = "0.7.3" | ||
const val KSP = "1.8.21-1.0.11" | ||
const val KTOR = "2.1.1" | ||
|
||
const val MOCKATIVE = "1.3.0" | ||
const val MOCKK = "1.13.3" | ||
|
||
const val NAPIER = "2.6.1" | ||
|
||
const val ROBOLECTRIC = "4.9.1" | ||
|
||
const val TIMBER = "5.0.1" | ||
const val TURBINE = "0.12.1" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../kmm/template/di/module/PlatformModule.kt → ...kmm/template/di/modules/PlatformModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...rc/commonMain/kotlin/co/nimblehq/kmm/template/data/remote/datasources/RemoteDataSource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package co.nimblehq.kmm.template.data.remote.datasources | ||
|
||
import co.nimblehq.kmm.template.data.remote.models.responses.Response | ||
import co.nimblehq.kmm.template.data.remote.ApiClient | ||
|
||
interface RemoteDataSource { | ||
suspend fun getUsers(): List<Response> | ||
} | ||
|
||
internal class RemoteDataSourceImpl(private val apiClient: ApiClient) : RemoteDataSource { | ||
override suspend fun getUsers(): List<Response> { | ||
return apiClient.get( | ||
path = "users" | ||
) | ||
} | ||
} |
16 changes: 0 additions & 16 deletions
16
...ommonMain/kotlin/co/nimblehq/kmm/template/data/remote/datasources/UserRemoteDataSource.kt
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
...rc/commonMain/kotlin/co/nimblehq/kmm/template/data/remote/model/responses/UserResponse.kt
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
...d/src/commonMain/kotlin/co/nimblehq/kmm/template/data/remote/models/responses/Response.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package co.nimblehq.kmm.template.data.remote.models.responses | ||
|
||
import co.nimblehq.kmm.template.domain.models.Model | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class Response( | ||
@SerialName("id") val id: Int? | ||
) | ||
|
||
fun Response.toModel() = Model(id) |
12 changes: 6 additions & 6 deletions
12
...shared/src/commonMain/kotlin/co/nimblehq/kmm/template/data/repositories/RepositoryImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
package co.nimblehq.kmm.template.data.repositories | ||
|
||
import co.nimblehq.kmm.template.data.extensions.flowTransform | ||
import co.nimblehq.kmm.template.data.remote.datasources.UserRemoteDataSource | ||
import co.nimblehq.kmm.template.data.remote.model.responses.toModel | ||
import co.nimblehq.kmm.template.domain.model.UserModel | ||
import co.nimblehq.kmm.template.data.remote.datasources.RemoteDataSource | ||
import co.nimblehq.kmm.template.data.remote.models.responses.toModel | ||
import co.nimblehq.kmm.template.domain.models.Model | ||
import co.nimblehq.kmm.template.domain.repositories.Repository | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
class RepositoryImpl( | ||
private val userRemoteDataSource: UserRemoteDataSource | ||
private val remoteDataSource: RemoteDataSource | ||
) : Repository { | ||
override fun getUsers(): Flow<List<UserModel>> = flowTransform { | ||
userRemoteDataSource.getUsers().map { it.toModel() } | ||
override fun getUsers(): Flow<List<Model>> = flowTransform { | ||
remoteDataSource.getUsers().map { it.toModel() } | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
sample/shared/src/commonMain/kotlin/co/nimblehq/kmm/template/di/Koin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
sample/shared/src/commonMain/kotlin/co/nimblehq/kmm/template/di/module/RemoteModule.kt
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
sample/shared/src/commonMain/kotlin/co/nimblehq/kmm/template/di/module/UseCaseModule.kt
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
.../kmm/template/di/module/PlatformModule.kt → ...kmm/template/di/modules/PlatformModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
sample/shared/src/commonMain/kotlin/co/nimblehq/kmm/template/di/modules/RemoteModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package co.nimblehq.kmm.template.di.modules | ||
|
||
import co.nimblehq.kmm.template.data.remote.datasources.RemoteDataSource | ||
import org.koin.dsl.module | ||
import co.nimblehq.kmm.template.data.remote.ApiClient | ||
import co.nimblehq.kmm.template.data.remote.datasources.RemoteDataSourceImpl | ||
import org.koin.core.module.dsl.singleOf | ||
import org.koin.dsl.bind | ||
|
||
val remoteModule = module { | ||
singleOf(::ApiClient) | ||
singleOf(::RemoteDataSourceImpl) bind RemoteDataSource::class | ||
} |
2 changes: 1 addition & 1 deletion
2
...mm/template/di/module/RepositoryModule.kt → ...m/template/di/modules/RepositoryModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
sample/shared/src/commonMain/kotlin/co/nimblehq/kmm/template/di/modules/UseCaseModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package co.nimblehq.kmm.template.di.modules | ||
|
||
import org.koin.core.module.dsl.singleOf | ||
import org.koin.dsl.module | ||
import co.nimblehq.kmm.template.domain.usecases.UseCaseImpl | ||
import co.nimblehq.kmm.template.domain.usecases.UseCase | ||
import org.koin.dsl.bind | ||
|
||
val useCaseModule = module { | ||
singleOf(::UseCaseImpl) bind UseCase::class | ||
} |
5 changes: 0 additions & 5 deletions
5
sample/shared/src/commonMain/kotlin/co/nimblehq/kmm/template/domain/model/UserModel.kt
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
sample/shared/src/commonMain/kotlin/co/nimblehq/kmm/template/domain/models/Model.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package co.nimblehq.kmm.template.domain.models | ||
|
||
data class Model( | ||
val id: Int? | ||
) |
4 changes: 2 additions & 2 deletions
4
...e/shared/src/commonMain/kotlin/co/nimblehq/kmm/template/domain/repositories/Repository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package co.nimblehq.kmm.template.domain.repositories | ||
|
||
import co.nimblehq.kmm.template.domain.model.UserModel | ||
import co.nimblehq.kmm.template.domain.models.Model | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface Repository { | ||
fun getUsers(): Flow<List<UserModel>> | ||
fun getUsers(): Flow<List<Model>> | ||
} |
14 changes: 0 additions & 14 deletions
14
.../shared/src/commonMain/kotlin/co/nimblehq/kmm/template/domain/usecases/GetUsersUseCase.kt
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
sample/shared/src/commonMain/kotlin/co/nimblehq/kmm/template/domain/usecases/UseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package co.nimblehq.kmm.template.domain.usecases | ||
|
||
import co.nimblehq.kmm.template.domain.models.Model | ||
import co.nimblehq.kmm.template.domain.repositories.Repository | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
interface UseCase { | ||
operator fun invoke(): Flow<List<Model>> | ||
} | ||
|
||
class UseCaseImpl(private val repository: Repository) : UseCase { | ||
|
||
override fun invoke(): Flow<List<Model>> = repository.getUsers() | ||
} |
Oops, something went wrong.