diff --git a/app-nia-catalog/build.gradle b/app-nia-catalog/build.gradle.kts similarity index 71% rename from app-nia-catalog/build.gradle rename to app-nia-catalog/build.gradle.kts index 29dae629c..be9d173ee 100644 --- a/app-nia-catalog/build.gradle +++ b/app-nia-catalog/build.gradle.kts @@ -14,24 +14,24 @@ * limitations under the License. */ plugins { - id 'nowinandroid.android.application' - id 'nowinandroid.android.application.compose' + id("nowinandroid.android.application") + id("nowinandroid.android.application.compose") } android { defaultConfig { - applicationId "com.google.samples.apps.niacatalog" + applicationId = "com.google.samples.apps.niacatalog" } packagingOptions { resources { - excludes += '/META-INF/{AL2.0,LGPL2.1}' + excludes.add("/META-INF/{AL2.0,LGPL2.1}") } } } dependencies { - implementation project(':core-ui') + implementation(project(":core-ui")) - implementation libs.androidx.activity.compose + implementation(libs.androidx.activity.compose) } \ No newline at end of file diff --git a/app-nia-catalog/proguard-rules.pro b/app-nia-catalog/proguard-rules.pro index 481bb4348..ff59496d8 100644 --- a/app-nia-catalog/proguard-rules.pro +++ b/app-nia-catalog/proguard-rules.pro @@ -1,6 +1,6 @@ # Add project specific ProGuard rules here. # You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. +# proguardFiles setting in build.gradle.kts. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 8d8dc3e01..000000000 --- a/app/build.gradle +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -plugins { - id 'nowinandroid.android.application' - id 'nowinandroid.android.application.compose' - id 'nowinandroid.android.application.jacoco' - id 'kotlin-kapt' - id 'jacoco' - id 'dagger.hilt.android.plugin' - id 'nowinandroid.spotless' -} - -android { - defaultConfig { - applicationId "com.google.samples.apps.nowinandroid" - versionCode 1 - versionName "0.0.1" // X.Y.Z; X = Major, Y = minor, Z = Patch level - - // Custom test runner to set up Hilt dependency graph - testInstrumentationRunner "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner" - vectorDrawables { - useSupportLibrary true - } - } - - buildTypes { - release { - minifyEnabled true - proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' - } - benchmark { - initWith buildTypes.release - signingConfig signingConfigs.debug - matchingFallbacks = ['release'] - proguardFiles 'benchmark-rules.pro' - } - } - packagingOptions { - resources { - excludes += '/META-INF/{AL2.0,LGPL2.1}' - } - } - testOptions { - unitTests { - includeAndroidResources = true - } - } -} - -dependencies { - implementation project(':feature-following') - implementation project(':feature-foryou') - implementation project(':feature-topic') - - implementation project(':core-ui') - - implementation project(':sync') - - androidTestImplementation project(':core-testing') - androidTestImplementation project(':core-datastore-test') - androidTestImplementation project(':core-domain-test') - androidTestImplementation project(':core-network') - - implementation libs.androidx.activity.compose - implementation libs.androidx.appcompat - implementation libs.androidx.core.ktx - implementation libs.androidx.compose.material3.windowSizeClass - implementation libs.androidx.hilt.navigation.compose - implementation libs.androidx.navigation.compose - implementation libs.androidx.window.manager - implementation libs.material3 - implementation libs.androidx.profileinstaller - - implementation libs.coil.kt - implementation libs.coil.kt.svg - - implementation libs.hilt.android - kapt libs.hilt.compiler - kaptAndroidTest libs.hilt.compiler - - // androidx.test is forcing JUnit, 4.12. This forces it to use 4.13 - configurations.configureEach { - resolutionStrategy { - force libs.junit4 - // Temporary workaround for https://issuetracker.google.com/174733673 - force 'org.objenesis:objenesis:2.6' - } - } -} diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 000000000..e6284a6f2 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,102 @@ +/* + * Copyright 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +plugins { + id("nowinandroid.android.application") + id("nowinandroid.android.application.compose") + id("nowinandroid.android.application.jacoco") + kotlin("kapt") + id("jacoco") + id("dagger.hilt.android.plugin") + id("nowinandroid.spotless") +} + +android { + defaultConfig { + applicationId = "com.google.samples.apps.nowinandroid" + versionCode = 1 + versionName = "0.0.1" // X.Y.Z; X = Major, Y = minor, Z = Patch level + + // Custom test runner to set up Hilt dependency graph + testInstrumentationRunner = "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner" + vectorDrawables { + useSupportLibrary = true + } + } + + buildTypes { + val release by getting { + isMinifyEnabled = true + proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") + } + val benchmark by creating { + initWith(release) + signingConfig = signingConfigs.getByName("debug") + matchingFallbacks.add("release") + proguardFiles("benchmark-rules.pro") + } + } + packagingOptions { + resources { + excludes.add("/META-INF/{AL2.0,LGPL2.1}") + } + } + testOptions { + unitTests { + isIncludeAndroidResources = true + } + } +} + +dependencies { + implementation(project(":feature-following")) + implementation(project(":feature-foryou")) + implementation(project(":feature-topic")) + + implementation(project(":core-ui")) + + implementation(project(":sync")) + + androidTestImplementation(project(":core-testing")) + androidTestImplementation(project(":core-datastore-test")) + androidTestImplementation(project(":core-domain-test")) + androidTestImplementation(project(":core-network")) + + implementation(libs.androidx.activity.compose) + implementation(libs.androidx.appcompat) + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.compose.material3.windowSizeClass) + implementation(libs.androidx.hilt.navigation.compose) + implementation(libs.androidx.navigation.compose) + implementation(libs.androidx.window.manager) + implementation(libs.material3) + implementation(libs.androidx.profileinstaller) + + implementation(libs.coil.kt) + implementation(libs.coil.kt.svg) + + implementation(libs.hilt.android) + kapt(libs.hilt.compiler) + kaptAndroidTest(libs.hilt.compiler) + + // androidx.test is forcing JUnit, 4.12. This forces it to use 4.13 + configurations.configureEach { + resolutionStrategy { + force(libs.junit4) + // Temporary workaround for https://issuetracker.google.com/174733673 + force("org.objenesis:objenesis:2.6") + } + } +} diff --git a/benchmark/build.gradle b/benchmark/build.gradle.kts similarity index 55% rename from benchmark/build.gradle rename to benchmark/build.gradle.kts index b4acb5d89..393981903 100644 --- a/benchmark/build.gradle +++ b/benchmark/build.gradle.kts @@ -15,26 +15,26 @@ */ plugins { - id "nowinandroid.android.test" - id 'nowinandroid.spotless' + id("nowinandroid.android.test") + id("nowinandroid.spotless") } android { - namespace 'com.google.samples.apps.nowinandroid.benchmark' + namespace = "com.google.samples.apps.nowinandroid.benchmark" defaultConfig { - minSdk 23 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + minSdk = 23 + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } buildTypes { // This benchmark buildType is used for benchmarking, and should function like your // release build (for example, with minification on). It's signed with a debug key // for easy local/CI testing. - benchmark { - debuggable true - signingConfig debug.signingConfig - matchingFallbacks = ['release'] + val benchmark by creating { + isDebuggable = true + signingConfig = signingConfigs.getByName("debug") + matchingFallbacks.add("release") } } @@ -43,18 +43,18 @@ android { } dependencies { - implementation libs.androidx.test.core - implementation libs.androidx.test.espresso.core - implementation libs.androidx.test.ext - implementation libs.androidx.test.runner - implementation libs.androidx.test.rules - implementation libs.androidx.test.uiautomator - implementation libs.androidx.benchmark.macro - implementation libs.androidx.profileinstaller + implementation(libs.androidx.test.core) + implementation(libs.androidx.test.espresso.core) + implementation(libs.androidx.test.ext) + implementation(libs.androidx.test.runner) + implementation(libs.androidx.test.rules) + implementation(libs.androidx.test.uiautomator) + implementation(libs.androidx.benchmark.macro) + implementation(libs.androidx.profileinstaller) } androidComponents { - beforeVariants(selector().all()) { - enabled = buildType == "benchmark" + beforeVariants { + it.enable = it.buildType == "benchmark" } } \ No newline at end of file diff --git a/build.gradle b/build.gradle.kts similarity index 100% rename from build.gradle rename to build.gradle.kts diff --git a/core-common/build.gradle b/core-common/build.gradle.kts similarity index 71% rename from core-common/build.gradle rename to core-common/build.gradle.kts index 01fb65a7c..33464929a 100644 --- a/core-common/build.gradle +++ b/core-common/build.gradle.kts @@ -14,14 +14,14 @@ * limitations under the License. */ plugins { - id "nowinandroid.android.library" - id "nowinandroid.android.library.jacoco" - id 'kotlin-kapt' - id 'nowinandroid.spotless' + id("nowinandroid.android.library") + id("nowinandroid.android.library.jacoco") + kotlin("kapt") + id("nowinandroid.spotless") } dependencies { - implementation libs.kotlinx.coroutines.android - implementation libs.hilt.android - kapt libs.hilt.compiler + implementation(libs.kotlinx.coroutines.android) + implementation(libs.hilt.android) + kapt(libs.hilt.compiler) } \ No newline at end of file diff --git a/core-database/build.gradle b/core-database/build.gradle.kts similarity index 64% rename from core-database/build.gradle rename to core-database/build.gradle.kts index 80c89e610..0461f28f2 100644 --- a/core-database/build.gradle +++ b/core-database/build.gradle.kts @@ -14,12 +14,12 @@ * limitations under the License. */ plugins { - id 'nowinandroid.android.library' - id "nowinandroid.android.library.jacoco" - id 'kotlin-kapt' - id 'dagger.hilt.android.plugin' + id("nowinandroid.android.library") + id("nowinandroid.android.library.jacoco") + kotlin("kapt") + id("dagger.hilt.android.plugin") alias(libs.plugins.ksp) - id 'nowinandroid.spotless' + id("nowinandroid.spotless") } android { @@ -31,31 +31,31 @@ android { arg("room.schemaLocation", "$projectDir/schemas") } - testInstrumentationRunner "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner" + testInstrumentationRunner = "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner" } } dependencies { - implementation project(':core-model') + implementation(project(":core-model")) - implementation libs.room.runtime - implementation libs.room.ktx - ksp libs.room.compiler + implementation(libs.room.runtime) + implementation(libs.room.ktx) + ksp(libs.room.compiler) - implementation libs.kotlinx.coroutines.android - implementation libs.kotlinx.datetime + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlinx.datetime) - implementation libs.hilt.android - kapt libs.hilt.compiler + implementation(libs.hilt.android) + kapt(libs.hilt.compiler) - androidTestImplementation project(':core-testing') + androidTestImplementation(project(":core-testing")) // androidx.test is forcing JUnit, 4.12. This forces it to use 4.13 configurations.configureEach { resolutionStrategy { - force libs.junit4 + force(libs.junit4) // Temporary workaround for https://issuetracker.google.com/174733673 - force 'org.objenesis:objenesis:2.6' + force("org.objenesis:objenesis:2.6") } } } \ No newline at end of file diff --git a/core-datastore-test/build.gradle b/core-datastore-test/build.gradle.kts similarity index 66% rename from core-datastore-test/build.gradle rename to core-datastore-test/build.gradle.kts index 41dd13088..9b59bd85b 100644 --- a/core-datastore-test/build.gradle +++ b/core-datastore-test/build.gradle.kts @@ -14,26 +14,26 @@ * limitations under the License. */ plugins { - id "nowinandroid.android.library" - id 'kotlin-kapt' - id 'dagger.hilt.android.plugin' - id 'nowinandroid.spotless' + id("nowinandroid.android.library") + kotlin("kapt") + id("dagger.hilt.android.plugin") + id("nowinandroid.spotless") } dependencies { - api project(':core-datastore') - implementation project(':core-testing') + api(project(":core-datastore")) + implementation(project(":core-testing")) - api libs.androidx.dataStore.core + api(libs.androidx.dataStore.core) - implementation libs.hilt.android - kapt libs.hilt.compiler - kaptAndroidTest libs.hilt.compiler + implementation(libs.hilt.android) + kapt(libs.hilt.compiler) + kaptAndroidTest(libs.hilt.compiler) configurations.configureEach { resolutionStrategy { // Temporary workaround for https://issuetracker.google.com/174733673 - force 'org.objenesis:objenesis:2.6' + force("org.objenesis:objenesis:2.6") } } } diff --git a/core-datastore/build.gradle b/core-datastore/build.gradle.kts similarity index 51% rename from core-datastore/build.gradle rename to core-datastore/build.gradle.kts index 4e0c4b8e6..f9a5b154d 100644 --- a/core-datastore/build.gradle +++ b/core-datastore/build.gradle.kts @@ -13,28 +13,34 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +import com.google.protobuf.gradle.builtins +import com.google.protobuf.gradle.generateProtoTasks +import com.google.protobuf.gradle.protobuf +import com.google.protobuf.gradle.protoc + plugins { - id "nowinandroid.android.library" - id "nowinandroid.android.library.jacoco" - id 'kotlin-kapt' - id 'dagger.hilt.android.plugin' + id("nowinandroid.android.library") + id("nowinandroid.android.library.jacoco") + kotlin("kapt") + id("dagger.hilt.android.plugin") alias(libs.plugins.protobuf) - id 'nowinandroid.spotless' + id("nowinandroid.spotless") } // Setup protobuf configuration, generating lite Java and Kotlin classes protobuf { protoc { - artifact = libs.protobuf.protoc.get() + artifact = libs.protobuf.protoc.get().toString() } generateProtoTasks { - all().each { task -> + all().forEach { task -> task.builtins { - java { - option "lite" + val java by registering { + option("lite") } - kotlin { - option "lite" + val kotlin by registering { + option("lite") } } } @@ -42,16 +48,16 @@ protobuf { } dependencies { - implementation project(':core-common') + implementation(project(":core-common")) - testImplementation project(':core-testing') + testImplementation(project(":core-testing")) - implementation libs.kotlinx.coroutines.android + implementation(libs.kotlinx.coroutines.android) - implementation libs.androidx.dataStore.core + implementation(libs.androidx.dataStore.core) implementation(libs.protobuf.kotlin.lite) - implementation libs.hilt.android - kapt libs.hilt.compiler - kaptAndroidTest libs.hilt.compiler + implementation(libs.hilt.android) + kapt(libs.hilt.compiler) + kaptAndroidTest(libs.hilt.compiler) } diff --git a/core-domain-test/build.gradle b/core-domain-test/build.gradle.kts similarity index 69% rename from core-domain-test/build.gradle rename to core-domain-test/build.gradle.kts index f7bca4cbc..1b80285b2 100644 --- a/core-domain-test/build.gradle +++ b/core-domain-test/build.gradle.kts @@ -14,24 +14,24 @@ * limitations under the License. */ plugins { - id "nowinandroid.android.library" - id 'kotlin-kapt' - id 'dagger.hilt.android.plugin' - id 'nowinandroid.spotless' + id("nowinandroid.android.library") + kotlin("kapt") + id("dagger.hilt.android.plugin") + id("nowinandroid.spotless") } dependencies { - api project(':core-domain') - implementation project(':core-testing') + api(project(":core-domain")) + implementation(project(":core-testing")) - implementation libs.hilt.android - kapt libs.hilt.compiler - kaptAndroidTest libs.hilt.compiler + implementation(libs.hilt.android) + kapt(libs.hilt.compiler) + kaptAndroidTest(libs.hilt.compiler) configurations.configureEach { resolutionStrategy { // Temporary workaround for https://issuetracker.google.com/174733673 - force 'org.objenesis:objenesis:2.6' + force("org.objenesis:objenesis:2.6") } } } diff --git a/core-domain/build.gradle b/core-domain/build.gradle deleted file mode 100644 index fa766806f..000000000 --- a/core-domain/build.gradle +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -plugins { - id "nowinandroid.android.library" - id "nowinandroid.android.library.jacoco" - id 'kotlin-kapt' - id 'kotlinx-serialization' - id 'dagger.hilt.android.plugin' - id 'nowinandroid.spotless' -} - -dependencies { - implementation project(':core-common') - implementation project(':core-model') - implementation project(':core-database') - implementation project(':core-datastore') - implementation project(':core-network') - - testImplementation project(':core-testing') - testImplementation project(':core-datastore-test') - - implementation libs.kotlinx.datetime - implementation libs.kotlinx.coroutines.android - implementation libs.kotlinx.serialization.json - - implementation libs.hilt.android - kapt libs.hilt.compiler -} diff --git a/core-domain/build.gradle.kts b/core-domain/build.gradle.kts new file mode 100644 index 000000000..66fa5bcb4 --- /dev/null +++ b/core-domain/build.gradle.kts @@ -0,0 +1,41 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +plugins { + id("nowinandroid.android.library") + id("nowinandroid.android.library.jacoco") + kotlin("kapt") + id("kotlinx-serialization") + id("dagger.hilt.android.plugin") + id("nowinandroid.spotless") +} + +dependencies { + implementation(project(":core-common")) + implementation(project(":core-model")) + implementation(project(":core-database")) + implementation(project(":core-datastore")) + implementation(project(":core-network")) + + testImplementation(project(":core-testing")) + testImplementation(project(":core-datastore-test")) + + implementation(libs.kotlinx.datetime) + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlinx.serialization.json) + + implementation(libs.hilt.android) + kapt(libs.hilt.compiler) +} diff --git a/core-model/build.gradle b/core-model/build.gradle.kts similarity index 60% rename from core-model/build.gradle rename to core-model/build.gradle.kts index bfda73e2c..bda0c4037 100644 --- a/core-model/build.gradle +++ b/core-model/build.gradle.kts @@ -14,21 +14,21 @@ * limitations under the License. */ plugins { - id "nowinandroid.android.library" - id "nowinandroid.android.library.jacoco" - id 'kotlinx-serialization' + id("nowinandroid.android.library") + id("nowinandroid.android.library.jacoco") + id("kotlinx-serialization") alias(libs.plugins.ksp) - id 'nowinandroid.spotless' + id("nowinandroid.spotless") } dependencies { - testImplementation project(':core-testing') + testImplementation(project(":core-testing")) - implementation libs.room.runtime - implementation libs.room.ktx - ksp libs.room.compiler + implementation(libs.room.runtime) + implementation(libs.room.ktx) + ksp(libs.room.compiler) - implementation libs.kotlinx.coroutines.android - implementation libs.kotlinx.datetime - implementation libs.kotlinx.serialization.json + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlinx.datetime) + implementation(libs.kotlinx.serialization.json) } \ No newline at end of file diff --git a/core-network/build.gradle b/core-network/build.gradle deleted file mode 100644 index 5afdb7fe4..000000000 --- a/core-network/build.gradle +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -plugins { - id "nowinandroid.android.library" - id "nowinandroid.android.library.jacoco" - id 'kotlin-kapt' - id 'kotlinx-serialization' - id 'dagger.hilt.android.plugin' - id 'nowinandroid.spotless' -} - -dependencies { - implementation project(':core-common') - implementation project(':core-model') - - testImplementation project(':core-testing') - - implementation libs.kotlinx.coroutines.android - implementation libs.kotlinx.serialization.json - implementation libs.kotlinx.datetime - - implementation libs.okhttp.logging - implementation libs.retrofit.core - implementation libs.retrofit.kotlin.serialization - - implementation libs.hilt.android - kapt libs.hilt.compiler -} diff --git a/core-network/build.gradle.kts b/core-network/build.gradle.kts new file mode 100644 index 000000000..0eb1889bc --- /dev/null +++ b/core-network/build.gradle.kts @@ -0,0 +1,41 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +plugins { + id("nowinandroid.android.library") + id("nowinandroid.android.library.jacoco") + kotlin("kapt") + id("kotlinx-serialization") + id("dagger.hilt.android.plugin") + id("nowinandroid.spotless") +} + +dependencies { + implementation(project(":core-common")) + implementation(project(":core-model")) + + testImplementation(project(":core-testing")) + + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlinx.serialization.json) + implementation(libs.kotlinx.datetime) + + implementation(libs.okhttp.logging) + implementation(libs.retrofit.core) + implementation(libs.retrofit.kotlin.serialization) + + implementation(libs.hilt.android) + kapt(libs.hilt.compiler) +} diff --git a/core-testing/build.gradle b/core-testing/build.gradle.kts similarity index 53% rename from core-testing/build.gradle rename to core-testing/build.gradle.kts index bae26696b..35e4359d7 100644 --- a/core-testing/build.gradle +++ b/core-testing/build.gradle.kts @@ -14,37 +14,37 @@ * limitations under the License. */ plugins { - id "nowinandroid.android.library" - id 'kotlin-kapt' - id 'nowinandroid.spotless' + id("nowinandroid.android.library") + kotlin("kapt") + id("nowinandroid.spotless") } dependencies { - implementation project(':core-common') - implementation project(':core-domain') - implementation project(':core-model') + implementation(project(":core-common")) + implementation(project(":core-domain")) + implementation(project(":core-model")) - implementation libs.hilt.android - kapt libs.hilt.compiler + implementation(libs.hilt.android) + kapt(libs.hilt.compiler) - api libs.junit4 - api libs.mockk - api libs.androidx.test.core - api libs.kotlinx.coroutines.test - api libs.turbine + api(libs.junit4) + api(libs.mockk) + api(libs.androidx.test.core) + api(libs.kotlinx.coroutines.test) + api(libs.turbine) - api libs.androidx.test.espresso.core - api libs.androidx.test.runner - api libs.androidx.test.rules - api libs.androidx.compose.ui.test - api libs.hilt.android.testing + api(libs.androidx.test.espresso.core) + api(libs.androidx.test.runner) + api(libs.androidx.test.rules) + api(libs.androidx.compose.ui.test) + api(libs.hilt.android.testing) - debugApi libs.androidx.compose.ui.testManifest + debugApi(libs.androidx.compose.ui.testManifest) configurations.configureEach { resolutionStrategy { // Temporary workaround for https://issuetracker.google.com/174733673 - force 'org.objenesis:objenesis:2.6' + force("org.objenesis:objenesis:2.6") } } } diff --git a/core-ui/build.gradle b/core-ui/build.gradle deleted file mode 100644 index fdb97ba5d..000000000 --- a/core-ui/build.gradle +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -plugins { - id "nowinandroid.android.library" - id "nowinandroid.android.library.compose" - id "nowinandroid.android.library.jacoco" - id 'nowinandroid.spotless' -} - -dependencies { - implementation project(':core-model') - - implementation libs.androidx.core.ktx - implementation libs.coil.kt - implementation libs.coil.kt.compose - implementation libs.kotlinx.datetime - - // TODO : Remove these dependencies when b/225193889 is fixed - // These dependencies are currently necessary to render Compose previews - debugImplementation "androidx.savedstate:savedstate-ktx:1.1.0" - debugImplementation libs.androidx.lifecycle.viewModelCompose - - api libs.androidx.compose.foundation - api libs.androidx.compose.foundation.layout - api libs.androidx.compose.material.iconsExtended - api libs.androidx.compose.material3 - debugApi libs.androidx.compose.ui.tooling - api libs.androidx.compose.ui.tooling.preview - api libs.androidx.compose.ui.util - api libs.androidx.compose.runtime - api libs.androidx.compose.runtime.livedata -} \ No newline at end of file diff --git a/core-ui/build.gradle.kts b/core-ui/build.gradle.kts new file mode 100644 index 000000000..f71e9af3b --- /dev/null +++ b/core-ui/build.gradle.kts @@ -0,0 +1,45 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +plugins { + id("nowinandroid.android.library") + id("nowinandroid.android.library.compose") + id("nowinandroid.android.library.jacoco") + id("nowinandroid.spotless") +} + +dependencies { + implementation(project(":core-model")) + + implementation(libs.androidx.core.ktx) + implementation(libs.coil.kt) + implementation(libs.coil.kt.compose) + implementation(libs.kotlinx.datetime) + + // TODO : Remove these dependencies when b/225193889 is fixed + // These dependencies are currently necessary to render Compose previews + debugImplementation("androidx.savedstate:savedstate-ktx:1.1.0") + debugImplementation(libs.androidx.lifecycle.viewModelCompose) + + api(libs.androidx.compose.foundation) + api(libs.androidx.compose.foundation.layout) + api(libs.androidx.compose.material.iconsExtended) + api(libs.androidx.compose.material3) + debugApi(libs.androidx.compose.ui.tooling) + api(libs.androidx.compose.ui.tooling.preview) + api(libs.androidx.compose.ui.util) + api(libs.androidx.compose.runtime) + api(libs.androidx.compose.runtime.livedata) +} \ No newline at end of file diff --git a/feature-following/build.gradle b/feature-following/build.gradle deleted file mode 100644 index 4df475c6d..000000000 --- a/feature-following/build.gradle +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -plugins { - id "nowinandroid.android.library" - id "nowinandroid.android.library.compose" - id "nowinandroid.android.library.jacoco" - id 'kotlin-kapt' - id 'dagger.hilt.android.plugin' - id 'nowinandroid.spotless' -} - -android { - defaultConfig { - testInstrumentationRunner "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner" - } -} - -dependencies { - implementation project(':core-model') - implementation project(':core-ui') - implementation project(':core-domain') - - testImplementation project(':core-testing') - androidTestImplementation project(':core-testing') - - implementation libs.coil.kt - implementation libs.coil.kt.compose - - implementation libs.kotlinx.coroutines.android - - implementation libs.androidx.hilt.navigation.compose - implementation libs.androidx.lifecycle.viewModelCompose - - implementation libs.hilt.android - kapt libs.hilt.compiler - - // androidx.test is forcing JUnit, 4.12. This forces it to use 4.13 - configurations.configureEach { - resolutionStrategy { - force libs.junit4 - // Temporary workaround for https://issuetracker.google.com/174733673 - force 'org.objenesis:objenesis:2.6' - } - } -} diff --git a/feature-following/build.gradle.kts b/feature-following/build.gradle.kts new file mode 100644 index 000000000..ecc16eb5c --- /dev/null +++ b/feature-following/build.gradle.kts @@ -0,0 +1,58 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +plugins { + id("nowinandroid.android.library") + id("nowinandroid.android.library.compose") + id("nowinandroid.android.library.jacoco") + kotlin("kapt") + id("dagger.hilt.android.plugin") + id("nowinandroid.spotless") +} + +android { + defaultConfig { + testInstrumentationRunner = "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner" + } +} + +dependencies { + implementation(project(":core-model")) + implementation(project(":core-ui")) + implementation(project(":core-domain")) + + testImplementation(project(":core-testing")) + androidTestImplementation(project(":core-testing")) + + implementation(libs.coil.kt) + implementation(libs.coil.kt.compose) + + implementation(libs.kotlinx.coroutines.android) + + implementation(libs.androidx.hilt.navigation.compose) + implementation(libs.androidx.lifecycle.viewModelCompose) + + implementation(libs.hilt.android) + kapt(libs.hilt.compiler) + + // androidx.test is forcing JUnit, 4.12. This forces it to use 4.13 + configurations.configureEach { + resolutionStrategy { + force(libs.junit4) + // Temporary workaround for https://issuetracker.google.com/174733673 + force("org.objenesis:objenesis:2.6") + } + } +} diff --git a/feature-foryou/build.gradle b/feature-foryou/build.gradle deleted file mode 100644 index d62a8cacf..000000000 --- a/feature-foryou/build.gradle +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -plugins { - id "nowinandroid.android.library" - id "nowinandroid.android.library.compose" - id "nowinandroid.android.library.jacoco" - id 'kotlin-kapt' - id 'dagger.hilt.android.plugin' - id 'nowinandroid.spotless' -} - -android { - defaultConfig { - testInstrumentationRunner "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner" - } -} - -dependencies { - implementation project(':core-model') - implementation project(':core-ui') - implementation project(':core-domain') - - testImplementation project(':core-testing') - androidTestImplementation project(':core-testing') - - implementation libs.kotlinx.coroutines.android - implementation libs.kotlinx.datetime - - implementation libs.androidx.hilt.navigation.compose - implementation libs.androidx.lifecycle.viewModelCompose - - implementation libs.accompanist.flowlayout - - implementation libs.coil.kt - implementation libs.coil.kt.compose - - implementation libs.hilt.android - kapt libs.hilt.compiler - - // androidx.test is forcing JUnit, 4.12. This forces it to use 4.13 - configurations.configureEach { - resolutionStrategy { - force libs.junit4 - // Temporary workaround for https://issuetracker.google.com/174733673 - force 'org.objenesis:objenesis:2.6' - } - } -} diff --git a/feature-foryou/build.gradle.kts b/feature-foryou/build.gradle.kts new file mode 100644 index 000000000..0b75ef98e --- /dev/null +++ b/feature-foryou/build.gradle.kts @@ -0,0 +1,61 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +plugins { + id("nowinandroid.android.library") + id("nowinandroid.android.library.compose") + id("nowinandroid.android.library.jacoco") + kotlin("kapt") + id("dagger.hilt.android.plugin") + id("nowinandroid.spotless") +} + +android { + defaultConfig { + testInstrumentationRunner = "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner" + } +} + +dependencies { + implementation(project(":core-model")) + implementation(project(":core-ui")) + implementation(project(":core-domain")) + + testImplementation(project(":core-testing")) + androidTestImplementation(project(":core-testing")) + + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlinx.datetime) + + implementation(libs.androidx.hilt.navigation.compose) + implementation(libs.androidx.lifecycle.viewModelCompose) + + implementation(libs.accompanist.flowlayout) + + implementation(libs.coil.kt) + implementation(libs.coil.kt.compose) + + implementation(libs.hilt.android) + kapt(libs.hilt.compiler) + + // androidx.test is forcing JUnit, 4.12. This forces it to use 4.13 + configurations.configureEach { + resolutionStrategy { + force(libs.junit4) + // Temporary workaround for https://issuetracker.google.com/174733673 + force("org.objenesis:objenesis:2.6") + } + } +} diff --git a/feature-topic/build.gradle b/feature-topic/build.gradle deleted file mode 100644 index 87cc84855..000000000 --- a/feature-topic/build.gradle +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -plugins { - id "nowinandroid.android.library" - id "nowinandroid.android.library.compose" - id "nowinandroid.android.library.jacoco" - id 'kotlin-kapt' - id 'dagger.hilt.android.plugin' - id 'nowinandroid.spotless' -} - -android { - defaultConfig { - testInstrumentationRunner "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner" - } -} - -dependencies { - implementation project(':core-model') - implementation project(':core-ui') - implementation project(':core-domain') - implementation project(':core-common') - - testImplementation project(':core-testing') - androidTestImplementation project(':core-testing') - - implementation libs.kotlinx.coroutines.android - implementation libs.kotlinx.datetime - - implementation libs.androidx.hilt.navigation.compose - implementation libs.androidx.lifecycle.viewModelCompose - - implementation libs.hilt.android - kapt libs.hilt.compiler - - // androidx.test is forcing JUnit, 4.12. This forces it to use 4.13 - configurations.configureEach { - resolutionStrategy { - force libs.junit4 - // Temporary workaround for https://issuetracker.google.com/174733673 - force 'org.objenesis:objenesis:2.6' - } - } -} diff --git a/feature-topic/build.gradle.kts b/feature-topic/build.gradle.kts new file mode 100644 index 000000000..49dff3974 --- /dev/null +++ b/feature-topic/build.gradle.kts @@ -0,0 +1,57 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +plugins { + id("nowinandroid.android.library") + id("nowinandroid.android.library.compose") + id("nowinandroid.android.library.jacoco") + kotlin("kapt") + id("dagger.hilt.android.plugin") + id("nowinandroid.spotless") +} + +android { + defaultConfig { + testInstrumentationRunner = "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner" + } +} + +dependencies { + implementation(project(":core-model")) + implementation(project(":core-ui")) + implementation(project(":core-domain")) + implementation(project(":core-common")) + + testImplementation(project(":core-testing")) + androidTestImplementation(project(":core-testing")) + + implementation(libs.kotlinx.coroutines.android) + implementation(libs.kotlinx.datetime) + + implementation(libs.androidx.hilt.navigation.compose) + implementation(libs.androidx.lifecycle.viewModelCompose) + + implementation(libs.hilt.android) + kapt(libs.hilt.compiler) + + // androidx.test is forcing JUnit, 4.12. This forces it to use 4.13 + configurations.configureEach { + resolutionStrategy { + force(libs.junit4) + // Temporary workaround for https://issuetracker.google.com/174733673 + force("org.objenesis:objenesis:2.6") + } + } +} diff --git a/settings.gradle b/settings.gradle.kts similarity index 72% rename from settings.gradle rename to settings.gradle.kts index e851c524c..ee4bafea8 100644 --- a/settings.gradle +++ b/settings.gradle.kts @@ -28,8 +28,7 @@ dependencyResolutionManagement { repositories { // Register the AndroidX snapshot repository first so snapshots don't attempt (and fail) // to download from the non-snapshot repositories - maven { - url 'https://androidx.dev/snapshots/builds/8455591/artifacts/repository' + maven(url = "https://androidx.dev/snapshots/builds/8455591/artifacts/repository") { content { // The AndroidX snapshot repository will only have androidx artifacts, don't // bother trying to find other ones @@ -41,20 +40,20 @@ dependencyResolutionManagement { } } rootProject.name = "nowinandroid" -include ':app' -include ':app-nia-catalog' -include ':benchmark' -include ':core-common' -include ':core-domain' -include ':core-domain-test' -include ':core-database' -include ':core-datastore' -include ':core-datastore-test' -include ':core-model' -include ':core-network' -include ':core-ui' -include ':core-testing' -include ':feature-following' -include ':feature-foryou' -include ':feature-topic' -include ':sync' +include(":app") +include(":app-nia-catalog") +include(":benchmark") +include(":core-common") +include(":core-domain") +include(":core-domain-test") +include(":core-database") +include(":core-datastore") +include(":core-datastore-test") +include(":core-model") +include(":core-network") +include(":core-ui") +include(":core-testing") +include(":feature-following") +include(":feature-foryou") +include(":feature-topic") +include(":sync") diff --git a/sync/build.gradle b/sync/build.gradle deleted file mode 100644 index 413dd449c..000000000 --- a/sync/build.gradle +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -plugins { - id "nowinandroid.android.library" - id "nowinandroid.android.library.jacoco" - id 'kotlin-kapt' - id 'dagger.hilt.android.plugin' - id 'nowinandroid.spotless' -} - -android { - defaultConfig { - testInstrumentationRunner "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner" - } -} - -dependencies { - implementation project(':core-common') - implementation project(':core-model') - implementation project(':core-domain') - implementation project(':core-datastore') - - implementation libs.kotlinx.coroutines.android - - implementation libs.androidx.startup - implementation libs.androidx.work.ktx - implementation libs.hilt.ext.work - - testImplementation project(':core-testing') - androidTestImplementation project(':core-testing') - - implementation libs.hilt.android - kapt libs.hilt.compiler - kapt libs.hilt.ext.compiler - - androidTestImplementation libs.androidx.work.testing - - kaptAndroidTest libs.hilt.compiler - kaptAndroidTest libs.hilt.ext.compiler - - configurations.configureEach { - resolutionStrategy { - // Temporary workaround for https://issuetracker.google.com/174733673 - force 'org.objenesis:objenesis:2.6' - } - } -} diff --git a/sync/build.gradle.kts b/sync/build.gradle.kts new file mode 100644 index 000000000..e8120c4e5 --- /dev/null +++ b/sync/build.gradle.kts @@ -0,0 +1,60 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +plugins { + id("nowinandroid.android.library") + id("nowinandroid.android.library.jacoco") + kotlin("kapt") + id("dagger.hilt.android.plugin") + id("nowinandroid.spotless") +} + +android { + defaultConfig { + testInstrumentationRunner = "com.google.samples.apps.nowinandroid.core.testing.NiaTestRunner" + } +} + +dependencies { + implementation(project(":core-common")) + implementation(project(":core-model")) + implementation(project(":core-domain")) + implementation(project(":core-datastore")) + + implementation(libs.kotlinx.coroutines.android) + + implementation(libs.androidx.startup) + implementation(libs.androidx.work.ktx) + implementation(libs.hilt.ext.work) + + testImplementation(project(":core-testing")) + androidTestImplementation(project(":core-testing")) + + implementation(libs.hilt.android) + kapt(libs.hilt.compiler) + kapt(libs.hilt.ext.compiler) + + androidTestImplementation(libs.androidx.work.testing) + + kaptAndroidTest(libs.hilt.compiler) + kaptAndroidTest(libs.hilt.ext.compiler) + + configurations.configureEach { + resolutionStrategy { + // Temporary workaround for https://issuetracker.google.com/174733673 + force("org.objenesis:objenesis:2.6") + } + } +}