-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.gradle
173 lines (155 loc) · 5.49 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
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath 'com.android.tools.build:gradle:8.2.2'
}
}
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'de.mannodermaus.android-junit5'
}
def getVersionCode = { ->
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', 'HEAD', '--count'
standardOutput = stdout
}
return Integer.valueOf(stdout.toString().trim())
} catch (ignored) {
return null
}
}
android {
repositories {
google()
mavenCentral()
// JitPack repository for MPAndroidChart
maven { url 'https://jitpack.io' }
}
dependencies {
// Other dependencies...
// MPAndroidChart dependency from GitHub
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
}
defaultConfig {
compileSdk 34
minSdkVersion 26
targetSdkVersion 34
versionCode 41
versionName "4.0.0"
applicationId "de.storchp.opentracks.osmplugin"
testInstrumentationRunnerArguments runnerBuilder: 'de.mannodermaus.junit5.AndroidJUnit5Builder'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs {
nightly {
if (System.getProperty("nightly_store_file") != null) {
storeFile file(System.getProperty("nightly_store_file"))
storePassword System.getProperty("nightly_store_password")
keyAlias System.getProperty("nightly_key_alias")
keyPassword System.getProperty("nightly_key_password")
}
}
}
compileOptions {
// Sets Java compatibility to Java 17
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
productFlavors {
full {
applicationId "de.storchp.opentracks.osmplugin"
buildConfigField "boolean", "offline", "false"
flavorDimensions = ["default"]
}
offline {
applicationId "de.storchp.opentracks.osmplugin.offline"
buildConfigField "boolean", "offline", "true"
flavorDimensions = ["default"]
}
}
flavorDimensions = ["default"]
sourceSets {
full {
manifest.srcFile "src/full/AndroidManifest.xml"
}
offline {
manifest.srcFile "src/offline/AndroidManifest.xml"
}
}
buildTypes {
debug {
applicationIdSuffix ".debug"
}
nightly {
signingConfig signingConfigs.nightly
applicationIdSuffix ".nightly"
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
viewBinding true
}
lint {
disable 'MissingTranslation'
}
namespace 'de.storchp.opentracks.osmplugin'
applicationVariants.configureEach { variant ->
variant.resValue "string", "applicationId", variant.applicationId
if (variant.buildType.name == 'nightly') {
variant.outputs.configureEach {
setVersionCodeOverride(getVersionCode())
setVersionNameOverride(versionName + "-" + versionCode)
}
}
variant.outputs.configureEach {
outputFileName = "${applicationId}_${variant.versionCode}.apk"
}
}
}
ext {
mapsforgeVersion = '0.20.0'
lifecycle_version = '2.7.0'
junitVersion = '5.10.1'
assertJVersion = '3.25.1'
}
dependencies {
// Desugaring
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'
// AndroidX
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.material:material:1.11.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0' // MPAndroidChart dependency from GitHub
// VTM
implementation "org.mapsforge:vtm:$mapsforgeVersion"
implementation "org.mapsforge:vtm-themes:$mapsforgeVersion"
implementation "org.mapsforge:vtm-http:$mapsforgeVersion"
implementation "org.slf4j:slf4j-api:2.0.11"
runtimeOnly "org.mapsforge:vtm-android:$mapsforgeVersion:natives-armeabi-v7a"
runtimeOnly "org.mapsforge:vtm-android:$mapsforgeVersion:natives-arm64-v8a"
runtimeOnly "org.mapsforge:vtm-android:$mapsforgeVersion:natives-x86"
runtimeOnly "org.mapsforge:vtm-android:$mapsforgeVersion:natives-x86_64"
implementation "org.mapsforge:vtm-android:$mapsforgeVersion"
implementation "com.caverock:androidsvg:1.4"
testImplementation "org.junit.jupiter:junit-jupiter:$junitVersion"
testImplementation "org.assertj:assertj-core:$assertJVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
androidTestImplementation("androidx.test:runner:1.5.2")
androidTestImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
androidTestImplementation("de.mannodermaus.junit5:android-test-core:1.4.0")
androidTestRuntimeOnly("de.mannodermaus.junit5:android-test-runner:1.4.0")
}