-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
build.gradle
174 lines (155 loc) · 5.75 KB
/
build.gradle
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
plugins {
id 'com.google.devtools.ksp'
}
apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply plugin: "net.kourlas.oss-licenses-plugin"
android {
compileSdk 34
defaultConfig {
applicationId "net.kourlas.voipms_sms"
minSdkVersion 21
targetSdkVersion 34
versionCode 147
versionName "0.6.26"
ksp {
arg("room.schemaLocation", "$projectDir/schemas")
arg("room.incremental", "true")
}
}
flavorDimensions = ["version", "demo"]
productFlavors {
// fdroid-remove-start
primary {
dimension "version"
buildConfigField "boolean", "IS_FDROID", "false"
}
// fdroid-remove-end
fdroid {
dimension "version"
versionNameSuffix "-fdroid"
buildConfigField "boolean", "IS_FDROID", "true"
}
full {
dimension "demo"
buildConfigField "boolean", "IS_DEMO", "false"
buildConfigField "boolean", "IS_DEMO_SENDING", "false"
}
demoNotSending {
dimension "demo"
applicationId "net.kourlas.voipms_sms.demo"
buildConfigField "boolean", "IS_DEMO", "true"
buildConfigField "boolean", "IS_DEMO_SENDING", "false"
versionNameSuffix "-demo"
}
demoSending {
dimension "demo"
applicationId "net.kourlas.voipms_sms.demo"
buildConfigField "boolean", "IS_DEMO", "true"
buildConfigField "boolean", "IS_DEMO_SENDING", "true"
versionNameSuffix "-demo"
}
}
variantFilter { variant ->
def names = variant.flavors*.name
def isDemo = (names.contains("demoSending")
|| names.contains("demoNotSending"))
def isRelease = variant.buildType.name == "release"
def isPrimary = names.contains("primary")
if (isDemo && (isPrimary || isRelease)) {
variant.setIgnore(true)
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion "1.5.4"
}
sourceSets {
main.java.srcDirs += "src/main/kotlin"
// fdroid-remove-start
primary.java.srcDirs += "src/primary/kotlin"
// fdroid-remove-end
fdroid.java.srcDirs += "src/fdroid/kotlin"
}
lint {
abortOnError false
}
namespace 'net.kourlas.voipms_sms'
}
dependencies {
def room_version = "2.6.1"
def moshi_version = "1.14.0"
// Kotlin libraries
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1"
// Android support libraries
implementation "androidx.annotation:annotation:1.7.1"
implementation "androidx.appcompat:appcompat:1.6.1"
implementation "androidx.compose.ui:ui:1.6.0"
implementation "androidx.core:core-ktx:1.12.0"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.7.0"
implementation "androidx.preference:preference-ktx:1.2.1"
implementation "androidx.recyclerview:recyclerview:1.3.2"
implementation "androidx.room:room-ktx:$room_version"
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.security:security-crypto:1.1.0-alpha06"
implementation "androidx.sharetarget:sharetarget:1.2.0"
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation "androidx.work:work-runtime-ktx:2.9.0"
implementation "com.google.android.material:material:1.11.0"
ksp "androidx.room:room-compiler:$room_version"
// fdroid-remove-start
// Firebase libraries
primaryImplementation platform("com.google.firebase:firebase-bom:32.7.1")
primaryImplementation "com.google.firebase:firebase-analytics-ktx"
primaryImplementation "com.google.firebase:firebase-crashlytics-ktx"
primaryImplementation "com.google.firebase:firebase-messaging-ktx"
// Google Play libraries
primaryImplementation "com.android.billingclient:billing-ktx:6.1.0"
// fdroid-remove-end
// Other third-party libraries
implementation "com.squareup.moshi:moshi-adapters:$moshi_version"
implementation "com.squareup.moshi:moshi:$moshi_version"
implementation "com.squareup.okhttp3:okhttp:4.9.3"
implementation "com.github.mukeshsolanki:MarkdownView-Android:2.0.0"
implementation "com.github.xabaras:RecyclerViewSwipeDecorator:1.3"
implementation "me.saket:better-link-movement-method:2.2.0"
ksp "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"
}
tasks.register('cleanAssets', Delete) {
delete 'src/main/assets'
}
tasks.register('copyToAssets', Copy) {
from '../PRIVACY.md'
from '../CHANGES.md'
from '../NOTICE'
from '../LICENSE.md'
from '../HELP.md'
into 'src/main/assets'
}
preBuild.dependsOn copyToAssets
copyToAssets.dependsOn cleanAssets
android.applicationVariants.configureEach { variant ->
def generatePackageLicenses = tasks.register("generatePackageLicenses${variant.name.capitalize()}", Exec) {
commandLine 'python', '../licenses/packageLicenseParser.py', "${variant.name}"
}.get()
tasks.matching { it.name == "${variant.name}OssLicensesTask" }.configureEach { task ->
generatePackageLicenses.dependsOn task
}
tasks.matching { it.name == "generate${variant.name.capitalize()}Assets" }.configureEach { task ->
task.dependsOn generatePackageLicenses
}
generatePackageLicenses.dependsOn cleanAssets
}
// fdroid-remove-start
apply plugin: "com.google.gms.google-services"
apply plugin: "com.google.firebase.crashlytics"
// fdroid-remove-end