diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index 265ff2ba5..efe4ef29a 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -10,7 +10,7 @@ Thanks for submitting a pull request. To accept your pull request we need you do
**Ensure tests pass and code is formatted correctly**
- Run local tests on the `DemoDebug` variant by running `./gradlew testDemoDebug`
-- Fix code formatting: `./gradlew --init-script gradle/init.gradle.kts spotlessApply`
+- Fix code formatting: `./gradlew spotlessApply`
**Add a description**
diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml
index 82be0b359..40e77512d 100644
--- a/.github/workflows/Build.yaml
+++ b/.github/workflows/Build.yaml
@@ -48,7 +48,7 @@ jobs:
run: ./gradlew :build-logic:convention:check
- name: Check spotless
- run: ./gradlew spotlessCheck --init-script gradle/init.gradle.kts --no-configuration-cache
+ run: ./gradlew spotlessCheck
- name: Check Dependency Guard
id: dependencyguard_verify
diff --git a/.run/spotlessApply.run.xml b/.run/spotlessApply.run.xml
index 5c4dac833..03bd19a6d 100644
--- a/.run/spotlessApply.run.xml
+++ b/.run/spotlessApply.run.xml
@@ -4,7 +4,6 @@
-
diff --git a/AGENTS.md b/AGENTS.md
index efb39ef19..edcfd396e 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -26,7 +26,7 @@ The main Android app lives in the `app/` folder. Feature modules live in `featur
The app and Android libraries have two product flavors: `demo` and `prod`, and two build types: `debug` and `release`.
- Build: `./gradlew assemble{Variant}`. Typically `assembleDemoDebug`.
-- Fix linting/formatting: `./gradlew --init-script gradle/init.gradle.kts spotlessApply`
+- Fix linting/formatting: `./gradlew spotlessApply`
- Run local tests: `./gradlew {variant}Test`
- Run single test: `./gradlew {variant}Test --tests "com.example.myapp.MyTestClass"`
- Run local screenshot tests: `./gradlew verifyRoborazziDemoDebug`
diff --git a/app-nia-catalog/src/main/AndroidManifest.xml b/app-nia-catalog/src/main/AndroidManifest.xml
index 90341aac1..57286c5f1 100644
--- a/app-nia-catalog/src/main/AndroidManifest.xml
+++ b/app-nia-catalog/src/main/AndroidManifest.xml
@@ -36,4 +36,4 @@
-
\ No newline at end of file
+
diff --git a/app-nia-catalog/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app-nia-catalog/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
index 28878a729..9572fa6cb 100644
--- a/app-nia-catalog/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+++ b/app-nia-catalog/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -18,4 +18,4 @@
-
\ No newline at end of file
+
diff --git a/app-nia-catalog/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app-nia-catalog/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
index 28878a729..9572fa6cb 100644
--- a/app-nia-catalog/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+++ b/app-nia-catalog/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -18,4 +18,4 @@
-
\ No newline at end of file
+
diff --git a/app-nia-catalog/src/main/res/values/strings.xml b/app-nia-catalog/src/main/res/values/strings.xml
index 69a3e1b11..0d92aba29 100644
--- a/app-nia-catalog/src/main/res/values/strings.xml
+++ b/app-nia-catalog/src/main/res/values/strings.xml
@@ -16,4 +16,4 @@
-->
NiA Catalog
-
\ No newline at end of file
+
diff --git a/app-nia-catalog/src/main/res/values/themes.xml b/app-nia-catalog/src/main/res/values/themes.xml
index 9aeeb83a6..afcbaf5fc 100644
--- a/app-nia-catalog/src/main/res/values/themes.xml
+++ b/app-nia-catalog/src/main/res/values/themes.xml
@@ -16,4 +16,4 @@
-->
-
\ No newline at end of file
+
diff --git a/app/README.md b/app/README.md
index cbcdc35be..bc2e9cb41 100644
--- a/app/README.md
+++ b/app/README.md
@@ -54,7 +54,7 @@ graph TB
:core:data[data]:::android-library
:core:database[database]:::android-library
:core:datastore[datastore]:::android-library
- :core:datastore-proto[datastore-proto]:::android-library
+ :core:datastore-proto[datastore-proto]:::jvm-library
:core:designsystem[designsystem]:::android-library
:core:domain[domain]:::android-library
:core:model[model]:::jvm-library
diff --git a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/util/ProfileVerifierLogger.kt b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/util/ProfileVerifierLogger.kt
index 595166f03..659b134b8 100644
--- a/app/src/main/kotlin/com/google/samples/apps/nowinandroid/util/ProfileVerifierLogger.kt
+++ b/app/src/main/kotlin/com/google/samples/apps/nowinandroid/util/ProfileVerifierLogger.kt
@@ -18,7 +18,7 @@ package com.google.samples.apps.nowinandroid.util
import android.util.Log
import androidx.profileinstaller.ProfileVerifier
-import com.google.samples.apps.nowinandroid.core.network.di.ApplicationScope
+import com.google.samples.apps.nowinandroid.core.common.network.di.ApplicationScope
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.guava.await
import kotlinx.coroutines.launch
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
index 28878a729..9572fa6cb 100644
--- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -18,4 +18,4 @@
-
\ No newline at end of file
+
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
index 28878a729..9572fa6cb 100644
--- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -18,4 +18,4 @@
-
\ No newline at end of file
+
diff --git a/app/src/prod/AndroidManifest.xml b/app/src/prod/AndroidManifest.xml
index 2f8a8592a..4438a1de0 100644
--- a/app/src/prod/AndroidManifest.xml
+++ b/app/src/prod/AndroidManifest.xml
@@ -23,4 +23,4 @@
android:name="firebase_analytics_collection_deactivated"
android:value="false" />
-
\ No newline at end of file
+
diff --git a/benchmarks/README.md b/benchmarks/README.md
index c2bbf2a2a..14218e6f2 100644
--- a/benchmarks/README.md
+++ b/benchmarks/README.md
@@ -54,7 +54,7 @@ graph TB
:core:data[data]:::android-library
:core:database[database]:::android-library
:core:datastore[datastore]:::android-library
- :core:datastore-proto[datastore-proto]:::android-library
+ :core:datastore-proto[datastore-proto]:::jvm-library
:core:designsystem[designsystem]:::android-library
:core:domain[domain]:::android-library
:core:model[model]:::jvm-library
diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts
index 5faf257c1..41491da4f 100644
--- a/build-logic/convention/build.gradle.kts
+++ b/build-logic/convention/build.gradle.kts
@@ -45,6 +45,7 @@ dependencies {
compileOnly(libs.kotlin.gradlePlugin)
compileOnly(libs.ksp.gradlePlugin)
compileOnly(libs.room.gradlePlugin)
+ compileOnly(libs.spotless.gradlePlugin)
implementation(libs.truth)
lintChecks(libs.androidx.lint.gradle)
}
diff --git a/build-logic/convention/src/main/kotlin/AndroidApplicationComposeConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidApplicationComposeConventionPlugin.kt
index 0a33b719f..b5725e63c 100644
--- a/build-logic/convention/src/main/kotlin/AndroidApplicationComposeConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/AndroidApplicationComposeConventionPlugin.kt
@@ -1,17 +1,17 @@
/*
* 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
+ * 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
+ * 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.
+ * 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.
*/
import com.android.build.api.dsl.ApplicationExtension
diff --git a/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt
index 8c45a056c..cddcf5fe2 100644
--- a/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt
@@ -1,17 +1,17 @@
/*
* 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
+ * 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
+ * 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.
+ * 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.
*/
import com.android.build.api.dsl.ApplicationExtension
@@ -20,12 +20,13 @@ import com.google.samples.apps.nowinandroid.configureBadgingTasks
import com.google.samples.apps.nowinandroid.configureGradleManagedDevices
import com.google.samples.apps.nowinandroid.configureKotlinAndroid
import com.google.samples.apps.nowinandroid.configurePrintApksTask
+import com.google.samples.apps.nowinandroid.configureSpotlessForAndroid
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.configure
-class AndroidApplicationConventionPlugin : Plugin {
+abstract class AndroidApplicationConventionPlugin : Plugin {
override fun apply(target: Project) {
with(target) {
apply(plugin = "com.android.application")
@@ -42,6 +43,7 @@ class AndroidApplicationConventionPlugin : Plugin {
configurePrintApksTask(this)
configureBadgingTasks(this)
}
+ configureSpotlessForAndroid()
}
}
}
diff --git a/build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt
index be3ec0365..343bb2e8e 100644
--- a/build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/AndroidApplicationFirebaseConventionPlugin.kt
@@ -1,17 +1,17 @@
/*
* 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
+ * 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
+ * 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.
+ * 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.
*/
import com.android.build.api.dsl.ApplicationExtension
@@ -41,7 +41,7 @@ class AndroidApplicationFirebaseConventionPlugin : Plugin {
datastore-proto brings in protobuf dependencies. These are the source of truth
for Now in Android.
That's why the duplicate classes from below dependencies are excluded.
- */
+ */
exclude(group = "com.google.protobuf", module = "protobuf-javalite")
exclude(group = "com.google.firebase", module = "protolite-well-known-types")
}
diff --git a/build-logic/convention/src/main/kotlin/AndroidApplicationFlavorsConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidApplicationFlavorsConventionPlugin.kt
index 46b019d7a..6954aaae6 100644
--- a/build-logic/convention/src/main/kotlin/AndroidApplicationFlavorsConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/AndroidApplicationFlavorsConventionPlugin.kt
@@ -1,17 +1,17 @@
/*
* Copyright 2023 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
+ * 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
+ * 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.
+ * 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.
*/
import com.android.build.api.dsl.ApplicationExtension
@@ -28,4 +28,4 @@ class AndroidApplicationFlavorsConventionPlugin : Plugin {
}
}
}
-}
\ No newline at end of file
+}
diff --git a/build-logic/convention/src/main/kotlin/AndroidApplicationJacocoConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidApplicationJacocoConventionPlugin.kt
index 326d03f4f..22e25b638 100644
--- a/build-logic/convention/src/main/kotlin/AndroidApplicationJacocoConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/AndroidApplicationJacocoConventionPlugin.kt
@@ -1,17 +1,17 @@
/*
* 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
+ * 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
+ * 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.
+ * 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.
*/
import com.android.build.api.dsl.ApplicationExtension
diff --git a/build-logic/convention/src/main/kotlin/AndroidFeatureApiConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidFeatureApiConventionPlugin.kt
index 969cf96d4..7c2b49180 100644
--- a/build-logic/convention/src/main/kotlin/AndroidFeatureApiConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/AndroidFeatureApiConventionPlugin.kt
@@ -1,20 +1,19 @@
/*
* 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
+ * 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
+ * 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.
+ * 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.
*/
-import com.google.samples.apps.nowinandroid.libs
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply
diff --git a/build-logic/convention/src/main/kotlin/AndroidFeatureImplConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidFeatureImplConventionPlugin.kt
index 500e3e983..82459e07f 100644
--- a/build-logic/convention/src/main/kotlin/AndroidFeatureImplConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/AndroidFeatureImplConventionPlugin.kt
@@ -1,17 +1,17 @@
/*
* 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
+ * 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
+ * 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.
+ * 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.
*/
import com.android.build.api.dsl.LibraryExtension
diff --git a/build-logic/convention/src/main/kotlin/AndroidLibraryComposeConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidLibraryComposeConventionPlugin.kt
index 18cd2bd7d..10938ca37 100644
--- a/build-logic/convention/src/main/kotlin/AndroidLibraryComposeConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/AndroidLibraryComposeConventionPlugin.kt
@@ -1,17 +1,17 @@
/*
* 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
+ * 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
+ * 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.
+ * 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.
*/
import com.android.build.api.dsl.LibraryExtension
diff --git a/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt
index ee47e823a..d5aaa131d 100644
--- a/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/AndroidLibraryConventionPlugin.kt
@@ -1,17 +1,17 @@
/*
* 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
+ * 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
+ * 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.
+ * 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.
*/
import com.android.build.api.dsl.LibraryExtension
@@ -20,6 +20,7 @@ import com.google.samples.apps.nowinandroid.configureFlavors
import com.google.samples.apps.nowinandroid.configureGradleManagedDevices
import com.google.samples.apps.nowinandroid.configureKotlinAndroid
import com.google.samples.apps.nowinandroid.configurePrintApksTask
+import com.google.samples.apps.nowinandroid.configureSpotlessForAndroid
import com.google.samples.apps.nowinandroid.disableUnnecessaryAndroidTests
import com.google.samples.apps.nowinandroid.libs
import org.gradle.api.Plugin
@@ -28,7 +29,7 @@ import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.dependencies
-class AndroidLibraryConventionPlugin : Plugin {
+abstract class AndroidLibraryConventionPlugin : Plugin {
override fun apply(target: Project) {
with(target) {
apply(plugin = "com.android.library")
@@ -52,6 +53,7 @@ class AndroidLibraryConventionPlugin : Plugin {
configurePrintApksTask(this)
disableUnnecessaryAndroidTests(target)
}
+ configureSpotlessForAndroid()
dependencies {
"androidTestImplementation"(libs.findLibrary("kotlin.test").get())
"testImplementation"(libs.findLibrary("kotlin.test").get())
diff --git a/build-logic/convention/src/main/kotlin/AndroidLibraryJacocoConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidLibraryJacocoConventionPlugin.kt
index 2fd97d456..dcda1d98a 100644
--- a/build-logic/convention/src/main/kotlin/AndroidLibraryJacocoConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/AndroidLibraryJacocoConventionPlugin.kt
@@ -1,17 +1,17 @@
/*
* 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
+ * 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
+ * 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.
+ * 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.
*/
import com.android.build.api.dsl.LibraryExtension
diff --git a/build-logic/convention/src/main/kotlin/AndroidLintConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidLintConventionPlugin.kt
index 884d6f076..c701983b1 100644
--- a/build-logic/convention/src/main/kotlin/AndroidLintConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/AndroidLintConventionPlugin.kt
@@ -1,17 +1,17 @@
/*
* 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
+ * 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
+ * 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.
+ * 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.
*/
import com.android.build.api.dsl.ApplicationExtension
diff --git a/build-logic/convention/src/main/kotlin/AndroidRoomConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidRoomConventionPlugin.kt
index 6919b5e5d..c199914db 100644
--- a/build-logic/convention/src/main/kotlin/AndroidRoomConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/AndroidRoomConventionPlugin.kt
@@ -1,17 +1,17 @@
/*
* 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
+ * 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
+ * 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.
+ * 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.
*/
import androidx.room.gradle.RoomExtension
diff --git a/build-logic/convention/src/main/kotlin/AndroidTestConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidTestConventionPlugin.kt
index 8a2f0b5a4..155889464 100644
--- a/build-logic/convention/src/main/kotlin/AndroidTestConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/AndroidTestConventionPlugin.kt
@@ -1,17 +1,17 @@
/*
* 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
+ * 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
+ * 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.
+ * 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.
*/
import com.android.build.api.dsl.TestExtension
diff --git a/build-logic/convention/src/main/kotlin/HiltConventionPlugin.kt b/build-logic/convention/src/main/kotlin/HiltConventionPlugin.kt
index 82bf9f60c..938595417 100644
--- a/build-logic/convention/src/main/kotlin/HiltConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/HiltConventionPlugin.kt
@@ -1,17 +1,17 @@
/*
* Copyright 2023 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
+ * 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
+ * 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.
+ * 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.
*/
import com.android.build.gradle.api.AndroidBasePlugin
diff --git a/build-logic/convention/src/main/kotlin/JvmLibraryConventionPlugin.kt b/build-logic/convention/src/main/kotlin/JvmLibraryConventionPlugin.kt
index a1477891d..9e7633f4d 100644
--- a/build-logic/convention/src/main/kotlin/JvmLibraryConventionPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/JvmLibraryConventionPlugin.kt
@@ -1,33 +1,35 @@
/*
* Copyright 2023 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
+ * 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
+ * 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.
+ * 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.
*/
import com.google.samples.apps.nowinandroid.configureKotlinJvm
+import com.google.samples.apps.nowinandroid.configureSpotlessForJvm
import com.google.samples.apps.nowinandroid.libs
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.apply
import org.gradle.kotlin.dsl.dependencies
-class JvmLibraryConventionPlugin : Plugin {
+abstract class JvmLibraryConventionPlugin : Plugin {
override fun apply(target: Project) {
with(target) {
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "nowinandroid.android.lint")
configureKotlinJvm()
+ configureSpotlessForJvm()
dependencies {
"testImplementation"(libs.findLibrary("kotlin.test").get())
}
diff --git a/build-logic/convention/src/main/kotlin/RootPlugin.kt b/build-logic/convention/src/main/kotlin/RootPlugin.kt
index b704adf76..26c940635 100644
--- a/build-logic/convention/src/main/kotlin/RootPlugin.kt
+++ b/build-logic/convention/src/main/kotlin/RootPlugin.kt
@@ -15,12 +15,24 @@
*/
import com.google.samples.apps.nowinandroid.configureGraphTasks
+import com.google.samples.apps.nowinandroid.configureSpotlessForRootProject
import org.gradle.api.Plugin
import org.gradle.api.Project
+import org.gradle.api.configuration.BuildFeatures
+import javax.inject.Inject
+
+abstract class RootPlugin : Plugin {
+ @get:Inject abstract val buildFeatures: BuildFeatures
-class RootPlugin : Plugin {
override fun apply(target: Project) {
require(target.path == ":")
- target.subprojects { configureGraphTasks() }
+ if (!buildFeatures.isIsolatedProjectsEnabled()) {
+ target.subprojects { configureGraphTasks() }
+ }
+ target.configureSpotlessForRootProject()
}
}
+
+private fun BuildFeatures.isIsolatedProjectsEnabled(): Boolean {
+ return isolatedProjects.active.getOrElse(false)
+}
diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/AndroidInstrumentedTests.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/AndroidInstrumentedTests.kt
index c51dac5c9..9531e9caf 100644
--- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/AndroidInstrumentedTests.kt
+++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/AndroidInstrumentedTests.kt
@@ -1,17 +1,17 @@
/*
* Copyright 2023 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
+ * 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
+ * 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.
+ * 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.
*/
package com.google.samples.apps.nowinandroid
@@ -30,6 +30,6 @@ import org.gradle.api.Project
internal fun LibraryAndroidComponentsExtension.disableUnnecessaryAndroidTests(
project: Project,
) = beforeVariants {
- it.androidTest.enable = it.androidTest.enable
- && project.projectDir.resolve("src/androidTest").exists()
+ it.androidTest.enable = it.androidTest.enable &&
+ project.projectDir.resolve("src/androidTest").exists()
}
diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Badging.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Badging.kt
index e747325ee..803ee00e7 100644
--- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Badging.kt
+++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Badging.kt
@@ -1,17 +1,17 @@
/*
* Copyright 2023 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
+ * 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
+ * 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.
+ * 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.
*/
package com.google.samples.apps.nowinandroid
@@ -123,7 +123,6 @@ fun Project.configureBadgingTasks(
badging = project.layout.buildDirectory.file(
"outputs/apk_from_bundle/${variant.name}/${variant.name}-badging.txt",
)
-
}
val updateBadgingTaskName = "update${capitalizedVariantName}Badging"
@@ -141,7 +140,6 @@ fun Project.configureBadgingTasks(
this.updateBadgingTaskName = updateBadgingTaskName
output = project.layout.buildDirectory.dir("intermediates/$checkBadgingTaskName")
-
}
}
}
diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/GradleManagedDevices.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/GradleManagedDevices.kt
index 992a3f91e..548df4c2f 100644
--- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/GradleManagedDevices.kt
+++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/GradleManagedDevices.kt
@@ -1,17 +1,17 @@
/*
* Copyright 2023 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
+ * 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
+ * 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.
+ * 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.
*/
package com.google.samples.apps.nowinandroid
@@ -34,7 +34,6 @@ internal fun configureGradleManagedDevices(
val allDevices = listOf(pixel4, pixel6, pixelC)
val ciDevices = listOf(pixel4, pixelC)
-
commonExtension.testOptions.apply {
@Suppress("UnstableApiUsage")
managedDevices {
diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Jacoco.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Jacoco.kt
index 8d16c428e..096808c60 100644
--- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Jacoco.kt
+++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Jacoco.kt
@@ -17,12 +17,10 @@
package com.google.samples.apps.nowinandroid
import com.android.build.api.artifact.ScopedArtifact
-import com.android.build.api.dsl.BuildType
import com.android.build.api.dsl.CommonExtension
import com.android.build.api.variant.AndroidComponentsExtension
import com.android.build.api.variant.ScopedArtifacts
import com.android.build.api.variant.SourceDirectories
-import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Project
import org.gradle.api.file.Directory
import org.gradle.api.file.RegularFile
@@ -86,7 +84,6 @@ internal fun Project.configureJacoco(
"create${variant.name.capitalize()}CombinedCoverageReport",
JacocoReport::class,
) {
-
classDirectories.setFrom(
allJars,
allDirectories.map { dirs ->
@@ -107,7 +104,7 @@ internal fun Project.configureJacoco(
sourceDirectories.setFrom(
files(
variant.sources.java.toFilePaths(),
- variant.sources.kotlin.toFilePaths()
+ variant.sources.kotlin.toFilePaths(),
),
)
@@ -120,7 +117,6 @@ internal fun Project.configureJacoco(
)
}
-
variant.artifacts.forScope(ScopedArtifacts.Scope.PROJECT)
.use(reportTask)
.toGet(
diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/KotlinAndroid.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/KotlinAndroid.kt
index 37b1ba99b..7ee7b0e90 100644
--- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/KotlinAndroid.kt
+++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/KotlinAndroid.kt
@@ -103,7 +103,7 @@ private inline fun Project.configureKotlin() =
* The binary signature changes. The error on the declaration is no longer reported.
* '-Xconsistent-data-class-copy-visibility' compiler flag and ConsistentCopyVisibility annotation are now unnecessary.
*/
- "-Xconsistent-data-class-copy-visibility"
+ "-Xconsistent-data-class-copy-visibility",
)
}
}
diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiaBuildType.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiaBuildType.kt
index e4f40840d..f4d6f038b 100644
--- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiaBuildType.kt
+++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiaBuildType.kt
@@ -1,17 +1,17 @@
/*
* 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
+ * 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
+ * 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.
+ * 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.
*/
package com.google.samples.apps.nowinandroid
diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiaFlavor.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiaFlavor.kt
index 96ca6073d..a294c0c51 100644
--- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiaFlavor.kt
+++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/NiaFlavor.kt
@@ -1,3 +1,19 @@
+/*
+ * Copyright 2026 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.
+ */
+
package com.google.samples.apps.nowinandroid
import com.android.build.api.dsl.ApplicationExtension
@@ -8,7 +24,7 @@ import org.gradle.kotlin.dsl.invoke
@Suppress("EnumEntryName")
enum class FlavorDimension {
- contentType
+ contentType,
}
// The content for the app can either come from local static data which is useful for demo
diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/PrintTestApks.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/PrintTestApks.kt
index 271fc51b7..e2a96eedf 100644
--- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/PrintTestApks.kt
+++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/PrintTestApks.kt
@@ -1,17 +1,17 @@
/*
* 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
+ * 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
+ * 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.
+ * 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.
*/
package com.google.samples.apps.nowinandroid
@@ -49,7 +49,9 @@ internal fun Project.configurePrintApksTask(extension: AndroidComponentsExtensio
javaSources.zip(kotlinSources) { javaDirs, kotlinDirs ->
javaDirs + kotlinDirs
}
- } else javaSources ?: kotlinSources
+ } else {
+ javaSources ?: kotlinSources
+ }
if (artifact != null && testSources != null) {
tasks.register(
@@ -96,8 +98,9 @@ internal abstract class PrintApkLocationTask : DefaultTask() {
val builtArtifacts = builtArtifactsLoader.get().load(apkFolder.get())
?: throw RuntimeException("Cannot load APKs")
- if (builtArtifacts.elements.size != 1)
+ if (builtArtifacts.elements.size != 1) {
throw RuntimeException("Expected one APK !")
+ }
val apk = File(builtArtifacts.elements.single().outputFile).toPath()
println(apk)
}
diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/ProjectExtensions.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/ProjectExtensions.kt
index e45d7f2e1..8bf6e1dfe 100644
--- a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/ProjectExtensions.kt
+++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/ProjectExtensions.kt
@@ -1,17 +1,17 @@
/*
* Copyright 2023 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
+ * 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
+ * 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.
+ * 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.
*/
package com.google.samples.apps.nowinandroid
diff --git a/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Spotless.kt b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Spotless.kt
new file mode 100644
index 000000000..3d4ac8f3e
--- /dev/null
+++ b/build-logic/convention/src/main/kotlin/com/google/samples/apps/nowinandroid/Spotless.kt
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2026 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.
+ */
+
+package com.google.samples.apps.nowinandroid
+
+import com.diffplug.gradle.spotless.SpotlessExtension
+import org.gradle.api.Project
+import org.gradle.kotlin.dsl.apply
+import org.gradle.kotlin.dsl.configure
+
+internal fun Project.configureSpotlessForAndroid() {
+ configureSpotlessCommon()
+ extensions.configure {
+ format("xml") {
+ target("src/**/*.xml")
+ // Look for the first XML tag that isn't a comment (
-
\ No newline at end of file
+
diff --git a/core/common/build.gradle.kts b/core/common/build.gradle.kts
index f1aa9771c..e71b9dc8e 100644
--- a/core/common/build.gradle.kts
+++ b/core/common/build.gradle.kts
@@ -22,4 +22,4 @@ dependencies {
implementation(libs.kotlinx.coroutines.core)
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.turbine)
-}
\ No newline at end of file
+}
diff --git a/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/network/NiaDispatchers.kt b/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/common/network/NiaDispatchers.kt
similarity index 92%
rename from core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/network/NiaDispatchers.kt
rename to core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/common/network/NiaDispatchers.kt
index 9c21dd69a..4309e7c75 100644
--- a/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/network/NiaDispatchers.kt
+++ b/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/common/network/NiaDispatchers.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.samples.apps.nowinandroid.core.network
+package com.google.samples.apps.nowinandroid.core.common.network
import javax.inject.Qualifier
import kotlin.annotation.AnnotationRetention.RUNTIME
diff --git a/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/network/di/CoroutineScopesModule.kt b/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/common/network/di/CoroutineScopesModule.kt
similarity index 81%
rename from core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/network/di/CoroutineScopesModule.kt
rename to core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/common/network/di/CoroutineScopesModule.kt
index 6e7ca6bb3..20556ea24 100644
--- a/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/network/di/CoroutineScopesModule.kt
+++ b/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/common/network/di/CoroutineScopesModule.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2023 The Android Open Source Project
+ * Copyright 2026 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.
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package com.google.samples.apps.nowinandroid.core.network.di
+package com.google.samples.apps.nowinandroid.core.common.network.di
-import com.google.samples.apps.nowinandroid.core.network.Dispatcher
-import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.Default
+import com.google.samples.apps.nowinandroid.core.common.network.Dispatcher
+import com.google.samples.apps.nowinandroid.core.common.network.NiaDispatchers.Default
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
diff --git a/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/network/di/DispatchersModule.kt b/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/common/network/di/DispatchersModule.kt
similarity index 74%
rename from core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/network/di/DispatchersModule.kt
rename to core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/common/network/di/DispatchersModule.kt
index 95ec07049..190b02d56 100644
--- a/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/network/di/DispatchersModule.kt
+++ b/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/common/network/di/DispatchersModule.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2022 The Android Open Source Project
+ * Copyright 2026 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.
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package com.google.samples.apps.nowinandroid.core.network.di
+package com.google.samples.apps.nowinandroid.core.common.network.di
-import com.google.samples.apps.nowinandroid.core.network.Dispatcher
-import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.Default
-import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.IO
+import com.google.samples.apps.nowinandroid.core.common.network.Dispatcher
+import com.google.samples.apps.nowinandroid.core.common.network.NiaDispatchers.Default
+import com.google.samples.apps.nowinandroid.core.common.network.NiaDispatchers.IO
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
diff --git a/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/result/Result.kt b/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/common/result/Result.kt
similarity index 94%
rename from core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/result/Result.kt
rename to core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/common/result/Result.kt
index 22376d082..934b6dfb2 100644
--- a/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/result/Result.kt
+++ b/core/common/src/main/kotlin/com/google/samples/apps/nowinandroid/core/common/result/Result.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.samples.apps.nowinandroid.core.result
+package com.google.samples.apps.nowinandroid.core.common.result
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.catch
diff --git a/core/common/src/test/kotlin/com/google/samples/apps/nowinandroid/core/result/ResultKtTest.kt b/core/common/src/test/kotlin/com/google/samples/apps/nowinandroid/core/common/result/ResultKtTest.kt
similarity index 93%
rename from core/common/src/test/kotlin/com/google/samples/apps/nowinandroid/core/result/ResultKtTest.kt
rename to core/common/src/test/kotlin/com/google/samples/apps/nowinandroid/core/common/result/ResultKtTest.kt
index 2c3c7b763..bad14764c 100644
--- a/core/common/src/test/kotlin/com/google/samples/apps/nowinandroid/core/result/ResultKtTest.kt
+++ b/core/common/src/test/kotlin/com/google/samples/apps/nowinandroid/core/common/result/ResultKtTest.kt
@@ -1,5 +1,5 @@
/*
- * Copyright 2022 The Android Open Source Project
+ * Copyright 2026 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.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.google.samples.apps.nowinandroid.core.result
+package com.google.samples.apps.nowinandroid.core.common.result
import app.cash.turbine.test
import kotlinx.coroutines.flow.flow
@@ -40,6 +40,7 @@ class ResultKtTest {
"Test Done",
errorResult.exception.message,
)
+
Result.Loading,
is Result.Success,
-> throw IllegalStateException(
diff --git a/core/data-test/README.md b/core/data-test/README.md
index b36f5b66d..4bad1f06c 100644
--- a/core/data-test/README.md
+++ b/core/data-test/README.md
@@ -19,7 +19,7 @@ graph TB
:core:data-test[data-test]:::android-library
:core:database[database]:::android-library
:core:datastore[datastore]:::android-library
- :core:datastore-proto[datastore-proto]:::android-library
+ :core:datastore-proto[datastore-proto]:::jvm-library
:core:model[model]:::jvm-library
:core:network[network]:::android-library
:core:notifications[notifications]:::android-library
diff --git a/core/data-test/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/test/repository/FakeNewsRepository.kt b/core/data-test/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/test/repository/FakeNewsRepository.kt
index da90eae61..167f9e620 100644
--- a/core/data-test/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/test/repository/FakeNewsRepository.kt
+++ b/core/data-test/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/test/repository/FakeNewsRepository.kt
@@ -16,13 +16,13 @@
package com.google.samples.apps.nowinandroid.core.data.test.repository
+import com.google.samples.apps.nowinandroid.core.common.network.Dispatcher
+import com.google.samples.apps.nowinandroid.core.common.network.NiaDispatchers.IO
import com.google.samples.apps.nowinandroid.core.data.Synchronizer
import com.google.samples.apps.nowinandroid.core.data.model.asExternalModel
import com.google.samples.apps.nowinandroid.core.data.repository.NewsRepository
import com.google.samples.apps.nowinandroid.core.data.repository.NewsResourceQuery
import com.google.samples.apps.nowinandroid.core.model.data.NewsResource
-import com.google.samples.apps.nowinandroid.core.network.Dispatcher
-import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.IO
import com.google.samples.apps.nowinandroid.core.network.demo.DemoNiaNetworkDataSource
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.flow.Flow
diff --git a/core/data-test/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/test/repository/FakeTopicsRepository.kt b/core/data-test/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/test/repository/FakeTopicsRepository.kt
index 0b81dd309..3a73024f0 100644
--- a/core/data-test/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/test/repository/FakeTopicsRepository.kt
+++ b/core/data-test/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/test/repository/FakeTopicsRepository.kt
@@ -16,11 +16,11 @@
package com.google.samples.apps.nowinandroid.core.data.test.repository
+import com.google.samples.apps.nowinandroid.core.common.network.Dispatcher
+import com.google.samples.apps.nowinandroid.core.common.network.NiaDispatchers.IO
import com.google.samples.apps.nowinandroid.core.data.Synchronizer
import com.google.samples.apps.nowinandroid.core.data.repository.TopicsRepository
import com.google.samples.apps.nowinandroid.core.model.data.Topic
-import com.google.samples.apps.nowinandroid.core.network.Dispatcher
-import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.IO
import com.google.samples.apps.nowinandroid.core.network.demo.DemoNiaNetworkDataSource
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.flow.Flow
diff --git a/core/data/README.md b/core/data/README.md
index 0b84940d2..0c8732a25 100644
--- a/core/data/README.md
+++ b/core/data/README.md
@@ -18,7 +18,7 @@ graph TB
:core:data[data]:::android-library
:core:database[database]:::android-library
:core:datastore[datastore]:::android-library
- :core:datastore-proto[datastore-proto]:::android-library
+ :core:datastore-proto[datastore-proto]:::jvm-library
:core:model[model]:::jvm-library
:core:network[network]:::android-library
:core:notifications[notifications]:::android-library
diff --git a/core/data/src/main/AndroidManifest.xml b/core/data/src/main/AndroidManifest.xml
index a5c595622..50b72ebf5 100644
--- a/core/data/src/main/AndroidManifest.xml
+++ b/core/data/src/main/AndroidManifest.xml
@@ -16,4 +16,4 @@
-->
-
\ No newline at end of file
+
diff --git a/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/repository/DefaultSearchContentsRepository.kt b/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/repository/DefaultSearchContentsRepository.kt
index 3bacb8a14..87531399a 100644
--- a/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/repository/DefaultSearchContentsRepository.kt
+++ b/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/repository/DefaultSearchContentsRepository.kt
@@ -16,6 +16,8 @@
package com.google.samples.apps.nowinandroid.core.data.repository
+import com.google.samples.apps.nowinandroid.core.common.network.Dispatcher
+import com.google.samples.apps.nowinandroid.core.common.network.NiaDispatchers.IO
import com.google.samples.apps.nowinandroid.core.database.dao.NewsResourceDao
import com.google.samples.apps.nowinandroid.core.database.dao.NewsResourceFtsDao
import com.google.samples.apps.nowinandroid.core.database.dao.TopicDao
@@ -24,8 +26,6 @@ import com.google.samples.apps.nowinandroid.core.database.model.PopulatedNewsRes
import com.google.samples.apps.nowinandroid.core.database.model.asExternalModel
import com.google.samples.apps.nowinandroid.core.database.model.asFtsEntity
import com.google.samples.apps.nowinandroid.core.model.data.SearchResult
-import com.google.samples.apps.nowinandroid.core.network.Dispatcher
-import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.IO
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
diff --git a/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/util/ConnectivityManagerNetworkMonitor.kt b/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/util/ConnectivityManagerNetworkMonitor.kt
index ea9e4de52..dc075f299 100644
--- a/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/util/ConnectivityManagerNetworkMonitor.kt
+++ b/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/util/ConnectivityManagerNetworkMonitor.kt
@@ -25,8 +25,8 @@ import android.net.NetworkRequest
import android.net.NetworkRequest.Builder
import androidx.core.content.getSystemService
import androidx.tracing.trace
-import com.google.samples.apps.nowinandroid.core.network.Dispatcher
-import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.IO
+import com.google.samples.apps.nowinandroid.core.common.network.Dispatcher
+import com.google.samples.apps.nowinandroid.core.common.network.NiaDispatchers.IO
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.channels.awaitClose
diff --git a/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/util/TimeZoneMonitor.kt b/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/util/TimeZoneMonitor.kt
index 031bc9388..5b082db32 100644
--- a/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/util/TimeZoneMonitor.kt
+++ b/core/data/src/main/kotlin/com/google/samples/apps/nowinandroid/core/data/util/TimeZoneMonitor.kt
@@ -23,9 +23,9 @@ import android.content.IntentFilter
import android.os.Build.VERSION
import android.os.Build.VERSION_CODES
import androidx.tracing.trace
-import com.google.samples.apps.nowinandroid.core.network.Dispatcher
-import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.IO
-import com.google.samples.apps.nowinandroid.core.network.di.ApplicationScope
+import com.google.samples.apps.nowinandroid.core.common.network.Dispatcher
+import com.google.samples.apps.nowinandroid.core.common.network.NiaDispatchers.IO
+import com.google.samples.apps.nowinandroid.core.common.network.di.ApplicationScope
import dagger.hilt.android.qualifiers.ApplicationContext
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
diff --git a/core/database/src/main/AndroidManifest.xml b/core/database/src/main/AndroidManifest.xml
index 51d0cfc2e..27a3ea8b0 100644
--- a/core/database/src/main/AndroidManifest.xml
+++ b/core/database/src/main/AndroidManifest.xml
@@ -14,4 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
\ No newline at end of file
+
diff --git a/core/datastore-proto/README.md b/core/datastore-proto/README.md
index 859e39756..80c4ce5b6 100644
--- a/core/datastore-proto/README.md
+++ b/core/datastore-proto/README.md
@@ -13,7 +13,7 @@ config:
graph TB
subgraph :core
direction TB
- :core:datastore-proto[datastore-proto]:::android-library
+ :core:datastore-proto[datastore-proto]:::jvm-library
end
classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
diff --git a/core/datastore-proto/build.gradle.kts b/core/datastore-proto/build.gradle.kts
index 511518dde..67e9bed02 100644
--- a/core/datastore-proto/build.gradle.kts
+++ b/core/datastore-proto/build.gradle.kts
@@ -15,23 +15,19 @@
*/
plugins {
- alias(libs.plugins.nowinandroid.android.library)
+ alias(libs.plugins.nowinandroid.jvm.library)
alias(libs.plugins.protobuf)
}
-android {
- namespace = "com.google.samples.apps.nowinandroid.core.datastore.proto"
-}
-
// Setup protobuf configuration, generating lite Java and Kotlin classes
protobuf {
protoc {
artifact = libs.protobuf.protoc.get().toString()
}
generateProtoTasks {
- all().forEach { task ->
- task.builtins {
- register("java") {
+ all().configureEach {
+ builtins {
+ named("java") {
option("lite")
}
register("kotlin") {
@@ -42,14 +38,6 @@ protobuf {
}
}
-androidComponents.beforeVariants {
- android.sourceSets.register(it.name) {
- val buildDir = layout.buildDirectory.get().asFile
- java.srcDir(buildDir.resolve("generated/source/proto/${it.name}/java"))
- kotlin.srcDir(buildDir.resolve("generated/source/proto/${it.name}/kotlin"))
- }
-}
-
dependencies {
api(libs.protobuf.kotlin.lite)
}
diff --git a/core/datastore-test/README.md b/core/datastore-test/README.md
index 6de8718e8..1cafe7df8 100644
--- a/core/datastore-test/README.md
+++ b/core/datastore-test/README.md
@@ -15,7 +15,7 @@ graph TB
direction TB
:core:common[common]:::jvm-library
:core:datastore[datastore]:::android-library
- :core:datastore-proto[datastore-proto]:::android-library
+ :core:datastore-proto[datastore-proto]:::jvm-library
:core:datastore-test[datastore-test]:::android-library
:core:model[model]:::jvm-library
end
diff --git a/core/datastore-test/src/main/AndroidManifest.xml b/core/datastore-test/src/main/AndroidManifest.xml
index 51d0cfc2e..27a3ea8b0 100644
--- a/core/datastore-test/src/main/AndroidManifest.xml
+++ b/core/datastore-test/src/main/AndroidManifest.xml
@@ -14,4 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
\ No newline at end of file
+
diff --git a/core/datastore/README.md b/core/datastore/README.md
index 744f60f43..752be7c38 100644
--- a/core/datastore/README.md
+++ b/core/datastore/README.md
@@ -15,7 +15,7 @@ graph TB
direction TB
:core:common[common]:::jvm-library
:core:datastore[datastore]:::android-library
- :core:datastore-proto[datastore-proto]:::android-library
+ :core:datastore-proto[datastore-proto]:::jvm-library
:core:model[model]:::jvm-library
end
diff --git a/core/datastore/src/main/AndroidManifest.xml b/core/datastore/src/main/AndroidManifest.xml
index 51d0cfc2e..27a3ea8b0 100644
--- a/core/datastore/src/main/AndroidManifest.xml
+++ b/core/datastore/src/main/AndroidManifest.xml
@@ -14,4 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
\ No newline at end of file
+
diff --git a/core/datastore/src/main/kotlin/com/google/samples/apps/nowinandroid/core/datastore/di/DataStoreModule.kt b/core/datastore/src/main/kotlin/com/google/samples/apps/nowinandroid/core/datastore/di/DataStoreModule.kt
index 8e0d7d4d8..9d3975674 100644
--- a/core/datastore/src/main/kotlin/com/google/samples/apps/nowinandroid/core/datastore/di/DataStoreModule.kt
+++ b/core/datastore/src/main/kotlin/com/google/samples/apps/nowinandroid/core/datastore/di/DataStoreModule.kt
@@ -20,12 +20,12 @@ import android.content.Context
import androidx.datastore.core.DataStore
import androidx.datastore.core.DataStoreFactory
import androidx.datastore.dataStoreFile
+import com.google.samples.apps.nowinandroid.core.common.network.Dispatcher
+import com.google.samples.apps.nowinandroid.core.common.network.NiaDispatchers.IO
+import com.google.samples.apps.nowinandroid.core.common.network.di.ApplicationScope
import com.google.samples.apps.nowinandroid.core.datastore.IntToStringIdsMigration
import com.google.samples.apps.nowinandroid.core.datastore.UserPreferences
import com.google.samples.apps.nowinandroid.core.datastore.UserPreferencesSerializer
-import com.google.samples.apps.nowinandroid.core.network.Dispatcher
-import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.IO
-import com.google.samples.apps.nowinandroid.core.network.di.ApplicationScope
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
diff --git a/core/designsystem/src/main/AndroidManifest.xml b/core/designsystem/src/main/AndroidManifest.xml
index 51d0cfc2e..27a3ea8b0 100644
--- a/core/designsystem/src/main/AndroidManifest.xml
+++ b/core/designsystem/src/main/AndroidManifest.xml
@@ -14,4 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
\ No newline at end of file
+
diff --git a/core/domain/README.md b/core/domain/README.md
index b23877337..742246fd7 100644
--- a/core/domain/README.md
+++ b/core/domain/README.md
@@ -18,7 +18,7 @@ graph TB
:core:data[data]:::android-library
:core:database[database]:::android-library
:core:datastore[datastore]:::android-library
- :core:datastore-proto[datastore-proto]:::android-library
+ :core:datastore-proto[datastore-proto]:::jvm-library
:core:domain[domain]:::android-library
:core:model[model]:::jvm-library
:core:network[network]:::android-library
diff --git a/core/domain/build.gradle.kts b/core/domain/build.gradle.kts
index 191877459..728f8758a 100644
--- a/core/domain/build.gradle.kts
+++ b/core/domain/build.gradle.kts
@@ -30,4 +30,4 @@ dependencies {
implementation(libs.javax.inject)
testImplementation(projects.core.testing)
-}
\ No newline at end of file
+}
diff --git a/core/domain/src/main/AndroidManifest.xml b/core/domain/src/main/AndroidManifest.xml
index 51d0cfc2e..27a3ea8b0 100644
--- a/core/domain/src/main/AndroidManifest.xml
+++ b/core/domain/src/main/AndroidManifest.xml
@@ -14,4 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
\ No newline at end of file
+
diff --git a/core/navigation/README.md b/core/navigation/README.md
index 7cd3b7e9f..88b78d1ce 100644
--- a/core/navigation/README.md
+++ b/core/navigation/README.md
@@ -1,3 +1,48 @@
-# :core:navigation module
-## Dependency graph
-
+# `:core:navigation`
+
+## Module dependency graph
+
+
+```mermaid
+---
+config:
+ layout: elk
+ elk:
+ nodePlacementStrategy: SIMPLE
+---
+graph TB
+ subgraph :core
+ direction TB
+ :core:navigation[navigation]:::android-library
+ end
+
+classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
+classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
+classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
+classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
+```
+
+📋 Graph legend
+
+```mermaid
+graph TB
+ application[application]:::android-application
+ feature[feature]:::android-feature
+ library[library]:::android-library
+ jvm[jvm]:::jvm-library
+
+ application -.-> feature
+ library --> jvm
+
+classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
+classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
+classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
+classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
+```
+
+
+
diff --git a/core/network/src/main/AndroidManifest.xml b/core/network/src/main/AndroidManifest.xml
index 0cb50fd30..7d11a6f1b 100644
--- a/core/network/src/main/AndroidManifest.xml
+++ b/core/network/src/main/AndroidManifest.xml
@@ -17,4 +17,4 @@
-
\ No newline at end of file
+
diff --git a/core/network/src/main/kotlin/com/google/samples/apps/nowinandroid/core/network/demo/DemoNiaNetworkDataSource.kt b/core/network/src/main/kotlin/com/google/samples/apps/nowinandroid/core/network/demo/DemoNiaNetworkDataSource.kt
index 328cc4e0f..5ef48c548 100644
--- a/core/network/src/main/kotlin/com/google/samples/apps/nowinandroid/core/network/demo/DemoNiaNetworkDataSource.kt
+++ b/core/network/src/main/kotlin/com/google/samples/apps/nowinandroid/core/network/demo/DemoNiaNetworkDataSource.kt
@@ -19,8 +19,8 @@ package com.google.samples.apps.nowinandroid.core.network.demo
import JvmUnitTestDemoAssetManager
import android.os.Build.VERSION.SDK_INT
import android.os.Build.VERSION_CODES.M
-import com.google.samples.apps.nowinandroid.core.network.Dispatcher
-import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.IO
+import com.google.samples.apps.nowinandroid.core.common.network.Dispatcher
+import com.google.samples.apps.nowinandroid.core.common.network.NiaDispatchers.IO
import com.google.samples.apps.nowinandroid.core.network.NiaNetworkDataSource
import com.google.samples.apps.nowinandroid.core.network.model.NetworkChangeList
import com.google.samples.apps.nowinandroid.core.network.model.NetworkNewsResource
diff --git a/core/notifications/src/main/res/drawable-anydpi-v24/core_notifications_ic_nia_notification.xml b/core/notifications/src/main/res/drawable-anydpi-v24/core_notifications_ic_nia_notification.xml
index 8037f9089..243238250 100644
--- a/core/notifications/src/main/res/drawable-anydpi-v24/core_notifications_ic_nia_notification.xml
+++ b/core/notifications/src/main/res/drawable-anydpi-v24/core_notifications_ic_nia_notification.xml
@@ -28,4 +28,4 @@
android:pathData="M17.6,11.48 L19.44,8.3a0.63,0.63 0,0 0,-1.09 -0.63l-1.88,3.24a11.43,11.43 0,0 0,-8.94 0L5.65,7.67a0.63,0.63 0,0 0,-1.09 0.63L6.4,11.48A10.81,10.81 0,0 0,1 20L23,20A10.81,10.81 0,0 0,17.6 11.48ZM7,17.25A1.25,1.25 0,1 1,8.25 16,1.25 1.25,0 0,1 7,17.25ZM17,17.25A1.25,1.25 0,1 1,18.25 16,1.25 1.25,0 0,1 17,17.25Z"
android:fillColor="#FF000000"/>
-
\ No newline at end of file
+
diff --git a/core/screenshot-testing/src/main/AndroidManifest.xml b/core/screenshot-testing/src/main/AndroidManifest.xml
index 5952f8bfd..59ed4cb48 100644
--- a/core/screenshot-testing/src/main/AndroidManifest.xml
+++ b/core/screenshot-testing/src/main/AndroidManifest.xml
@@ -21,4 +21,4 @@
Theme_Material_Light_NoActionBar is the base theme used by the production app.
-->
-
\ No newline at end of file
+
diff --git a/core/testing/README.md b/core/testing/README.md
index d5925b1a5..06dea09e7 100644
--- a/core/testing/README.md
+++ b/core/testing/README.md
@@ -18,7 +18,7 @@ graph TB
:core:data[data]:::android-library
:core:database[database]:::android-library
:core:datastore[datastore]:::android-library
- :core:datastore-proto[datastore-proto]:::android-library
+ :core:datastore-proto[datastore-proto]:::jvm-library
:core:model[model]:::jvm-library
:core:network[network]:::android-library
:core:notifications[notifications]:::android-library
diff --git a/core/testing/src/main/AndroidManifest.xml b/core/testing/src/main/AndroidManifest.xml
index 51d0cfc2e..27a3ea8b0 100644
--- a/core/testing/src/main/AndroidManifest.xml
+++ b/core/testing/src/main/AndroidManifest.xml
@@ -14,4 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
\ No newline at end of file
+
diff --git a/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/di/TestDispatchersModule.kt b/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/di/TestDispatchersModule.kt
index 4f5d15be1..72bdc4819 100644
--- a/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/di/TestDispatchersModule.kt
+++ b/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/di/TestDispatchersModule.kt
@@ -16,10 +16,10 @@
package com.google.samples.apps.nowinandroid.core.testing.di
-import com.google.samples.apps.nowinandroid.core.network.Dispatcher
-import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.Default
-import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.IO
-import com.google.samples.apps.nowinandroid.core.network.di.DispatchersModule
+import com.google.samples.apps.nowinandroid.core.common.network.Dispatcher
+import com.google.samples.apps.nowinandroid.core.common.network.NiaDispatchers.Default
+import com.google.samples.apps.nowinandroid.core.common.network.NiaDispatchers.IO
+import com.google.samples.apps.nowinandroid.core.common.network.di.DispatchersModule
import dagger.Module
import dagger.Provides
import dagger.hilt.components.SingletonComponent
diff --git a/core/ui/src/main/AndroidManifest.xml b/core/ui/src/main/AndroidManifest.xml
index 51d0cfc2e..27a3ea8b0 100644
--- a/core/ui/src/main/AndroidManifest.xml
+++ b/core/ui/src/main/AndroidManifest.xml
@@ -14,4 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
\ No newline at end of file
+
diff --git a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/DevicePreviews.kt b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/DevicePreviews.kt
index bb2b59466..f5c1cde99 100644
--- a/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/DevicePreviews.kt
+++ b/core/ui/src/main/kotlin/com/google/samples/apps/nowinandroid/core/ui/DevicePreviews.kt
@@ -16,14 +16,16 @@
package com.google.samples.apps.nowinandroid.core.ui
+import androidx.compose.ui.tooling.preview.Devices
import androidx.compose.ui.tooling.preview.Preview
/**
* Multipreview annotation that represents various device sizes. Add this annotation to a composable
* to render various devices.
*/
-@Preview(name = "phone", device = "spec:shape=Normal,width=360,height=640,unit=dp,dpi=480")
-@Preview(name = "landscape", device = "spec:shape=Normal,width=640,height=360,unit=dp,dpi=480")
-@Preview(name = "foldable", device = "spec:shape=Normal,width=673,height=841,unit=dp,dpi=480")
-@Preview(name = "tablet", device = "spec:shape=Normal,width=1280,height=800,unit=dp,dpi=480")
+@Preview(name = "phone", device = Devices.PHONE, showBackground = true)
+@Preview(name = "phone_in_landscape", widthDp = 891, heightDp = 411, showBackground = true)
+@Preview(name = "foldable", device = Devices.FOLDABLE, showBackground = true)
+@Preview(name = "tablet", device = Devices.TABLET, showBackground = true)
+@Preview(name = "desktop", device = Devices.DESKTOP, showBackground = true)
annotation class DevicePreviews
diff --git a/feature/bookmarks/api/build.gradle.kts b/feature/bookmarks/api/build.gradle.kts
index a51468615..2dc2a3f95 100644
--- a/feature/bookmarks/api/build.gradle.kts
+++ b/feature/bookmarks/api/build.gradle.kts
@@ -20,4 +20,4 @@ plugins {
android {
namespace = "com.google.samples.apps.nowinandroid.feature.bookmarks.api"
-}
\ No newline at end of file
+}
diff --git a/feature/bookmarks/impl/README.md b/feature/bookmarks/impl/README.md
index 123a842f6..3b98afadd 100644
--- a/feature/bookmarks/impl/README.md
+++ b/feature/bookmarks/impl/README.md
@@ -30,7 +30,7 @@ graph TB
:core:data[data]:::android-library
:core:database[database]:::android-library
:core:datastore[datastore]:::android-library
- :core:datastore-proto[datastore-proto]:::android-library
+ :core:datastore-proto[datastore-proto]:::jvm-library
:core:designsystem[designsystem]:::android-library
:core:model[model]:::jvm-library
:core:navigation[navigation]:::android-library
diff --git a/feature/bookmarks/impl/src/main/AndroidManifest.xml b/feature/bookmarks/impl/src/main/AndroidManifest.xml
index 51d0cfc2e..27a3ea8b0 100644
--- a/feature/bookmarks/impl/src/main/AndroidManifest.xml
+++ b/feature/bookmarks/impl/src/main/AndroidManifest.xml
@@ -14,4 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
\ No newline at end of file
+
diff --git a/feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksScreen.kt b/feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksScreen.kt
index 65bc4acf2..d10f24d51 100644
--- a/feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksScreen.kt
+++ b/feature/bookmarks/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/bookmarks/impl/BookmarksScreen.kt
@@ -155,7 +155,7 @@ private fun LoadingState(modifier: Modifier = Modifier) {
modifier = modifier
.fillMaxWidth()
.wrapContentSize()
- .testTag("forYou:loading"),
+ .testTag("bookmarks:loading"),
contentDesc = stringResource(id = R.string.feature_bookmarks_api_loading),
)
}
diff --git a/feature/foryou/api/src/main/AndroidManifest.xml b/feature/foryou/api/src/main/AndroidManifest.xml
index 51d0cfc2e..27a3ea8b0 100644
--- a/feature/foryou/api/src/main/AndroidManifest.xml
+++ b/feature/foryou/api/src/main/AndroidManifest.xml
@@ -14,4 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
\ No newline at end of file
+
diff --git a/feature/foryou/api/src/main/res/values/strings.xml b/feature/foryou/api/src/main/res/values/strings.xml
index f0595944f..cb4297c35 100644
--- a/feature/foryou/api/src/main/res/values/strings.xml
+++ b/feature/foryou/api/src/main/res/values/strings.xml
@@ -21,4 +21,4 @@
Navigate upWhat are you interested in?Updates from topics you follow will appear here. Follow some things to get started.
-
\ No newline at end of file
+
diff --git a/feature/foryou/impl/README.md b/feature/foryou/impl/README.md
index 8c12460f4..85d7b30d9 100644
--- a/feature/foryou/impl/README.md
+++ b/feature/foryou/impl/README.md
@@ -30,7 +30,7 @@ graph TB
:core:data[data]:::android-library
:core:database[database]:::android-library
:core:datastore[datastore]:::android-library
- :core:datastore-proto[datastore-proto]:::android-library
+ :core:datastore-proto[datastore-proto]:::jvm-library
:core:designsystem[designsystem]:::android-library
:core:domain[domain]:::android-library
:core:model[model]:::jvm-library
diff --git a/feature/foryou/impl/build.gradle.kts b/feature/foryou/impl/build.gradle.kts
index 7964f8c4f..b8115d292 100644
--- a/feature/foryou/impl/build.gradle.kts
+++ b/feature/foryou/impl/build.gradle.kts
@@ -40,4 +40,4 @@ dependencies {
androidTestImplementation(libs.bundles.androidx.compose.ui.test)
androidTestImplementation(projects.core.testing)
-}
\ No newline at end of file
+}
diff --git a/feature/interests/api/build.gradle.kts b/feature/interests/api/build.gradle.kts
index 7a2dfd65e..19c5db14c 100644
--- a/feature/interests/api/build.gradle.kts
+++ b/feature/interests/api/build.gradle.kts
@@ -20,4 +20,4 @@ plugins {
android {
namespace = "com.google.samples.apps.nowinandroid.feature.interests.api"
-}
\ No newline at end of file
+}
diff --git a/feature/interests/api/src/main/AndroidManifest.xml b/feature/interests/api/src/main/AndroidManifest.xml
index 51d0cfc2e..27a3ea8b0 100644
--- a/feature/interests/api/src/main/AndroidManifest.xml
+++ b/feature/interests/api/src/main/AndroidManifest.xml
@@ -14,4 +14,4 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
\ No newline at end of file
+
diff --git a/feature/interests/api/src/main/res/drawable/feature_interests_api_ic_detail_placeholder.xml b/feature/interests/api/src/main/res/drawable/feature_interests_api_ic_detail_placeholder.xml
index 2789b54e6..0518401da 100644
--- a/feature/interests/api/src/main/res/drawable/feature_interests_api_ic_detail_placeholder.xml
+++ b/feature/interests/api/src/main/res/drawable/feature_interests_api_ic_detail_placeholder.xml
@@ -52,4 +52,4 @@
android:strokeColor="#8C4190"
android:strokeLineCap="round"
android:strokeWidth="2" />
-
\ No newline at end of file
+
diff --git a/feature/interests/impl/README.md b/feature/interests/impl/README.md
index 722f4ef41..d3a5da42e 100644
--- a/feature/interests/impl/README.md
+++ b/feature/interests/impl/README.md
@@ -1,3 +1,101 @@
-# :feature:interests:impl module
-## Dependency graph
-
+# `:feature:interests:impl`
+
+## Module dependency graph
+
+
+```mermaid
+---
+config:
+ layout: elk
+ elk:
+ nodePlacementStrategy: SIMPLE
+---
+graph TB
+ subgraph :feature
+ direction TB
+ subgraph :feature:interests
+ direction TB
+ :feature:interests:api[api]:::android-library
+ :feature:interests:impl[impl]:::android-library
+ end
+ subgraph :feature:topic
+ direction TB
+ :feature:topic:api[api]:::android-library
+ end
+ end
+ subgraph :core
+ direction TB
+ :core:analytics[analytics]:::android-library
+ :core:common[common]:::jvm-library
+ :core:data[data]:::android-library
+ :core:database[database]:::android-library
+ :core:datastore[datastore]:::android-library
+ :core:datastore-proto[datastore-proto]:::android-library
+ :core:designsystem[designsystem]:::android-library
+ :core:domain[domain]:::android-library
+ :core:model[model]:::jvm-library
+ :core:navigation[navigation]:::android-library
+ :core:network[network]:::android-library
+ :core:notifications[notifications]:::android-library
+ :core:ui[ui]:::android-library
+ end
+
+ :core:data -.-> :core:analytics
+ :core:data --> :core:common
+ :core:data --> :core:database
+ :core:data --> :core:datastore
+ :core:data --> :core:network
+ :core:data -.-> :core:notifications
+ :core:database --> :core:model
+ :core:datastore -.-> :core:common
+ :core:datastore --> :core:datastore-proto
+ :core:datastore --> :core:model
+ :core:domain --> :core:data
+ :core:domain --> :core:model
+ :core:network --> :core:common
+ :core:network --> :core:model
+ :core:notifications -.-> :core:common
+ :core:notifications --> :core:model
+ :core:ui --> :core:analytics
+ :core:ui --> :core:designsystem
+ :core:ui --> :core:model
+ :feature:interests:api --> :core:navigation
+ :feature:interests:impl -.-> :core:designsystem
+ :feature:interests:impl -.-> :core:domain
+ :feature:interests:impl -.-> :core:ui
+ :feature:interests:impl -.-> :feature:interests:api
+ :feature:interests:impl -.-> :feature:topic:api
+ :feature:topic:api -.-> :core:designsystem
+ :feature:topic:api --> :core:navigation
+ :feature:topic:api -.-> :core:ui
+
+classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
+classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
+classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
+classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
+```
+
+📋 Graph legend
+
+```mermaid
+graph TB
+ application[application]:::android-application
+ feature[feature]:::android-feature
+ library[library]:::android-library
+ jvm[jvm]:::jvm-library
+
+ application -.-> feature
+ library --> jvm
+
+classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
+classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
+classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
+classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
+```
+
+
+
diff --git a/feature/search/api/README.md b/feature/search/api/README.md
index a468f649d..866e3f6fc 100644
--- a/feature/search/api/README.md
+++ b/feature/search/api/README.md
@@ -25,7 +25,7 @@ graph TB
:core:data[data]:::android-library
:core:database[database]:::android-library
:core:datastore[datastore]:::android-library
- :core:datastore-proto[datastore-proto]:::android-library
+ :core:datastore-proto[datastore-proto]:::jvm-library
:core:domain[domain]:::android-library
:core:model[model]:::jvm-library
:core:navigation[navigation]:::android-library
diff --git a/feature/search/api/build.gradle.kts b/feature/search/api/build.gradle.kts
index d7ea6fc5f..a46189b1e 100644
--- a/feature/search/api/build.gradle.kts
+++ b/feature/search/api/build.gradle.kts
@@ -25,4 +25,3 @@ android {
dependencies {
implementation(projects.core.domain)
}
-
diff --git a/feature/search/impl/README.md b/feature/search/impl/README.md
index 04800005c..4d0852ec4 100644
--- a/feature/search/impl/README.md
+++ b/feature/search/impl/README.md
@@ -34,7 +34,7 @@ graph TB
:core:data[data]:::android-library
:core:database[database]:::android-library
:core:datastore[datastore]:::android-library
- :core:datastore-proto[datastore-proto]:::android-library
+ :core:datastore-proto[datastore-proto]:::jvm-library
:core:designsystem[designsystem]:::android-library
:core:domain[domain]:::android-library
:core:model[model]:::jvm-library
diff --git a/feature/search/impl/build.gradle.kts b/feature/search/impl/build.gradle.kts
index 8425b29f3..a33b941c4 100644
--- a/feature/search/impl/build.gradle.kts
+++ b/feature/search/impl/build.gradle.kts
@@ -34,4 +34,4 @@ dependencies {
androidTestImplementation(libs.bundles.androidx.compose.ui.test)
androidTestImplementation(projects.core.testing)
-}
\ No newline at end of file
+}
diff --git a/feature/settings/impl/README.md b/feature/settings/impl/README.md
index 88aadd960..1b8e0754f 100644
--- a/feature/settings/impl/README.md
+++ b/feature/settings/impl/README.md
@@ -25,7 +25,7 @@ graph TB
:core:data[data]:::android-library
:core:database[database]:::android-library
:core:datastore[datastore]:::android-library
- :core:datastore-proto[datastore-proto]:::android-library
+ :core:datastore-proto[datastore-proto]:::jvm-library
:core:designsystem[designsystem]:::android-library
:core:model[model]:::jvm-library
:core:network[network]:::android-library
diff --git a/feature/topic/api/README.md b/feature/topic/api/README.md
index 62103d57b..2baa9b879 100644
--- a/feature/topic/api/README.md
+++ b/feature/topic/api/README.md
@@ -1,3 +1,66 @@
-# :feature:topic:api module
-## Dependency graph
-
+# `:feature:topic:api`
+
+## Module dependency graph
+
+
+```mermaid
+---
+config:
+ layout: elk
+ elk:
+ nodePlacementStrategy: SIMPLE
+---
+graph TB
+ subgraph :feature
+ direction TB
+ subgraph :feature:topic
+ direction TB
+ :feature:topic:api[api]:::android-library
+ end
+ end
+ subgraph :core
+ direction TB
+ :core:analytics[analytics]:::android-library
+ :core:designsystem[designsystem]:::android-library
+ :core:model[model]:::jvm-library
+ :core:navigation[navigation]:::android-library
+ :core:ui[ui]:::android-library
+ end
+
+ :core:ui --> :core:analytics
+ :core:ui --> :core:designsystem
+ :core:ui --> :core:model
+ :feature:topic:api -.-> :core:designsystem
+ :feature:topic:api --> :core:navigation
+ :feature:topic:api -.-> :core:ui
+
+classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
+classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
+classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
+classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
+```
+
+📋 Graph legend
+
+```mermaid
+graph TB
+ application[application]:::android-application
+ feature[feature]:::android-feature
+ library[library]:::android-library
+ jvm[jvm]:::jvm-library
+
+ application -.-> feature
+ library --> jvm
+
+classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
+classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
+classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
+classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
+```
+
+
+
diff --git a/feature/topic/api/build.gradle.kts b/feature/topic/api/build.gradle.kts
index 923a9b38b..97bed820a 100644
--- a/feature/topic/api/build.gradle.kts
+++ b/feature/topic/api/build.gradle.kts
@@ -22,4 +22,4 @@ plugins {
android {
namespace = "com.google.samples.apps.nowinandroid.feature.topic.api"
-}
\ No newline at end of file
+}
diff --git a/feature/topic/impl/README.md b/feature/topic/impl/README.md
index eee690ec0..d296093e6 100644
--- a/feature/topic/impl/README.md
+++ b/feature/topic/impl/README.md
@@ -1,3 +1,92 @@
-# :feature:topic:impl module
-## Dependency graph
-
+# `:feature:topic:impl`
+
+## Module dependency graph
+
+
+```mermaid
+---
+config:
+ layout: elk
+ elk:
+ nodePlacementStrategy: SIMPLE
+---
+graph TB
+ subgraph :feature
+ direction TB
+ subgraph :feature:topic
+ direction TB
+ :feature:topic:api[api]:::android-library
+ :feature:topic:impl[impl]:::android-library
+ end
+ end
+ subgraph :core
+ direction TB
+ :core:analytics[analytics]:::android-library
+ :core:common[common]:::jvm-library
+ :core:data[data]:::android-library
+ :core:database[database]:::android-library
+ :core:datastore[datastore]:::android-library
+ :core:datastore-proto[datastore-proto]:::android-library
+ :core:designsystem[designsystem]:::android-library
+ :core:model[model]:::jvm-library
+ :core:navigation[navigation]:::android-library
+ :core:network[network]:::android-library
+ :core:notifications[notifications]:::android-library
+ :core:ui[ui]:::android-library
+ end
+
+ :core:data -.-> :core:analytics
+ :core:data --> :core:common
+ :core:data --> :core:database
+ :core:data --> :core:datastore
+ :core:data --> :core:network
+ :core:data -.-> :core:notifications
+ :core:database --> :core:model
+ :core:datastore -.-> :core:common
+ :core:datastore --> :core:datastore-proto
+ :core:datastore --> :core:model
+ :core:network --> :core:common
+ :core:network --> :core:model
+ :core:notifications -.-> :core:common
+ :core:notifications --> :core:model
+ :core:ui --> :core:analytics
+ :core:ui --> :core:designsystem
+ :core:ui --> :core:model
+ :feature:topic:api -.-> :core:designsystem
+ :feature:topic:api --> :core:navigation
+ :feature:topic:api -.-> :core:ui
+ :feature:topic:impl -.-> :core:data
+ :feature:topic:impl -.-> :core:designsystem
+ :feature:topic:impl -.-> :core:ui
+ :feature:topic:impl -.-> :feature:topic:api
+
+classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
+classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
+classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
+classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
+```
+
+📋 Graph legend
+
+```mermaid
+graph TB
+ application[application]:::android-application
+ feature[feature]:::android-feature
+ library[library]:::android-library
+ jvm[jvm]:::jvm-library
+
+ application -.-> feature
+ library --> jvm
+
+classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
+classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
+classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
+classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
+classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;
+```
+
+
+
diff --git a/feature/topic/impl/build.gradle.kts b/feature/topic/impl/build.gradle.kts
index fdf37c32e..0e895722a 100644
--- a/feature/topic/impl/build.gradle.kts
+++ b/feature/topic/impl/build.gradle.kts
@@ -35,4 +35,4 @@ dependencies {
androidTestImplementation(libs.bundles.androidx.compose.ui.test)
androidTestImplementation(projects.core.testing)
-}
\ No newline at end of file
+}
diff --git a/feature/topic/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicViewModel.kt b/feature/topic/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicViewModel.kt
index 8f780f025..f604eb65b 100644
--- a/feature/topic/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicViewModel.kt
+++ b/feature/topic/impl/src/main/kotlin/com/google/samples/apps/nowinandroid/feature/topic/impl/TopicViewModel.kt
@@ -18,6 +18,8 @@ package com.google.samples.apps.nowinandroid.feature.topic.impl
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
+import com.google.samples.apps.nowinandroid.core.common.result.Result
+import com.google.samples.apps.nowinandroid.core.common.result.asResult
import com.google.samples.apps.nowinandroid.core.data.repository.NewsResourceQuery
import com.google.samples.apps.nowinandroid.core.data.repository.TopicsRepository
import com.google.samples.apps.nowinandroid.core.data.repository.UserDataRepository
@@ -25,8 +27,6 @@ import com.google.samples.apps.nowinandroid.core.data.repository.UserNewsResourc
import com.google.samples.apps.nowinandroid.core.model.data.FollowableTopic
import com.google.samples.apps.nowinandroid.core.model.data.Topic
import com.google.samples.apps.nowinandroid.core.model.data.UserNewsResource
-import com.google.samples.apps.nowinandroid.core.result.Result
-import com.google.samples.apps.nowinandroid.core.result.asResult
import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
diff --git a/gradle.properties b/gradle.properties
index 2ad031065..33e5ba0c2 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -64,6 +64,4 @@ roborazzi.test.verify=true
# https://issuetracker.google.com/issues/295039976
android.injected.androidTest.leaveApksInstalledAfterRun=true
-# Blockers:
-# - https://github.com/google/protobuf-gradle-plugin/issues/787
-android.newDsl=false
+ksp.project.isolation.enabled=true
\ No newline at end of file
diff --git a/gradle/init.gradle.kts b/gradle/init.gradle.kts
deleted file mode 100644
index 44dc41200..000000000
--- a/gradle/init.gradle.kts
+++ /dev/null
@@ -1,59 +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.
- */
-
-val ktlintVersion = "1.4.0"
-
-initscript {
- val spotlessVersion = "6.25.0"
-
- repositories {
- mavenCentral()
- }
-
- dependencies {
- classpath("com.diffplug.spotless:spotless-plugin-gradle:$spotlessVersion")
- }
-}
-
-rootProject {
- subprojects {
- apply()
- extensions.configure {
- kotlin {
- target("**/*.kt")
- targetExclude("**/build/**/*.kt")
- ktlint(ktlintVersion).editorConfigOverride(
- mapOf(
- "android" to "true",
- ),
- )
- licenseHeaderFile(rootProject.file("spotless/copyright.kt"))
- }
- format("kts") {
- target("**/*.kts")
- targetExclude("**/build/**/*.kts")
- // Look for the first line that doesn't have a block comment (assumed to be the license)
- licenseHeaderFile(rootProject.file("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)")
- }
- format("xml") {
- target("**/*.xml")
- targetExclude("**/build/**/*.xml")
- // Look for the first XML tag that isn't a comment (