summaryrefslogtreecommitdiff
path: root/app/build.gradle
blob: 90b0fc503f536bdf3f794ea31fdfb31e5309b61b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

def releaseKeystorePath = System.getenv("ANDROID_KEYSTORE_PATH") ?: (project.hasProperty("ANDROID_KEYSTORE_PATH") ? project.property("ANDROID_KEYSTORE_PATH") : null)
def releaseStorePassword = System.getenv("ANDROID_STORE_PASSWORD") ?: (project.hasProperty("ANDROID_STORE_PASSWORD") ? project.property("ANDROID_STORE_PASSWORD") : null)
def releaseKeyAlias = System.getenv("ANDROID_KEY_ALIAS") ?: (project.hasProperty("ANDROID_KEY_ALIAS") ? project.property("ANDROID_KEY_ALIAS") : null)
def releaseKeyPassword = System.getenv("ANDROID_KEY_PASSWORD") ?: (project.hasProperty("ANDROID_KEY_PASSWORD") ? project.property("ANDROID_KEY_PASSWORD") : null)
def ciRunNumberRaw = System.getenv("GITHUB_RUN_NUMBER") ?: (project.hasProperty("GITHUB_RUN_NUMBER") ? project.property("GITHUB_RUN_NUMBER") : null)
def ciRunNumber = ciRunNumberRaw?.isInteger() ? ciRunNumberRaw.toInteger() : null

def baseVersionCode = 109
def baseVersionName = "v6.7.1"
def ciVersionCode = ciRunNumber != null ? (baseVersionCode * 100000 + ciRunNumber) : baseVersionCode
def ciVersionName = ciRunNumber != null ? "${baseVersionName}+${ciRunNumber}" : baseVersionName

def hasReleaseSigning = releaseKeystorePath && releaseStorePassword && releaseKeyAlias && releaseKeyPassword

android {
    compileSdk 35

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_17.toString()
    }

    defaultConfig {
        applicationId "app.olauncher"
        minSdkVersion 24
        targetSdkVersion 35
        versionCode ciVersionCode
        versionName ciVersionName

        resourceConfigurations += ["en", "ar", "de", "es-rES", "es-rUS", "fr", "he", "hr", "hu", "in", "it", "ja", "nl", "pl", "pt-rBR", "ru-rRU", "sv", "tr", "uk", "zh"]
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    if (hasReleaseSigning) {
        signingConfigs {
            release {
                storeFile file(releaseKeystorePath)
                storePassword releaseStorePassword
                keyAlias releaseKeyAlias
                keyPassword releaseKeyPassword
            }
        }
    }

    buildTypes {
        release {
            debuggable false
            minifyEnabled true
            if (hasReleaseSigning) {
                signingConfig signingConfigs.release
            }
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
            minifyEnabled false
            applicationIdSuffix ".debug"
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    buildFeatures {
        viewBinding = true
        buildConfig = true
    }
    namespace 'app.olauncher'
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation libs.kotlin.stdlib
    implementation libs.core.ktx
    implementation libs.appcompat
    implementation libs.recyclerview

    // Android lifecycle
    implementation libs.lifecycle.extensions
    implementation libs.lifecycle.viewmodel.ktx

    // Navigation
    implementation libs.navigation.fragment.ktx

    // Work Manager
    implementation libs.work.runtime.ktx

    //Material dependency
    implementation libs.material

}