|
1 |
| -//import com.google.wireless.android.sdk.stats.GradleBuildVariant.KotlinOptions |
2 |
| -//import org.jetbrains.kotlin.config.JvmTarget |
3 |
| - |
4 |
| -//plugins { |
5 |
| -// // Application Specific Plugins |
6 |
| -// id(BuildPlugins.androidApplication) |
7 |
| -// id(BuildPlugins.kotlinAndroid) |
8 |
| -// id(BuildPlugins.kotlinKapt) |
9 |
| -// id(BuildPlugins.kotlinAndroidExtensions) |
10 |
| -// id(BuildPlugins.androidHilt) |
11 |
| -// |
12 |
| -// // Internal Script plugins |
13 |
| -//// id(ScriptPlugins.variants) |
14 |
| -//// id(ScriptPlugins.quality) |
15 |
| -//// id(ScriptPlugins.compilation) |
16 |
| -//} |
17 |
| -// |
18 |
| -//android { |
19 |
| -// compileSdkVersion(AndroidSdk.compile) |
20 |
| -// |
21 |
| -// defaultConfig { |
22 |
| -// minSdkVersion(AndroidSdk.min) |
23 |
| -// targetSdkVersion(AndroidSdk.target) |
24 |
| -// |
25 |
| -// applicationId = AndroidClient.appId |
26 |
| -// versionCode = AndroidClient.versionCode |
27 |
| -// versionName = AndroidClient.versionName |
28 |
| -// testInstrumentationRunner = AndroidClient.testRunner |
29 |
| -// } |
30 |
| -// |
31 |
| -// sourceSets { |
32 |
| -// map { it.java.srcDir("src/${it.name}/kotlin") } |
33 |
| -// |
34 |
| -// //TODO: Remove this when migrating the DI framework |
35 |
| -// getByName("main") { java.srcDir("$buildDir/generated/source/kapt/main") } |
36 |
| -// } |
37 |
| -//} |
| 1 | +@file:Suppress("UnstableApiUsage") |
38 | 2 |
|
| 3 | +class AppConfig { |
| 4 | + val id = "com.fernandocejas.sample" |
| 5 | + val versionCode = 1 |
| 6 | + val versionName = "1.0" |
39 | 7 |
|
| 8 | + val compileSdk = libs.versions.compileSdk.get().toInt() |
| 9 | + val minSdk = libs.versions.minSdk.get().toInt() |
| 10 | + val targetSdk = libs.versions.targetSdk.get().toInt() |
40 | 11 |
|
41 |
| -plugins { |
42 |
| - id("com.android.application") |
43 |
| - id("org.jetbrains.kotlin.android") |
44 |
| - id("kotlin-android") |
45 |
| - id("kotlin-kapt") |
46 |
| - id("com.google.dagger.hilt.android") |
47 |
| - |
48 |
| -// id("kotlin-android-extensions") |
49 |
| -// kotlin("android.extensions") |
50 |
| -// id("dagger.hilt.android.plugin") |
51 |
| -// id("com.google.devtools.ksp") |
| 12 | + val javaVersion = JavaVersion.VERSION_17 |
| 13 | + val testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" |
52 | 14 | }
|
53 | 15 |
|
54 |
| -//repositories { |
55 |
| -// google() |
56 |
| -// mavenCentral() |
57 |
| -//} |
| 16 | +plugins { |
| 17 | + id("com.android.application") |
| 18 | + id("org.jetbrains.kotlin.android") |
| 19 | + id("kotlin-android") |
| 20 | + id("kotlin-kapt") |
| 21 | + id("com.google.dagger.hilt.android") |
| 22 | +} |
58 | 23 |
|
59 | 24 | android {
|
60 |
| - namespace = "com.fernandocejas.sample" |
61 |
| - |
62 |
| - compileSdk = 33 |
63 |
| - defaultConfig { |
64 |
| - applicationId = "com.fernandocejas.sample" |
65 |
| - minSdk = 29 |
66 |
| - targetSdk = 33 |
67 |
| - versionCode = 1 |
68 |
| - versionName = "1.0" |
69 |
| - |
70 |
| - testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" |
71 |
| - } |
72 |
| - |
73 |
| - compileOptions { |
74 |
| - sourceCompatibility = JavaVersion.VERSION_17 |
75 |
| - targetCompatibility = JavaVersion.VERSION_17 |
76 |
| - } |
77 |
| - |
78 |
| - kotlinOptions { |
79 |
| - jvmTarget = "17" |
80 |
| - } |
81 |
| - |
82 |
| - buildFeatures { |
83 |
| - viewBinding = true |
84 |
| - } |
85 |
| - |
86 |
| - buildTypes { |
87 |
| - getByName("debug") { |
88 |
| - isMinifyEnabled = false |
| 25 | + val appConfig = AppConfig() |
| 26 | + |
| 27 | + namespace = appConfig.id |
| 28 | + compileSdk = appConfig.compileSdk |
| 29 | + |
| 30 | + defaultConfig { |
| 31 | + applicationId = appConfig.id |
| 32 | + |
| 33 | + minSdk = appConfig.minSdk |
| 34 | + targetSdk = appConfig.targetSdk |
| 35 | + versionCode = appConfig.versionCode |
| 36 | + versionName = appConfig.versionName |
| 37 | + |
| 38 | + testInstrumentationRunner = appConfig.testInstrumentationRunner |
89 | 39 | }
|
90 |
| - getByName("release") { |
91 |
| - isMinifyEnabled = false |
| 40 | + |
| 41 | + compileOptions { |
| 42 | + sourceCompatibility = appConfig.javaVersion |
| 43 | + targetCompatibility = appConfig.javaVersion |
| 44 | + } |
| 45 | + |
| 46 | + kotlinOptions { |
| 47 | + jvmTarget = appConfig.javaVersion.toString() |
92 | 48 | }
|
93 |
| - } |
94 |
| -} |
95 | 49 |
|
96 |
| -//dependencies { |
97 |
| -// //Compile time dependencies |
98 |
| -// ksp(Libraries.lifecycleCompiler) |
99 |
| -// ksp(Libraries.hiltCompiler) |
100 |
| -// |
101 |
| -// // Application dependencies |
102 |
| -// implementation(Libraries.kotlinStdLib) |
103 |
| -// implementation(Libraries.kotlinCoroutines) |
104 |
| -// implementation(Libraries.kotlinCoroutinesAndroid) |
105 |
| -// implementation(Libraries.appCompat) |
106 |
| -// implementation(Libraries.ktxCore) |
107 |
| -// implementation(Libraries.constraintLayout) |
108 |
| -// implementation(Libraries.viewModel) |
109 |
| -// implementation(Libraries.liveData) |
110 |
| -// implementation(Libraries.lifecycleExtensions) |
111 |
| -// implementation(Libraries.cardView) |
112 |
| -// implementation(Libraries.recyclerView) |
113 |
| -// implementation(Libraries.material) |
114 |
| -// implementation(Libraries.androidAnnotations) |
115 |
| -// implementation(Libraries.glide) |
116 |
| -// implementation(Libraries.hilt) |
117 |
| -// implementation(Libraries.retrofit) |
118 |
| -// implementation(Libraries.okHttpLoggingInterceptor) |
119 |
| -// |
120 |
| -// //TODO: change this |
121 |
| -// implementation("androidx.fragment:fragment-ktx:1.2.5") |
122 |
| -// |
123 |
| -// // Unit/Android tests dependencies |
124 |
| -// testImplementation(TestLibraries.junit4) |
125 |
| -// testImplementation(TestLibraries.mockk) |
126 |
| -// testImplementation(TestLibraries.kluent) |
127 |
| -// testImplementation(TestLibraries.robolectric) |
128 |
| -// |
129 |
| -// // Acceptance tests dependencies |
130 |
| -// androidTestImplementation(TestLibraries.testRunner) |
131 |
| -// androidTestImplementation(TestLibraries.espressoCore) |
132 |
| -// androidTestImplementation(TestLibraries.testExtJunit) |
133 |
| -// androidTestImplementation(TestLibraries.testRules) |
134 |
| -// androidTestImplementation(TestLibraries.espressoIntents) |
135 |
| -// androidTestImplementation(TestLibraries.hiltTesting) |
136 |
| -// |
137 |
| -// // Development dependencies |
138 |
| -// debugImplementation(DevLibraries.leakCanary) |
139 |
| -//} |
| 50 | + buildFeatures { |
| 51 | + viewBinding = true |
| 52 | + } |
| 53 | + |
| 54 | + buildTypes { |
| 55 | + getByName("debug") { |
| 56 | + isMinifyEnabled = false |
| 57 | + } |
| 58 | + getByName("release") { |
| 59 | + isMinifyEnabled = false |
| 60 | + } |
| 61 | + } |
| 62 | +} |
140 | 63 |
|
141 | 64 | dependencies {
|
142 |
| - //Compile time dependencies |
| 65 | + //Compile time dependencies |
143 | 66 | // ksp("androidx.lifecycle:lifecycle-compiler:2.6.1")
|
144 | 67 | // ksp("com.google.dagger:hilt-android-compiler:2.46.1")
|
145 |
| - kapt("androidx.lifecycle:lifecycle-compiler:2.6.1") |
| 68 | + kapt("androidx.lifecycle:lifecycle-compiler:2.6.1") |
146 | 69 | // kapt("com.google.dagger:hilt-android-compiler:2.46.1")
|
147 | 70 |
|
148 |
| - implementation("com.google.dagger:hilt-android:2.44") |
149 |
| - kapt("com.google.dagger:hilt-android-compiler:2.44") |
150 |
| - |
151 |
| - |
152 |
| - // Application dependencies |
153 |
| - implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22") |
154 |
| - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.2") |
155 |
| - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.2") |
156 |
| - implementation("androidx.appcompat:appcompat:1.6.1") |
157 |
| - implementation("androidx.core:core-ktx:1.10.1") |
158 |
| - implementation("androidx.constraintlayout:constraintlayout:2.1.4") |
159 |
| - implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1") |
160 |
| - implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.1") |
161 |
| - implementation("androidx.lifecycle:lifecycle-extensions:2.2.0") |
162 |
| - |
163 |
| - // Update from here |
164 |
| - implementation("androidx.cardview:cardview:1.0.0") |
165 |
| - implementation("androidx.recyclerview:recyclerview:1.3.0") |
166 |
| - implementation("com.google.android.material:material:1.9.0") |
167 |
| - implementation("androidx.annotation:annotation:1.6.0") |
168 |
| - implementation("com.github.bumptech.glide:glide:4.15.1") |
| 71 | + implementation("com.google.dagger:hilt-android:2.44") |
| 72 | + kapt("com.google.dagger:hilt-android-compiler:2.44") |
| 73 | + |
| 74 | + |
| 75 | + // Application dependencies |
| 76 | + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22") |
| 77 | + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.2") |
| 78 | + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.2") |
| 79 | + implementation("androidx.appcompat:appcompat:1.6.1") |
| 80 | + implementation("androidx.core:core-ktx:1.10.1") |
| 81 | + implementation("androidx.constraintlayout:constraintlayout:2.1.4") |
| 82 | + implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1") |
| 83 | + implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.6.1") |
| 84 | + implementation("androidx.lifecycle:lifecycle-extensions:2.2.0") |
| 85 | + |
| 86 | + // Update from here |
| 87 | + implementation("androidx.cardview:cardview:1.0.0") |
| 88 | + implementation("androidx.recyclerview:recyclerview:1.3.0") |
| 89 | + implementation("com.google.android.material:material:1.9.0") |
| 90 | + implementation("androidx.annotation:annotation:1.6.0") |
| 91 | + implementation("com.github.bumptech.glide:glide:4.15.1") |
169 | 92 | // implementation("com.google.dagger:hilt-android:2.46.1")
|
170 |
| - implementation("com.squareup.retrofit2:converter-gson:2.9.0") |
171 |
| - implementation("com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.11") |
172 |
| - |
173 |
| - //TODO: change this |
174 |
| - implementation("androidx.fragment:fragment-ktx:1.6.0") |
175 |
| - |
176 |
| - // Unit/Android tests dependencies |
177 |
| - testImplementation("junit:junit:4.13.2") |
178 |
| - testImplementation("io.mockk:mockk:1.13.5") |
179 |
| - testImplementation("org.amshove.kluent:kluent-android:1.73") |
180 |
| - testImplementation("org.robolectric:robolectric:4.10.3") |
181 |
| - |
182 |
| - // Acceptance tests dependencies |
183 |
| - androidTestImplementation("androidx.test:runner:1.5.2") |
184 |
| - androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") |
185 |
| - androidTestImplementation("androidx.test.ext:junit:1.1.5") |
186 |
| - androidTestImplementation("androidx.test:rules:1.5.0") |
187 |
| - androidTestImplementation("androidx.test.espresso:espresso-intents:3.5.1") |
188 |
| - androidTestImplementation("com.google.dagger:hilt-android-testing:2.46.1") |
189 |
| - |
190 |
| - // Development dependencies |
191 |
| - debugImplementation("com.squareup.leakcanary:leakcanary-android:2.12") |
| 93 | + implementation("com.squareup.retrofit2:converter-gson:2.9.0") |
| 94 | + implementation("com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.11") |
| 95 | + |
| 96 | + //TODO: change this |
| 97 | + implementation("androidx.fragment:fragment-ktx:1.6.0") |
| 98 | + |
| 99 | + // Unit/Android tests dependencies |
| 100 | + testImplementation("junit:junit:4.13.2") |
| 101 | + testImplementation("io.mockk:mockk:1.13.5") |
| 102 | + testImplementation("org.amshove.kluent:kluent-android:1.73") |
| 103 | + testImplementation("org.robolectric:robolectric:4.10.3") |
| 104 | + |
| 105 | + // Acceptance tests dependencies |
| 106 | + androidTestImplementation("androidx.test:runner:1.5.2") |
| 107 | + androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") |
| 108 | + androidTestImplementation("androidx.test.ext:junit:1.1.5") |
| 109 | + androidTestImplementation("androidx.test:rules:1.5.0") |
| 110 | + androidTestImplementation("androidx.test.espresso:espresso-intents:3.5.1") |
| 111 | + androidTestImplementation("com.google.dagger:hilt-android-testing:2.46.1") |
| 112 | + |
| 113 | + // Development dependencies |
| 114 | + debugImplementation("com.squareup.leakcanary:leakcanary-android:2.12") |
192 | 115 | }
|
0 commit comments