-
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.
Merge pull request #2 from stslex/dev
Dev
- Loading branch information
Showing
47 changed files
with
784 additions
and
240 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,11 @@ | ||
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed | ||
plugins { | ||
alias(libs.plugins.androidApplication) | ||
alias(libs.plugins.kotlinAndroid) | ||
} | ||
|
||
android { | ||
namespace = "com.stslex.aproselection" | ||
compileSdk = 33 | ||
|
||
defaultConfig { | ||
applicationId = "com.stslex.aproselection" | ||
minSdk = 24 | ||
targetSdk = 33 | ||
versionCode = 1 | ||
versionName = "1.0" | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
vectorDrawables { | ||
useSupportLibrary = true | ||
} | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
buildFeatures { | ||
compose = true | ||
} | ||
composeOptions { | ||
kotlinCompilerExtensionVersion = "1.4.3" | ||
} | ||
packaging { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
} | ||
} | ||
id("aproselection.android.application") | ||
id("aproselection.android.application.compose") | ||
} | ||
|
||
dependencies { | ||
implementation(project(":core:ui")) | ||
implementation(project(":core:network")) | ||
implementation(project(":feature:auth")) | ||
|
||
implementation(libs.bundles.koin) | ||
implementation(libs.core.ktx) | ||
implementation(libs.lifecycle.runtime.ktx) | ||
implementation(platform(libs.compose.bom)) | ||
implementation(libs.bundles.compose) | ||
|
||
testImplementation(libs.junit) | ||
androidTestImplementation(libs.bundles.android.test) | ||
androidTestImplementation(platform(libs.compose.bom)) | ||
debugImplementation(libs.ui.tooling) | ||
debugImplementation(libs.ui.test.manifest) | ||
} |
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
10 changes: 8 additions & 2 deletions
10
app/src/main/java/com/stslex/aproselection/SelectApplication.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,17 +1,23 @@ | ||
package com.stslex.aproselection | ||
|
||
import android.app.Application | ||
import com.stslex.aproselection.feature.auth.di.FeatureAuthModule.featureAuthModule | ||
import com.stslex.aproselection.core.network.di.ModuleCoreNetwork.moduleCoreNetwork | ||
import com.stslex.aproselection.feature.auth.di.ModuleFeatureAuth.moduleFeatureAuth | ||
import org.koin.android.ext.koin.androidContext | ||
import org.koin.android.ext.koin.androidLogger | ||
import org.koin.core.context.startKoin | ||
|
||
class SelectApplication : Application() { | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
startKoin { | ||
androidLogger() | ||
androidContext(applicationContext) | ||
modules(featureAuthModule) | ||
modules( | ||
moduleFeatureAuth, | ||
moduleCoreNetwork | ||
) | ||
} | ||
} | ||
} |
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
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
27 changes: 27 additions & 0 deletions
27
app/src/test/java/com/stslex/aproselection/DiKoinModuleTest.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,27 @@ | ||
package com.stslex.aproselection | ||
|
||
import android.content.Context | ||
import com.stslex.aproselection.core.network.di.ModuleCoreNetwork | ||
import com.stslex.aproselection.core.network.di.ModuleCoreNetwork.moduleCoreNetwork | ||
import com.stslex.aproselection.feature.auth.di.ModuleFeatureAuth.moduleFeatureAuth | ||
import org.junit.Test | ||
import org.koin.android.ext.koin.androidContext | ||
import org.koin.dsl.koinApplication | ||
import org.koin.test.KoinTest | ||
import org.koin.test.check.checkModules | ||
import org.mockito.Mockito | ||
|
||
class DiKoinModuleTest : KoinTest { | ||
|
||
@Test | ||
fun checkKoinModules() { | ||
koinApplication { | ||
androidContext(Mockito.mock(Context::class.java)) | ||
modules( | ||
moduleFeatureAuth, | ||
moduleCoreNetwork | ||
) | ||
checkModules() | ||
} | ||
} | ||
} |
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,2 @@ | ||
/build | ||
/.gradle |
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,2 @@ | ||
/build | ||
/.gradle |
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,32 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
group = "com.stslex.aproselection.buildlogic" | ||
|
||
dependencies { | ||
implementation(libs.android.gradlePlugin) | ||
implementation(libs.kotlin.gradlePlugin) | ||
implementation(libs.kotlin.serialization) | ||
} | ||
|
||
gradlePlugin { | ||
plugins { | ||
register("androidApplicationCompose") { | ||
id = "aproselection.android.application.compose" | ||
implementationClass = "AndroidApplicationComposeConventionPlugin" | ||
} | ||
register("androidApplication") { | ||
id = "aproselection.android.application" | ||
implementationClass = "AndroidApplicationConventionPlugin" | ||
} | ||
register("androidLibraryCompose") { | ||
id = "aproselection.android.library.compose" | ||
implementationClass = "AndroidLibraryComposeConventionPlugin" | ||
} | ||
register("androidLibrary") { | ||
id = "aproselection.android.library" | ||
implementationClass = "AndroidLibraryConventionPlugin" | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
build-logic/dependencies/src/main/kotlin/AndroidApplicationComposeConventionPlugin.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,17 @@ | ||
import com.android.build.api.dsl.ApplicationExtension | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.getByType | ||
import com.stslex.aproselection.configureAndroidCompose | ||
|
||
class AndroidApplicationComposeConventionPlugin : Plugin<Project> { | ||
|
||
override fun apply(target: Project) { | ||
|
||
with(target) { | ||
pluginManager.apply("com.android.application") | ||
val extension = extensions.getByType<ApplicationExtension>() | ||
configureAndroidCompose(extension) | ||
} | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
build-logic/dependencies/src/main/kotlin/AndroidApplicationConventionPlugin.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,39 @@ | ||
import com.android.build.api.dsl.ApplicationExtension | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
import com.stslex.aproselection.configureKotlinAndroid | ||
|
||
class AndroidApplicationConventionPlugin : Plugin<Project> { | ||
|
||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("com.android.application") | ||
apply("org.jetbrains.kotlin.android") | ||
} | ||
|
||
extensions.configure<ApplicationExtension> { | ||
configureKotlinAndroid(this) | ||
|
||
namespace = "com.stslex.aproselection" | ||
|
||
defaultConfig.apply { | ||
applicationId = "com.stslex.aproselection" | ||
targetSdk = 33 | ||
versionName = "1.0" | ||
versionCode = 1 | ||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
build-logic/dependencies/src/main/kotlin/AndroidLibraryComposeConventionPlugin.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 @@ | ||
import com.android.build.gradle.LibraryExtension | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.getByType | ||
import com.stslex.aproselection.configureAndroidCompose | ||
|
||
class AndroidLibraryComposeConventionPlugin : Plugin<Project> { | ||
|
||
override fun apply(target: Project) { | ||
with(target) { | ||
pluginManager.apply("com.android.library") | ||
val extension = extensions.getByType<LibraryExtension>() | ||
configureAndroidCompose(extension) | ||
} | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
build-logic/dependencies/src/main/kotlin/AndroidLibraryConventionPlugin.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,50 @@ | ||
import com.android.build.gradle.LibraryExtension | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.api.artifacts.VersionCatalogsExtension | ||
import org.gradle.kotlin.dsl.configure | ||
import org.gradle.kotlin.dsl.dependencies | ||
import org.gradle.kotlin.dsl.getByType | ||
import org.gradle.kotlin.dsl.kotlin | ||
import com.stslex.aproselection.configureKotlinAndroid | ||
|
||
class AndroidLibraryConventionPlugin : Plugin<Project> { | ||
|
||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("com.android.library") | ||
apply("org.jetbrains.kotlin.android") | ||
} | ||
|
||
extensions.configure<LibraryExtension> { | ||
configureKotlinAndroid(this) | ||
defaultConfig.apply { | ||
targetSdk = 33 | ||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
consumerProguardFiles("consumer-rules.pro") | ||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
} | ||
} | ||
} | ||
} | ||
|
||
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs") | ||
configurations.configureEach { | ||
resolutionStrategy { | ||
force(libs.findLibrary("junit").get()) | ||
} | ||
} | ||
dependencies { | ||
add("androidTestImplementation", kotlin("test")) | ||
add("testImplementation", kotlin("test")) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.