From ba205344db6ec7b63ad67dba0e6fdd70f3cf0d98 Mon Sep 17 00:00:00 2001 From: razeeman Date: Sat, 20 May 2023 14:04:17 +0300 Subject: [PATCH] refactor gradle files --- app/build.gradle.kts | 15 +++------------ .../util/simpletimetracker/Extensions.kt | 6 ++++++ core/build.gradle.kts | 19 +++---------------- data_local/build.gradle.kts | 13 +++---------- features/feature_archive/build.gradle.kts | 19 ++----------------- .../feature_base_adapter/build.gradle.kts | 19 ++----------------- features/feature_categories/build.gradle.kts | 19 ++----------------- .../build.gradle.kts | 19 ++----------------- .../feature_change_category/build.gradle.kts | 19 ++----------------- .../feature_change_record/build.gradle.kts | 19 ++----------------- .../build.gradle.kts | 19 ++----------------- .../build.gradle.kts | 19 ++----------------- .../build.gradle.kts | 19 ++----------------- features/feature_data_edit/build.gradle.kts | 19 ++----------------- features/feature_dialogs/build.gradle.kts | 19 ++----------------- features/feature_main/build.gradle.kts | 19 ++----------------- .../feature_notification/build.gradle.kts | 19 ++----------------- features/feature_records/build.gradle.kts | 19 ++----------------- features/feature_records_all/build.gradle.kts | 19 ++----------------- .../feature_records_filter/build.gradle.kts | 19 ++----------------- .../feature_running_records/build.gradle.kts | 19 ++----------------- features/feature_settings/build.gradle.kts | 19 ++----------------- features/feature_statistics/build.gradle.kts | 19 ++----------------- .../build.gradle.kts | 19 ++----------------- .../feature_tag_selection/build.gradle.kts | 19 ++----------------- features/feature_views/build.gradle.kts | 19 ++----------------- features/feature_widget/build.gradle.kts | 19 ++----------------- gradle/android_library.gradle | 18 ++++++++++++++++++ navigation/build.gradle.kts | 11 ++--------- 29 files changed, 81 insertions(+), 438 deletions(-) create mode 100644 buildSrc/src/main/kotlin/com/example/util/simpletimetracker/Extensions.kt create mode 100644 gradle/android_library.gradle diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 8f62f9b7..e6d2d251 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,5 +1,6 @@ import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.application") @@ -8,13 +9,11 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK +applyAndroidLibrary() +android { defaultConfig { applicationId = "com.razeeman.util.simpletimetracker" - minSdk = Base.minSDK - targetSdk = Base.currentSDK versionCode = Base.versionCode versionName = Base.versionName @@ -42,10 +41,6 @@ android { } } - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -54,10 +49,6 @@ android { testOptions { animationsDisabled = true } - - buildFeatures { - viewBinding = true - } } dependencies { diff --git a/buildSrc/src/main/kotlin/com/example/util/simpletimetracker/Extensions.kt b/buildSrc/src/main/kotlin/com/example/util/simpletimetracker/Extensions.kt new file mode 100644 index 00000000..b894d9f3 --- /dev/null +++ b/buildSrc/src/main/kotlin/com/example/util/simpletimetracker/Extensions.kt @@ -0,0 +1,6 @@ +package com.example.util.simpletimetracker + +import org.gradle.api.Project +import org.gradle.kotlin.dsl.apply + +fun Project.applyAndroidLibrary() = apply(from = "$rootDir/gradle/android_library.gradle") diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 414fdb5d..906c3c9c 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,14 +8,9 @@ plugins { id("kotlin-kapt") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } +applyAndroidLibrary() +android { buildTypes { getByName("debug") { buildConfigField("String", "VERSION_NAME", "\"${defaultConfig.versionName}\"") @@ -24,14 +19,6 @@ android { buildConfigField("String", "VERSION_NAME", "\"${defaultConfig.versionName}\"") } } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } } dependencies { diff --git a/data_local/build.gradle.kts b/data_local/build.gradle.kts index 30d160bc..84ea1f68 100644 --- a/data_local/build.gradle.kts +++ b/data_local/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -7,23 +7,16 @@ plugins { id("kotlin-kapt") } -android { - compileSdk = Base.currentSDK +applyAndroidLibrary() +android { defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - javaCompileOptions { annotationProcessorOptions { arguments += mapOf("room.schemaLocation" to "$projectDir/schemas") } } } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } } dependencies { diff --git a/features/feature_archive/build.gradle.kts b/features/feature_archive/build.gradle.kts index 36410cde..be3f43c3 100644 --- a/features/feature_archive/build.gradle.kts +++ b/features/feature_archive/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_base_adapter/build.gradle.kts b/features/feature_base_adapter/build.gradle.kts index 7a7f160e..b021a92e 100644 --- a/features/feature_base_adapter/build.gradle.kts +++ b/features/feature_base_adapter/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -7,22 +7,7 @@ plugins { id("kotlin-kapt") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":feature_views")) diff --git a/features/feature_categories/build.gradle.kts b/features/feature_categories/build.gradle.kts index 36410cde..be3f43c3 100644 --- a/features/feature_categories/build.gradle.kts +++ b/features/feature_categories/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_change_activity_filter/build.gradle.kts b/features/feature_change_activity_filter/build.gradle.kts index 36410cde..be3f43c3 100644 --- a/features/feature_change_activity_filter/build.gradle.kts +++ b/features/feature_change_activity_filter/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_change_category/build.gradle.kts b/features/feature_change_category/build.gradle.kts index 36410cde..be3f43c3 100644 --- a/features/feature_change_category/build.gradle.kts +++ b/features/feature_change_category/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_change_record/build.gradle.kts b/features/feature_change_record/build.gradle.kts index 36410cde..be3f43c3 100644 --- a/features/feature_change_record/build.gradle.kts +++ b/features/feature_change_record/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_change_record_tag/build.gradle.kts b/features/feature_change_record_tag/build.gradle.kts index 36410cde..be3f43c3 100644 --- a/features/feature_change_record_tag/build.gradle.kts +++ b/features/feature_change_record_tag/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_change_record_type/build.gradle.kts b/features/feature_change_record_type/build.gradle.kts index 36410cde..be3f43c3 100644 --- a/features/feature_change_record_type/build.gradle.kts +++ b/features/feature_change_record_type/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_change_running_record/build.gradle.kts b/features/feature_change_running_record/build.gradle.kts index 61fb63a7..aefadf87 100644 --- a/features/feature_change_running_record/build.gradle.kts +++ b/features/feature_change_running_record/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_data_edit/build.gradle.kts b/features/feature_data_edit/build.gradle.kts index 36410cde..be3f43c3 100644 --- a/features/feature_data_edit/build.gradle.kts +++ b/features/feature_data_edit/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_dialogs/build.gradle.kts b/features/feature_dialogs/build.gradle.kts index 36410cde..be3f43c3 100644 --- a/features/feature_dialogs/build.gradle.kts +++ b/features/feature_dialogs/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_main/build.gradle.kts b/features/feature_main/build.gradle.kts index 5ea7136f..1ad88ed7 100644 --- a/features/feature_main/build.gradle.kts +++ b/features/feature_main/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_notification/build.gradle.kts b/features/feature_notification/build.gradle.kts index 36410cde..be3f43c3 100644 --- a/features/feature_notification/build.gradle.kts +++ b/features/feature_notification/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_records/build.gradle.kts b/features/feature_records/build.gradle.kts index 62bb4322..140823bc 100644 --- a/features/feature_records/build.gradle.kts +++ b/features/feature_records/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -9,22 +9,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_records_all/build.gradle.kts b/features/feature_records_all/build.gradle.kts index 36410cde..be3f43c3 100644 --- a/features/feature_records_all/build.gradle.kts +++ b/features/feature_records_all/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_records_filter/build.gradle.kts b/features/feature_records_filter/build.gradle.kts index 36410cde..be3f43c3 100644 --- a/features/feature_records_filter/build.gradle.kts +++ b/features/feature_records_filter/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_running_records/build.gradle.kts b/features/feature_running_records/build.gradle.kts index 36410cde..be3f43c3 100644 --- a/features/feature_running_records/build.gradle.kts +++ b/features/feature_running_records/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_settings/build.gradle.kts b/features/feature_settings/build.gradle.kts index 36410cde..be3f43c3 100644 --- a/features/feature_settings/build.gradle.kts +++ b/features/feature_settings/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_statistics/build.gradle.kts b/features/feature_statistics/build.gradle.kts index 62bb4322..140823bc 100644 --- a/features/feature_statistics/build.gradle.kts +++ b/features/feature_statistics/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -9,22 +9,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_statistics_detail/build.gradle.kts b/features/feature_statistics_detail/build.gradle.kts index 62bb4322..140823bc 100644 --- a/features/feature_statistics_detail/build.gradle.kts +++ b/features/feature_statistics_detail/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -9,22 +9,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_tag_selection/build.gradle.kts b/features/feature_tag_selection/build.gradle.kts index 36410cde..be3f43c3 100644 --- a/features/feature_tag_selection/build.gradle.kts +++ b/features/feature_tag_selection/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/features/feature_views/build.gradle.kts b/features/feature_views/build.gradle.kts index ce44a2b2..08efe581 100644 --- a/features/feature_views/build.gradle.kts +++ b/features/feature_views/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("kotlin-kapt") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(Deps.Androidx.appcompat) diff --git a/features/feature_widget/build.gradle.kts b/features/feature_widget/build.gradle.kts index 02fbad42..7113f1d9 100644 --- a/features/feature_widget/build.gradle.kts +++ b/features/feature_widget/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,22 +8,7 @@ plugins { id("dagger.hilt.android.plugin") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } - - kotlinOptions { - jvmTarget = JavaVersion.VERSION_1_8.toString() - } - - buildFeatures { - viewBinding = true - } -} +applyAndroidLibrary() dependencies { implementation(project(":core")) diff --git a/gradle/android_library.gradle b/gradle/android_library.gradle new file mode 100644 index 00000000..40948994 --- /dev/null +++ b/gradle/android_library.gradle @@ -0,0 +1,18 @@ +import com.example.util.simpletimetracker.Base + +android { + compileSdk = Base.currentSDK + + defaultConfig { + minSdk = Base.minSDK + targetSdk = Base.currentSDK + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8.toString() + } + + buildFeatures { + viewBinding = true + } +} \ No newline at end of file diff --git a/navigation/build.gradle.kts b/navigation/build.gradle.kts index 6c715e39..06a1ae16 100644 --- a/navigation/build.gradle.kts +++ b/navigation/build.gradle.kts @@ -1,5 +1,5 @@ -import com.example.util.simpletimetracker.Base import com.example.util.simpletimetracker.Deps +import com.example.util.simpletimetracker.applyAndroidLibrary plugins { id("com.android.library") @@ -8,14 +8,7 @@ plugins { id("kotlin-kapt") } -android { - compileSdk = Base.currentSDK - - defaultConfig { - minSdk = Base.minSDK - targetSdk = Base.currentSDK - } -} +applyAndroidLibrary() dependencies { implementation(project(":domain")) -- 2.51.2