Skip to content

A fully functional Android app built entirely with Kotlin and Jetpack Compose

Declare `SyncNotificationsService` only in `prod` sourceSet

Simon Marquis3eb835ae08d0
diff --git a/sync/work/build.gradle.kts b/sync/work/build.gradle.kts
index 79902e486..e6db025b7 100644
--- a/sync/work/build.gradle.kts
+++ b/sync/work/build.gradle.kts
@@ -35,10 +35,11 @@ dependencies {
implementation(libs.androidx.lifecycle.livedata.ktx)
implementation(libs.androidx.tracing.ktx)
implementation(libs.androidx.work.ktx)
- implementation(libs.firebase.cloud.messaging)
implementation(libs.hilt.ext.work)
implementation(libs.kotlinx.coroutines.android)
+ prodImplementation(libs.firebase.cloud.messaging)
+
kapt(libs.hilt.ext.compiler)
testImplementation(project(":core:testing"))
diff --git a/sync/work/src/demo/AndroidManifest.xml b/sync/work/src/demo/AndroidManifest.xml
deleted file mode 100644
index 8dc32c86f..000000000
--- a/sync/work/src/demo/AndroidManifest.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- 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
-
- http://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.
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools">
-
- <application>
- <service
- android:name=".services.SyncNotificationsService"
- android:exported="false"
- tools:node="remove" />
- </application>
-
-</manifest>
diff --git a/sync/work/src/main/AndroidManifest.xml b/sync/work/src/prod/AndroidManifest.xml
similarity index 100%
rename from sync/work/src/main/AndroidManifest.xml
rename to sync/work/src/prod/AndroidManifest.xml
diff --git a/sync/work/src/main/kotlin/com/google/samples/apps/nowinandroid/sync/services/SyncNotificationsService.kt b/sync/work/src/prod/kotlin/com/google/samples/apps/nowinandroid/sync/services/SyncNotificationsService.kt
similarity index 100%
rename from sync/work/src/main/kotlin/com/google/samples/apps/nowinandroid/sync/services/SyncNotificationsService.kt
rename to sync/work/src/prod/kotlin/com/google/samples/apps/nowinandroid/sync/services/SyncNotificationsService.kt