-
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.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
35 changed files
with
886 additions
and
128 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,88 +1,12 @@ | ||
|
||
plugins { | ||
alias(libs.plugins.kotlin.android) | ||
alias(libs.plugins.android.application) | ||
alias(libs.plugins.jetbrains.kotlin.android) | ||
alias(libs.plugins.ktlint) | ||
alias(libs.plugins.detekt) | ||
alias(libs.plugins.spotless) | ||
} | ||
alias(libs.plugins.misik.application) | ||
alias(libs.plugins.misik.android.hilt) | ||
|
||
val ktlintVersion = "0.50.0" | ||
} | ||
|
||
android { | ||
namespace = "com.nexters.misik" | ||
compileSdk = 35 | ||
|
||
defaultConfig { | ||
applicationId = "com.nexters.misik" | ||
minSdk = 24 | ||
targetSdk = 35 | ||
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_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "17" | ||
} | ||
buildFeatures { | ||
compose = true | ||
} | ||
composeOptions { | ||
kotlinCompilerExtensionVersion = "1.5.1" | ||
} | ||
packaging { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
|
||
implementation(libs.androidx.core.ktx) | ||
implementation(libs.androidx.lifecycle.runtime.ktx) | ||
implementation(libs.androidx.activity.compose) | ||
implementation(platform(libs.androidx.compose.bom)) | ||
implementation(libs.androidx.ui) | ||
implementation(libs.androidx.ui.graphics) | ||
implementation(libs.androidx.ui.tooling.preview) | ||
implementation(libs.androidx.material3) | ||
testImplementation(libs.junit) | ||
androidTestImplementation(libs.androidx.junit) | ||
androidTestImplementation(libs.androidx.espresso.core) | ||
androidTestImplementation(platform(libs.androidx.compose.bom)) | ||
androidTestImplementation(libs.androidx.ui.test.junit4) | ||
debugImplementation(libs.androidx.ui.tooling) | ||
debugImplementation(libs.androidx.ui.test.manifest) | ||
} | ||
|
||
detekt { | ||
config.from("${projectDir}/config/detekt/detekt-config.yml") | ||
buildUponDefaultConfig = true | ||
debug = true | ||
} | ||
|
||
spotless { | ||
kotlin { | ||
target("**/*.kt") | ||
targetExclude("**/build/**/*.kt") | ||
ktlint(ktlintVersion) | ||
} | ||
} | ||
} |
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,21 @@ | ||
package com.nexters.misik | ||
|
||
import android.app.Application | ||
import androidx.multidex.BuildConfig | ||
import dagger.hilt.android.HiltAndroidApp | ||
import timber.log.Timber | ||
|
||
@HiltAndroidApp | ||
class MisikApplication : Application() { | ||
override fun onCreate() { | ||
super.onCreate() | ||
|
||
initTimber() | ||
} | ||
|
||
private fun initTimber() { | ||
if (BuildConfig.DEBUG) { | ||
Timber.plant(Timber.DebugTree()) | ||
} | ||
} | ||
} |
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 @@ | ||
/build |
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 @@ | ||
/build |
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,73 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
group = "com.nexters.misik.convention" | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
|
||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { | ||
kotlinOptions { | ||
jvmTarget = "17" | ||
} | ||
} | ||
|
||
|
||
dependencies { | ||
compileOnly(libs.android.gradle.plugin) | ||
compileOnly(libs.kotlin.gradle.plugin) | ||
compileOnly(libs.ksp.gradle.plugin) | ||
compileOnly(libs.compose.compiler.extension) | ||
} | ||
|
||
gradlePlugin { | ||
plugins { | ||
register("androidApplication") { | ||
id = "misik.android.application" | ||
implementationClass = "AndroidApplicationPlugin" | ||
} | ||
|
||
register("misikFeature") { | ||
id = "misik.feature" | ||
implementationClass = "MisikFeaturePlugin" | ||
} | ||
|
||
register("misikData") { | ||
id = "misik.data" | ||
implementationClass = "MisikDataPlugin" | ||
} | ||
|
||
register("androidLibrary") { | ||
id = "misik.android.library" | ||
implementationClass = "AndroidLibraryPlugin" | ||
} | ||
|
||
register("androidComposeLibrary") { | ||
id = "misik.android.compose.library" | ||
implementationClass = "AndroidComposeLibraryPlugin" | ||
} | ||
|
||
register("androidHilt") { | ||
id = "misik.android.hilt" | ||
implementationClass = "HiltPlugin" | ||
} | ||
|
||
register("javaLibrary") { | ||
id = "misik.java.library" | ||
implementationClass = "JavaLibraryPlugin" | ||
} | ||
|
||
register("buildConfig") { | ||
id = "misik.plugin.build.config" | ||
implementationClass = "BuildConfigPlugin" | ||
} | ||
|
||
register("androidTest") { | ||
id = "misik.plugin.android.test" | ||
implementationClass = "AndroidTestPlugin" | ||
} | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
build-logic/convention/src/main/java/AndroidApplicationPlugin.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,35 @@ | ||
import com.android.build.api.dsl.ApplicationExtension | ||
import com.nexters.misik.convention.configureAndroidCompose | ||
import com.nexters.misik.convention.configureKotlinAndroid | ||
import com.nexters.misik.convention.extension.getLibrary | ||
import com.nexters.misik.convention.extension.getVersion | ||
import com.nexters.misik.convention.extension.implementation | ||
import com.nexters.misik.convention.extension.libs | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
import org.gradle.kotlin.dsl.dependencies | ||
|
||
internal class AndroidApplicationPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("com.android.application") | ||
} | ||
|
||
extensions.configure<ApplicationExtension> { | ||
configureKotlinAndroid(this) | ||
configureAndroidCompose(this) | ||
with(defaultConfig) { | ||
targetSdk = libs.getVersion("targetSdk").requiredVersion.toInt() | ||
versionCode = libs.getVersion("versionCode").requiredVersion.toInt() | ||
versionName = libs.getVersion("versionName").requiredVersion | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(libs.getLibrary("timber")) | ||
} | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
build-logic/convention/src/main/java/AndroidComposeLibraryPlugin.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,19 @@ | ||
import com.android.build.gradle.LibraryExtension | ||
import com.nexters.misik.convention.configureAndroidCompose | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
|
||
class AndroidComposeLibraryPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("misik.android.compose.library") | ||
} | ||
|
||
extensions.configure<LibraryExtension> { | ||
configureAndroidCompose(this) | ||
} | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
build-logic/convention/src/main/java/AndroidLibraryPlugin.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,29 @@ | ||
import com.android.build.gradle.LibraryExtension | ||
import com.nexters.misik.convention.configureKotlinAndroid | ||
import com.nexters.misik.convention.configureKotlinCoroutine | ||
import com.nexters.misik.convention.extension.getLibrary | ||
import com.nexters.misik.convention.extension.implementation | ||
import com.nexters.misik.convention.extension.libs | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
import org.gradle.kotlin.dsl.dependencies | ||
|
||
class AndroidLibraryPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("com.android.library") | ||
} | ||
|
||
extensions.configure<LibraryExtension> { | ||
configureKotlinAndroid(this) | ||
configureKotlinCoroutine(this) | ||
} | ||
|
||
dependencies { | ||
implementation(libs.getLibrary("timber")) | ||
} | ||
} | ||
} | ||
} |
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,15 @@ | ||
import com.android.build.gradle.LibraryExtension | ||
import com.nexters.misik.convention.configureBuildConfig | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
|
||
class BuildConfigPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
extensions.configure<LibraryExtension> { | ||
configureBuildConfig(this) | ||
} | ||
} | ||
} | ||
} |
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,26 @@ | ||
import com.nexters.misik.convention.extension.getLibrary | ||
import com.nexters.misik.convention.extension.implementation | ||
import com.nexters.misik.convention.extension.ksp | ||
import com.nexters.misik.convention.extension.kspTest | ||
import com.nexters.misik.convention.extension.libs | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.dependencies | ||
|
||
class HiltPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("com.google.devtools.ksp") | ||
apply("dagger.hilt.android.plugin") | ||
} | ||
|
||
dependencies { | ||
implementation(libs.getLibrary("hilt.android")) | ||
ksp(libs.getLibrary("hilt.compiler")) | ||
implementation(libs.getLibrary("hilt.testing")) | ||
kspTest(libs.getLibrary("hilt.testing.compiler")) | ||
} | ||
} | ||
} | ||
} |
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,35 @@ | ||
import com.nexters.misik.convention.Const | ||
import com.nexters.misik.convention.extension.getLibrary | ||
import com.nexters.misik.convention.extension.getVersion | ||
import com.nexters.misik.convention.extension.implementation | ||
import com.nexters.misik.convention.extension.libs | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.api.plugins.JavaPluginExtension | ||
import org.gradle.kotlin.dsl.configure | ||
import org.gradle.kotlin.dsl.dependencies | ||
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension | ||
|
||
class JavaLibraryPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("java-library") | ||
apply("org.jetbrains.kotlin.jvm") | ||
} | ||
|
||
extensions.configure<JavaPluginExtension> { | ||
sourceCompatibility = Const.JAVA_VERSION | ||
targetCompatibility = Const.JAVA_VERSION | ||
} | ||
|
||
extensions.configure<KotlinProjectExtension> { | ||
jvmToolchain(libs.getVersion("jdkVersion").requiredVersion.toInt()) | ||
} | ||
|
||
dependencies { | ||
implementation(libs.getLibrary("javax.inject")) | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
|
||
class MisikDataPlugin : Plugin<Project> { | ||
override fun apply(target: Project) { | ||
with(target) { | ||
with(pluginManager) { | ||
apply("misik.android.library") | ||
apply("misik.android.hilt") | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.