Skip to content

Commit

Permalink
Merge pull request #4 from team-haribo/feature/3-architecture-settings
Browse files Browse the repository at this point in the history
🔀 :: (#3) - architecture settings
  • Loading branch information
minStone-dev authored Jan 12, 2024
2 parents 96a2c97 + 28addb8 commit a52dca8
Show file tree
Hide file tree
Showing 86 changed files with 1,064 additions and 59 deletions.
24 changes: 24 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 6 additions & 54 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,69 +1,21 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("goms.android.application")
id("goms.android.hilt")
}

android {
namespace = "com.goms.goms_android_v2"
compileSdk = 34

defaultConfig {
applicationId = "com.goms.goms_android_v2"
minSdk = 24
targetSdk = 34
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}"
excludes += "META-INF/DEPENDENCIES"
}
}
}

dependencies {

implementation("androidx.core:core-ktx:1.9.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
implementation("androidx.activity:activity-compose:1.8.2")
implementation(platform("androidx.compose:compose-bom:2023.03.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
implementation(project(":core:design-system"))
implementation(libs.junit)
androidTestImplementation(libs.androidx.test.ext)
}
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:tools="http://schemas.android.com/tools">

<application
android:name=".di.GomsApplication"
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/goms/goms_android_v2/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.goms.goms_android_v2.ui.theme.GOMSAndroidV2Theme
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.goms.goms_android_v2.di

import android.app.Application
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class GomsApplication : Application() {}
Empty file.
1 change: 1 addition & 0 deletions build-logic/convention/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
60 changes: 60 additions & 0 deletions build-logic/convention/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`kotlin-dsl`
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
}

dependencies {
compileOnly(libs.android.gradlePlugin)
compileOnly(libs.kotlin.gradlePlugin)
compileOnly(libs.ksp.gradlePlugin)
}

gradlePlugin {
plugins {
register("androidApplication") {
id = "goms.android.application"
implementationClass = "AndroidApplicationConventionPlugin"
}

register("androidHilt") {
id = "goms.android.hilt"
implementationClass = "AndroidHiltConventionPlugin"
}

register("androidLint") {
id = "goms.android.lint"
implementationClass = "AndroidLintConventionPlugin"
}

register("androidCore") {
id = "goms.android.core"
implementationClass = "AndroidCoreConventionPlugin"
}

register("androidCompose") {
id = "goms.android.compose"
implementationClass = "AndroidComposeConventionPlugin"
}

register("jvmLibrary") {
id = "goms.jvm.library"
implementationClass = "JvmLibraryConventionPlugin"
}

register("androidFeature") {
id = "goms.android.feature"
implementationClass = "AndroidFeatureConventionPlugin"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import com.android.build.api.dsl.ApplicationExtension
import com.goms.goms_android_v2.configureKotlinAndroid
import com.goms.goms_android_v2.libs
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies

class AndroidApplicationConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("com.android.application")
apply("org.jetbrains.kotlin.android")
apply("goms.android.lint")
}

extensions.configure<ApplicationExtension> {
configureKotlinAndroid(this)
defaultConfig {
applicationId = "com.goms.goms_android_v2"
minSdk = 26
targetSdk = 34
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

vectorDrawables.useSupportLibrary = true
}

buildFeatures.compose = true

buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}

composeOptions {
kotlinCompilerExtensionVersion = libs.findVersion("androidxComposeCompiler").get().toString()
}

dependencies {
add("implementation", libs.findBundle("kotlinx-coroutines").get())
add("implementation", libs.findBundle("compose").get())
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import com.android.build.gradle.LibraryExtension
import com.goms.goms_android_v2.configureAndroidCompose
import com.goms.goms_android_v2.libs
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies

class AndroidComposeConventionPlugin :Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("com.android.library")

extensions.configure<LibraryExtension> {
configureAndroidCompose(this)
}

dependencies {
add("implementation", libs.findBundle("compose").get())
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import com.android.build.api.dsl.LibraryExtension
import com.goms.goms_android_v2.configureKotlinAndroid
import com.goms.goms_android_v2.libs
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies

class AndroidCoreConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("com.android.library")
apply("org.jetbrains.kotlin.android")
apply("goms.android.lint")
}

extensions.configure<LibraryExtension> {
configureKotlinAndroid(this)
defaultConfig.minSdk = 26
}

dependencies {
add("implementation", libs.findLibrary("androidx-core-ktx").get())
add("implementation", libs.findLibrary("kotlinx-coroutines-android").get())
add("implementation", libs.findLibrary("junit").get())
add("androidTestImplementation", libs.findLibrary("androidx-test-ext").get())
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import com.goms.goms_android_v2.libs
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies

class AndroidFeatureConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("goms.android.core")
apply("goms.android.hilt")
apply("goms.android.compose")
}

dependencies {
add("implementation", project(":core:model"))
add("implementation", project(":core:design-system"))
add("implementation", project(":core:data:repository"))
add("implementation", project(":core:domain"))

add("implementation", libs.findLibrary("coil.kt").get())

add("implementation", libs.findLibrary("androidx.lifecycle.runtimeCompose").get())
add("implementation", libs.findLibrary("androidx.lifecycle.viewModelCompose").get())
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import com.goms.goms_android_v2.libs
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies

class AndroidHiltConventionPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
with(pluginManager) {
apply("com.google.devtools.ksp")
apply("dagger.hilt.android.plugin")
}

dependencies {
add("implementation", (libs.findLibrary("hilt.android").get()))
add("ksp", (libs.findLibrary("hilt.compiler").get()))
add("kspAndroidTest", (libs.findLibrary("hilt.compiler").get()))
add("kspTest", (libs.findLibrary("hilt.compiler").get()))
}
}
}
}
Loading

0 comments on commit a52dca8

Please sign in to comment.