-
Notifications
You must be signed in to change notification settings - Fork 339
Expand file tree
/
Copy pathbuild.gradle
More file actions
187 lines (165 loc) · 5.55 KB
/
build.gradle
File metadata and controls
187 lines (165 loc) · 5.55 KB
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id "com.android.application"
id "kotlin-android"
id "kotlin-parcelize"
id "com.google.devtools.ksp"
id "com.github.triplet.play"
}
android {
namespace "io.nekohasekai.sfa"
compileSdk 35
ndkVersion "28.0.13004108"
def ndkPathFromEnv = System.getenv("ANDROID_NDK_HOME")
if (ndkPathFromEnv != null) {
ndkPath ndkPathFromEnv
}
defaultConfig {
applicationId "io.nekohasekai.sfa"
minSdk 21
targetSdk 35
versionCode getVersionProps("VERSION_CODE").toInteger()
versionName getVersionProps("VERSION_NAME")
setProperty("archivesBaseName", "SFA-" + versionName)
}
signingConfigs {
release {
storeFile file("release.keystore")
storePassword getProps("KEYSTORE_PASS")
keyAlias getProps("ALIAS_NAME")
keyPassword getProps("ALIAS_PASS")
}
}
buildTypes {
debug {
if (getProps("KEYSTORE_PASS") != "") {
signingConfig signingConfigs.release
}
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
vcsInfo.include false
}
}
dependenciesInfo {
includeInApk = false
}
flavorDimensions "vendor"
productFlavors {
play {
}
other {
}
}
splits {
abi {
enable true
universalApk true
reset()
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
viewBinding true
aidl true
}
applicationVariants.configureEach { variant ->
variant.outputs.configureEach {
outputFileName = (outputFileName as String).replace("-release", "")
outputFileName = (outputFileName as String).replace("-play", "")
outputFileName = (outputFileName as String).replace("-other", "-foss")
}
}
}
ksp {
arg("room.incremental", "true")
arg("room.schemaLocation", "$projectDir/schemas")
}
dependencies {
implementation(fileTree("libs"))
implementation "androidx.core:core-ktx:1.15.0"
implementation "androidx.appcompat:appcompat:1.7.0"
implementation "com.google.android.material:material:1.12.0"
implementation "androidx.constraintlayout:constraintlayout:2.2.1"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.8.7"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7"
implementation "androidx.navigation:navigation-fragment-ktx:2.8.9"
implementation "androidx.navigation:navigation-ui-ktx:2.8.9"
implementation "com.google.zxing:core:3.5.3"
implementation "androidx.room:room-runtime:2.6.1"
implementation "androidx.coordinatorlayout:coordinatorlayout:1.3.0"
implementation "androidx.preference:preference-ktx:1.2.1"
implementation "androidx.camera:camera-view:1.4.2"
implementation "androidx.camera:camera-lifecycle:1.4.2"
implementation "androidx.camera:camera-camera2:1.4.2"
ksp "androidx.room:room-compiler:2.6.1"
implementation "androidx.work:work-runtime-ktx:2.10.0"
implementation "androidx.browser:browser:1.8.0"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0"
// DO NOT UPDATE (minSdkVersion updated)
implementation "com.blacksquircle.ui:editorkit:2.2.0"
implementation "com.blacksquircle.ui:language-json:2.2.0"
implementation("com.android.tools.smali:smali-dexlib2:3.0.9") {
exclude group: "com.google.guava", module: "guava"
}
implementation "com.google.guava:guava:33.0.0-android"
playImplementation "com.google.android.play:app-update-ktx:2.1.0"
playImplementation "com.google.android.gms:play-services-mlkit-barcode-scanning:18.3.1"
}
def playCredentialsJSON = rootProject.file("service-account-credentials.json")
if (playCredentialsJSON.exists()) {
play {
serviceAccountCredentials = playCredentialsJSON
defaultToAppBundles = true
def version = getVersionProps("VERSION_NAME")
if (version.contains("alpha") || version.contains("beta") || version.contains("rc")) {
track = "beta"
} else {
track = "production"
}
}
}
tasks.withType(KotlinCompile.class).configureEach {
kotlinOptions {
jvmTarget = "1.8"
}
}
def getProps(String propName) {
def propsInEnv = System.getenv("LOCAL_PROPERTIES")
if (propsInEnv != null) {
def props = new Properties()
props.load(new ByteArrayInputStream(Base64.decoder.decode(propsInEnv)))
String value = props[propName]
if (value != null) {
return value
}
}
def propsFile = rootProject.file("local.properties")
if (propsFile.exists()) {
def props = new Properties()
props.load(new FileInputStream(propsFile))
String value = props[propName]
if (value != null) {
return value
}
}
return ""
}
def getVersionProps(String propName) {
def propsFile = rootProject.file("version.properties")
if (propsFile.exists()) {
def props = new Properties()
props.load(new FileInputStream(propsFile))
String value = props[propName]
if (value != null) {
return value
}
}
return ""
}