Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b4fe698 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

am: Apply /e/OS specific changes

parent 3b14dd5c
Loading
Loading
Loading
Loading
+42 −1
Original line number Diff line number Diff line
import java.io.FileInputStream
import java.io.FileOutputStream
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.Properties

/*
 * Copyright © All Contributors. See LICENSE and AUTHORS in the root directory for details.
 */
@@ -57,8 +63,13 @@ android {
    flavorDimensions += "distribution"
    productFlavors {
        create("ose") {
            applicationId = "foundation.e.accountmanager"
            dimension = "distribution"
            versionNameSuffix = "-ose"
            versionNameSuffix = "-ose-${LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"))}"

            if (versionName != null) {
                setProperty("archivesBaseName", "AccountManager-$versionName")
            }
        }
    }

@@ -126,6 +137,36 @@ android {
            }
        }
    }

    val versionPropsFile = rootProject.file("local.properties")
    val versionProps = Properties()

    if (versionPropsFile.exists()) {
        versionProps.load(FileInputStream(versionPropsFile))
    }

    val incVersionCode = versionProps.getProperty("VERSION_CODE")
    val appVersionCode =
        if (incVersionCode == null) {
            // Set initial version code if not present
            android.defaultConfig.versionCode
        } else {
            // Increment version code for subsequent builds
            incVersionCode.toInt() + 1
        }

    versionProps.setProperty("VERSION_CODE", appVersionCode.toString())
    versionProps.store(FileOutputStream(versionPropsFile), null)

    androidComponents {
        onVariants { variant ->
            if (variant.buildType == "debug" && variant.flavorName == "ose") {
                variant.outputs.forEach {
                    it.versionCode.set(appVersionCode)
                }
            }
        }
    }
}

ksp {
+1 −1
Original line number Diff line number Diff line
@@ -451,7 +451,7 @@
    <string name="collection_url">Address (URL)</string>

    <!-- debugging and DebugInfoActivity -->
    <string name="authority_debug_provider" translatable="false">at.bitfire.davdroid.debug</string>
    <string name="authority_debug_provider" translatable="false">foundation.e.accountmanager.debug</string>
    <string name="debug_info_title">Debug info</string>
    <string name="debug_info_archive_caption">ZIP archive</string>
    <string name="debug_info_archive_subtitle">Contains debug info and logs</string>