From 1c0fca724055cd7625359aee2b71826c5af266ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vivien=20Mah=C3=A9?= Date: Thu, 13 Jun 2024 07:52:58 +0200 Subject: [PATCH] Renames Dependencies to ProjectConfiguration --- androidApp/build.gradle.kts | 20 ++++++------ buildSrc/src/main/kotlin/Dependencies.kt | 32 ------------------- .../src/main/kotlin/ProjectConfiguration.kt | 29 +++++++++++++++++ shared/build.gradle.kts | 12 +++---- shared/data/build.gradle.kts | 10 +++--- shared/domain/build.gradle.kts | 10 +++--- shared/presentation/build.gradle.kts | 10 +++--- 7 files changed, 60 insertions(+), 63 deletions(-) delete mode 100644 buildSrc/src/main/kotlin/Dependencies.kt create mode 100644 buildSrc/src/main/kotlin/ProjectConfiguration.kt diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index 48e23fb..4eb00c2 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -8,15 +8,15 @@ plugins { } android { - namespace = Dependencies.Versions.MyProject.Android.namespace - compileSdk = Dependencies.Versions.MyProject.Android.compileSDK + namespace = ProjectConfiguration.MyProject.Android.namespace + compileSdk = ProjectConfiguration.MyProject.Android.compileSDK defaultConfig { - applicationId = Dependencies.Versions.MyProject.Android.applicationId - minSdk = Dependencies.Versions.MyProject.Android.minSDK - targetSdk = Dependencies.Versions.MyProject.Android.targetSDK - versionCode = Dependencies.Versions.MyProject.Android.versionCode - versionName = Dependencies.Versions.MyProject.versionName + applicationId = ProjectConfiguration.MyProject.Android.applicationId + minSdk = ProjectConfiguration.MyProject.Android.minSDK + targetSdk = ProjectConfiguration.MyProject.Android.targetSDK + versionCode = ProjectConfiguration.MyProject.Android.versionCode + versionName = ProjectConfiguration.MyProject.versionName } buildFeatures { @@ -48,14 +48,14 @@ android { } compileOptions { - sourceCompatibility = Dependencies.Versions.Compiler.javaCompatibility - targetCompatibility = Dependencies.Versions.Compiler.javaCompatibility + sourceCompatibility = ProjectConfiguration.Compiler.javaCompatibility + targetCompatibility = ProjectConfiguration.Compiler.javaCompatibility isCoreLibraryDesugaringEnabled = true } kotlinOptions { - jvmTarget = Dependencies.Versions.Compiler.jvmTarget + jvmTarget = ProjectConfiguration.Compiler.jvmTarget } } diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt deleted file mode 100644 index abc526c..0000000 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ /dev/null @@ -1,32 +0,0 @@ -import org.gradle.api.JavaVersion - -/** - * @author Vivien Mahe - * @since 23/07/2022 - */ - -object Dependencies { - - object Versions { - - // TODO Rename MyProject to your project name - object MyProject { - const val packageName = "com.tweener.changehere" // TODO Change this - const val versionName = "1.0" - - object Android { - const val applicationId = packageName - const val namespace = "$packageName.android" - const val compileSDK = 34 - const val targetSDK = compileSDK - const val minSDK = 24 - const val versionCode = 1 - } - } - - object Compiler { - const val jvmTarget = "17" - val javaCompatibility = JavaVersion.VERSION_17 - } - } -} diff --git a/buildSrc/src/main/kotlin/ProjectConfiguration.kt b/buildSrc/src/main/kotlin/ProjectConfiguration.kt new file mode 100644 index 0000000..afc10cf --- /dev/null +++ b/buildSrc/src/main/kotlin/ProjectConfiguration.kt @@ -0,0 +1,29 @@ +import org.gradle.api.JavaVersion + +/** + * @author Vivien Mahe + * @since 23/07/2022 + */ + +object ProjectConfiguration { + + // TODO Rename MyProject to your project name + object MyProject { + const val packageName = "com.tweener.changehere" // TODO Change this + const val versionName = "1.0" + + object Android { + const val applicationId = packageName + const val namespace = "$packageName.android" + const val compileSDK = 34 + const val targetSDK = compileSDK + const val minSDK = 24 + const val versionCode = 1 + } + } + + object Compiler { + const val jvmTarget = "17" + val javaCompatibility = JavaVersion.VERSION_17 + } +} diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 51a90c4..f182957 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -9,11 +9,11 @@ plugins { } android { - namespace = Dependencies.Versions.MyProject.packageName - compileSdk = Dependencies.Versions.MyProject.Android.compileSDK + namespace = ProjectConfiguration.MyProject.packageName + compileSdk = ProjectConfiguration.MyProject.Android.compileSDK defaultConfig { - minSdk = Dependencies.Versions.MyProject.Android.minSDK + minSdk = ProjectConfiguration.MyProject.Android.minSDK } buildFeatures { @@ -21,8 +21,8 @@ android { } compileOptions { - sourceCompatibility = Dependencies.Versions.Compiler.javaCompatibility - targetCompatibility = Dependencies.Versions.Compiler.javaCompatibility + sourceCompatibility = ProjectConfiguration.Compiler.javaCompatibility + targetCompatibility = ProjectConfiguration.Compiler.javaCompatibility } } @@ -117,7 +117,7 @@ kotlin { } buildkonfig { - packageName = Dependencies.Versions.MyProject.packageName + packageName = ProjectConfiguration.MyProject.packageName // Release defaultConfigs { diff --git a/shared/data/build.gradle.kts b/shared/data/build.gradle.kts index 1e50396..e7da7c9 100644 --- a/shared/data/build.gradle.kts +++ b/shared/data/build.gradle.kts @@ -6,16 +6,16 @@ plugins { } android { - namespace = Dependencies.Versions.MyProject.packageName + ".data" - compileSdk = Dependencies.Versions.MyProject.Android.compileSDK + namespace = ProjectConfiguration.MyProject.packageName + ".data" + compileSdk = ProjectConfiguration.MyProject.Android.compileSDK defaultConfig { - minSdk = Dependencies.Versions.MyProject.Android.minSDK + minSdk = ProjectConfiguration.MyProject.Android.minSDK } compileOptions { - sourceCompatibility = Dependencies.Versions.Compiler.javaCompatibility - targetCompatibility = Dependencies.Versions.Compiler.javaCompatibility + sourceCompatibility = ProjectConfiguration.Compiler.javaCompatibility + targetCompatibility = ProjectConfiguration.Compiler.javaCompatibility } } diff --git a/shared/domain/build.gradle.kts b/shared/domain/build.gradle.kts index 422bf27..9c31e14 100644 --- a/shared/domain/build.gradle.kts +++ b/shared/domain/build.gradle.kts @@ -4,16 +4,16 @@ plugins { } android { - namespace = Dependencies.Versions.MyProject.packageName + ".domain" - compileSdk = Dependencies.Versions.MyProject.Android.compileSDK + namespace = ProjectConfiguration.MyProject.packageName + ".domain" + compileSdk = ProjectConfiguration.MyProject.Android.compileSDK defaultConfig { - minSdk = Dependencies.Versions.MyProject.Android.minSDK + minSdk = ProjectConfiguration.MyProject.Android.minSDK } compileOptions { - sourceCompatibility = Dependencies.Versions.Compiler.javaCompatibility - targetCompatibility = Dependencies.Versions.Compiler.javaCompatibility + sourceCompatibility = ProjectConfiguration.Compiler.javaCompatibility + targetCompatibility = ProjectConfiguration.Compiler.javaCompatibility } } diff --git a/shared/presentation/build.gradle.kts b/shared/presentation/build.gradle.kts index 48f0a93..606c0c3 100644 --- a/shared/presentation/build.gradle.kts +++ b/shared/presentation/build.gradle.kts @@ -6,16 +6,16 @@ plugins { } android { - namespace = Dependencies.Versions.MyProject.packageName + ".presentation" - compileSdk = Dependencies.Versions.MyProject.Android.compileSDK + namespace = ProjectConfiguration.MyProject.packageName + ".presentation" + compileSdk = ProjectConfiguration.MyProject.Android.compileSDK defaultConfig { - minSdk = Dependencies.Versions.MyProject.Android.minSDK + minSdk = ProjectConfiguration.MyProject.Android.minSDK } compileOptions { - sourceCompatibility = Dependencies.Versions.Compiler.javaCompatibility - targetCompatibility = Dependencies.Versions.Compiler.javaCompatibility + sourceCompatibility = ProjectConfiguration.Compiler.javaCompatibility + targetCompatibility = ProjectConfiguration.Compiler.javaCompatibility } packaging {