Move google_app_id from resource file to build.gradle.kts file and use different values for enterprise build.
This commit is contained in:
parent
5506e2ab00
commit
c25cdafff8
5 changed files with 39 additions and 14 deletions
|
|
@ -4,4 +4,4 @@
|
||||||
|
|
||||||
In order to make this module only know about Firebase, the plugin `com.google.gms.google-services` has been disabled from the `app` module.
|
In order to make this module only know about Firebase, the plugin `com.google.gms.google-services` has been disabled from the `app` module.
|
||||||
|
|
||||||
To be able to change the values in the file `firebase.xml` from this module, you should enable the plugin `com.google.gms.google-services` again, copy the file `google-services.json` to the folder `/app/src/main`, build the project, and check the generated file `app/build/generated/res/google-services/<buildtype>/values/values.xml` to import the generated values into the `firebase.xml` files.
|
To be able to change the values set to `google_app_id` in the file `build.gradle.kts` of this module, you should enable the plugin `com.google.gms.google-services` again, copy the file `google-services.json` to the folder `/app/src/main`, build the project, and check the generated file `app/build/generated/res/google-services/<buildtype>/values/values.xml` to import the generated values into the `build.gradle.kts` files.
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@file:Suppress("UnstableApiUsage")
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("io.element.android-library")
|
id("io.element.android-library")
|
||||||
alias(libs.plugins.anvil)
|
alias(libs.plugins.anvil)
|
||||||
|
|
@ -22,9 +25,43 @@ android {
|
||||||
namespace = "io.element.android.libraries.pushproviders.firebase"
|
namespace = "io.element.android.libraries.pushproviders.firebase"
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
getByName("release") {
|
||||||
isMinifyEnabled = true
|
isMinifyEnabled = true
|
||||||
consumerProguardFiles("consumer-proguard-rules.pro")
|
consumerProguardFiles("consumer-proguard-rules.pro")
|
||||||
|
resValue(
|
||||||
|
type = "string",
|
||||||
|
name = "google_app_id",
|
||||||
|
value = if (isEnterpriseBuild) {
|
||||||
|
"1:912726360885:android:d273c2077ec3291500427c"
|
||||||
|
} else {
|
||||||
|
"1:912726360885:android:d097de99a4c23d2700427c"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
getByName("debug") {
|
||||||
|
resValue(
|
||||||
|
type = "string",
|
||||||
|
name = "google_app_id",
|
||||||
|
value = if (isEnterpriseBuild) {
|
||||||
|
"1:912726360885:android:f8de9126a94143d300427c"
|
||||||
|
} else {
|
||||||
|
"1:912726360885:android:def0a4e454042e9b00427c"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
register("nightly") {
|
||||||
|
isMinifyEnabled = true
|
||||||
|
consumerProguardFiles("consumer-proguard-rules.pro")
|
||||||
|
matchingFallbacks += listOf("release")
|
||||||
|
resValue(
|
||||||
|
type = "string",
|
||||||
|
name = "google_app_id",
|
||||||
|
value = if (isEnterpriseBuild) {
|
||||||
|
"1:912726360885:android:3f7e1fe644d99d5a00427c"
|
||||||
|
} else {
|
||||||
|
"1:912726360885:android:e17435e0beb0303000427c"
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<string name="google_app_id" translatable="false">1:912726360885:android:def0a4e454042e9b00427c</string>
|
|
||||||
</resources>
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<string name="google_app_id" translatable="false">1:912726360885:android:e17435e0beb0303000427c</string>
|
|
||||||
</resources>
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<resources>
|
|
||||||
<string name="google_app_id" translatable="false">1:912726360885:android:d097de99a4c23d2700427c</string>
|
|
||||||
</resources>
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue