From 75c9e959de44a942f00d80070f9e5921ca0e6883 Mon Sep 17 00:00:00 2001 From: XiangRongLin <41164160+XiangRongLin@users.noreply.github.com> Date: Sun, 12 Sep 2021 20:19:45 +0200 Subject: [PATCH 1/2] Allow passing in package suffix for release builds through CLI param --- app/build.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 1219aeb33..07d2752c9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -54,6 +54,11 @@ android { // debug build. This seems to be a Gradle bug, therefore // TODO: update Gradle version release { + if (System.properties.containsKey('packageSuffix')) { + applicationIdSuffix System.getProperty('packageSuffix') + resValue "string", "app_name", "NewPipe " + System.getProperty('packageSuffix') + archivesBaseName = 'NewPipe_' + System.getProperty('packageSuffix') + } minifyEnabled true shrinkResources false // disabled to fix F-Droid's reproducible build proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' From dd9cc619ed3fc1f69e1f4e82499e94a5e8430936 Mon Sep 17 00:00:00 2001 From: XiangRongLin <41164160+XiangRongLin@users.noreply.github.com> Date: Sun, 12 Sep 2021 20:34:31 +0200 Subject: [PATCH 2/2] Add documentation for the custom gradle parameters --- doc/gradle.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/gradle.md diff --git a/doc/gradle.md b/doc/gradle.md new file mode 100644 index 000000000..a308734b2 --- /dev/null +++ b/doc/gradle.md @@ -0,0 +1,14 @@ +# Custom gradle parameters + +You can use these parameters by specifying them inside the `gradle.properties` file as +`systemProp.=` or passing them through the CLI with `-D=`. + +## packageSuffix +This allows you to specify a suffix, which will be added on release builds to the application id, +the `app_name` string and the apk file. +No validation is made, so make sure to pass in a valid value. + +## skipFormatKtlint +This allows you to skip the `formatKtLint` task. +No value is needed. +It is used for CI in order to check for badly formatted files.