Upgrade to Android Gradle Plugin 7.4.2

Rename "main" flavor to "mainline", since that breaks the build.

https://stackoverflow.com/questions/72775247/productflavors-main-gradle-error-multiple-entries-with-same-key-main-and
This commit is contained in:
José Rebelo 2024-01-19 17:49:37 +00:00 committed by José Rebelo
parent 8a7de15841
commit 1a92bcf8a5
5 changed files with 21 additions and 21 deletions

View File

@ -26,8 +26,8 @@ steps:
- if [ -f .do_not_build ]; then return 0; fi - if [ -f .do_not_build ]; then return 0; fi
# build the apks # build the apks
- echo "$${SIGNING_KEY}" | base64 -d > app/keystore.p12 - echo "$${SIGNING_KEY}" | base64 -d > app/keystore.p12
- ./gradlew assembleMainNightly -Dnightly_store_file="keystore.p12" -Dnightly_store_password="$${KEYSTOREPASS}" -Dnightly_key_alias="gadgetbridge" -Dnightly_key_password="$${KEYPASS}" - ./gradlew assembleMainlineNightly -Dnightly_store_file="keystore.p12" -Dnightly_store_password="$${KEYSTOREPASS}" -Dnightly_key_alias="gadgetbridge" -Dnightly_key_password="$${KEYPASS}"
- ./gradlew assembleMainNopebble -Dnightly_store_file="keystore.p12" -Dnightly_store_password="$${KEYSTOREPASS}" -Dnightly_key_alias="gadgetbridge" -Dnightly_key_password="$${KEYPASS}" - ./gradlew assembleMainlineNopebble -Dnightly_store_file="keystore.p12" -Dnightly_store_password="$${KEYSTOREPASS}" -Dnightly_key_alias="gadgetbridge" -Dnightly_key_password="$${KEYPASS}"
- ./gradlew assembleBanglejsNightly -Dnightly_store_file="keystore.p12" -Dnightly_store_password="$${KEYSTOREPASS}" -Dnightly_key_alias="gadgetbridge" -Dnightly_key_password="$${KEYPASS}" - ./gradlew assembleBanglejsNightly -Dnightly_store_file="keystore.p12" -Dnightly_store_password="$${KEYSTOREPASS}" -Dnightly_key_alias="gadgetbridge" -Dnightly_key_password="$${KEYPASS}"
secrets: [ signing_key, keystorepass, keypass ] secrets: [ signing_key, keystorepass, keypass ]

View File

@ -78,13 +78,15 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
compileSdkVersion 33
buildToolsVersion "33.0.1" namespace 'nodomain.freeyourgadget.gadgetbridge'
defaultConfig { defaultConfig {
applicationId "nodomain.freeyourgadget.gadgetbridge" applicationId "nodomain.freeyourgadget.gadgetbridge"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 33 targetSdkVersion 33
compileSdk 33
// Note: always bump BOTH versionCode and versionName! // Note: always bump BOTH versionCode and versionName!
versionName "0.78.0" versionName "0.78.0"
@ -112,8 +114,8 @@ android {
flavorDimensions "device_type" flavorDimensions "device_type"
productFlavors { productFlavors {
main { mainline {
// Ensure that when starting from scratch, 'main' is selected, not 'banglejs' // Ensure that when starting from scratch, 'mainline' is selected, not 'banglejs'
getIsDefault().set(true) getIsDefault().set(true)
// the default build product flavor // the default build product flavor
dimension "device_type" dimension "device_type"
@ -162,20 +164,20 @@ android {
resValue "string", "about_activity_title", "@string/about_activity_title_main_nightly" resValue "string", "about_activity_title", "@string/about_activity_title_main_nightly"
resValue "string", "about_description", "@string/about_description_main_nightly" resValue "string", "about_description", "@string/about_description_main_nightly"
resValue "string", "gadgetbridge_running", "@string/gadgetbridge_running_main_nightly" resValue "string", "gadgetbridge_running", "@string/gadgetbridge_running_main_nightly"
debuggable true debuggable true
if (System.getProperty("nightly_store_file") != null) { if (System.getProperty("nightly_store_file") != null) {
signingConfig signingConfigs.nightly signingConfig signingConfigs.nightly
//this was conflicting with regular debug type (it should not), so it is only available for CI builds: //this was conflicting with regular debug type (it should not), so it is only available for CI builds:
productFlavors.main.resValue "string", "pebble_content_provider", "com.getpebble.android.provider" productFlavors.mainline.resValue "string", "pebble_content_provider", "com.getpebble.android.provider"
productFlavors.main.resValue "string", "app_name", "@string/application_name_main_nightly" productFlavors.mainline.resValue "string", "app_name", "@string/application_name_main_nightly"
productFlavors.main.resValue "string", "title_activity_controlcenter", "@string/title_activity_controlcenter_main_nightly" productFlavors.mainline.resValue "string", "title_activity_controlcenter", "@string/title_activity_controlcenter_main_nightly"
productFlavors.main.resValue "string", "about_activity_title", "@string/about_activity_title_main_nightly" productFlavors.mainline.resValue "string", "about_activity_title", "@string/about_activity_title_main_nightly"
productFlavors.main.resValue "string", "about_description", "@string/about_description_main_nightly" productFlavors.mainline.resValue "string", "about_description", "@string/about_description_main_nightly"
productFlavors.main.resValue "string", "gadgetbridge_running", "@string/gadgetbridge_running_main_nightly" productFlavors.mainline.resValue "string", "gadgetbridge_running", "@string/gadgetbridge_running_main_nightly"
//keep the pebble provider for people who want this. In case of need we can create Banglejs Nopebble //keep the pebble provider for people who want this. In case of need we can create Banglejs Nopebble
productFlavors.banglejs.resValue "string", "pebble_content_provider", "com.getpebble.android.provider" productFlavors.banglejs.resValue "string", "pebble_content_provider", "com.getpebble.android.provider"
productFlavors.banglejs.resValue "string", "app_name", "@string/application_name_banglejs_nightly" productFlavors.banglejs.resValue "string", "app_name", "@string/application_name_banglejs_nightly"
@ -222,10 +224,9 @@ android {
} }
lint {
lintOptions {
abortOnError ABORT_ON_CHECK_FAILURE abortOnError ABORT_ON_CHECK_FAILURE
lintConfig file("${project.rootDir}/app/src/main/lint.xml") lintConfig file("$rootDir/app/src/main/lint.xml")
// If true, generate an HTML report (with issue explanations, sourcecode, etc) // If true, generate an HTML report (with issue explanations, sourcecode, etc)
htmlReport true htmlReport true
// Optional path to report (default will be lint-results.html in the builddir) // Optional path to report (default will be lint-results.html in the builddir)

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools">
package="nodomain.freeyourgadget.gadgetbridge">
<!-- <!--
Comment in for testing Pebble Emulator Comment in for testing Pebble Emulator

View File

@ -9,7 +9,7 @@ buildscript {
} }
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:7.1.3' classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:2.0.0' classpath 'gradle.plugin.com.github.spotbugs:spotbugs-gradle-plugin:2.0.0'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.17' classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.17'

View File

@ -1,6 +1,6 @@
#Sun Oct 08 20:08:12 CEST 2023 #Sun Oct 08 20:08:12 CEST 2023
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME