Welcome to mirror list, hosted at ThFree Co, Russian Federation.

build.gradle « app - gitlab.com/quite/mumla.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: acb04add1c3ae4ce6ee19acee236180300b902c5 (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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*
 * Copyright (C) 2014 Andrew Comminos
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

buildscript {
    repositories {
        mavenCentral()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.1.4'
    }
}
apply plugin: 'com.android.application'

repositories {
    mavenCentral()
    google()
}

def gitDescribe = { ->
    def stdout = new ByteArrayOutputStream()
    exec {
        commandLine "git", "describe", "--tags", "--always"
        standardOutput = stdout
    }
    return stdout.toString().trim()
}

def signingFile = file 'signing.gradle'
if (signingFile.exists()) apply from: signingFile
def signingBetaFile = file 'signing-beta.gradle'
if (signingBetaFile.exists()) apply from: signingBetaFile

allprojects {
    tasks.withType(JavaCompile) {
        // TODO include deprecations at some point, but currently they are *many*
        options.compilerArgs << "-Xlint:all" << "-Xlint:-deprecation" << "-Xlint:-dep-ann"
    }
}

android {
    namespace 'se.lublin.mumla'
    compileSdk 34


    // gradle8: Need to enable this when defaultConfig below contains some custom BuildConfig
    buildFeatures {
        buildConfig true
    }

    defaultConfig {
        minSdkVersion 14
        targetSdk 34
        multiDexEnabled true

        applicationId "se.lublin.mumla"
        versionCode 101
        versionName gitDescribe()

        setProperty("archivesBaseName", "mumla")
        buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"

        testInstrumentationRunner "android.test.InstrumentationTestRunner"
    }

    flavorDimensions "release"
    productFlavors {
        official {
            dimension "release"
            applicationId "se.lublin.mumla"
        }
        donation {
            dimension "release"
            applicationId "se.lublin.mumla.donation"
        }
        beta {
            dimension "release"
            applicationId "se.lublin.mumla.beta"
        }
    }

    buildTypes {
        // signingConfig beta will override
        release {
            if (android.hasProperty("signingConfigs")) {
                if (signingConfigs.hasProperty("release")) {
                    signingConfig signingConfigs.release
                }
                if (signingConfigs.hasProperty("beta")) {
                    signingConfig signingConfigs.beta
                }
            }
        }
        debug {
            versionNameSuffix "-debug"
            if (android.hasProperty("signingConfigs")) {
                if (signingConfigs.hasProperty("beta")) {
                    signingConfig signingConfigs.beta
                }
            }
        }
    }
    lint {
        abortOnError true
        // InvalidPackage is spongycastle-related
        disable 'InvalidPackage', 'MissingTranslation'
        explainIssues true
        ignoreWarnings false
        quiet false
    }
    // betas may be released every minute
    // TODO? dynamic stuff, have to rebuild a lot
    applicationVariants.all { variant ->
        if (variant.flavorName == "beta") {
            variant.outputs.each { output ->
                output.versionCodeOverride = System.currentTimeSeconds() / 60
            }
        }
    }

}

dependencies {
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation project(":libraries:humla")
    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.documentfile:documentfile:1.0.1'
    implementation 'androidx.fragment:fragment:1.4.1'
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    implementation 'androidx.exifinterface:exifinterface:1.3.3'
    implementation 'org.jsoup:jsoup:1.13.1'
    implementation 'info.guardianproject.netcipher:netcipher:2.1.0'
}