-
Notifications
You must be signed in to change notification settings - Fork 982
/
build.gradle
149 lines (109 loc) · 5.08 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
description = 'OpenMap in the Play Store, the example app for using osmdroid'
apply plugin: 'com.android.application'
apply from: "$rootDir/gradle/android-signing.gradle"
group = project.property("pom.groupId")
version = project.property("pom.version")
android {
compileSdkVersion findProperty('android.compileSdkVersion').toInteger()
defaultConfig {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
applicationId "org.osmdroid"
minSdkVersion 21
multiDexEnabled = true
compileSdkVersion(project.hasProperty('android.compileSdkVersion')
? Integer.parseInt(project.property('android.compileSdkVersion')) : 34)
// default targetSdkVersion to API 23, if not provided
targetSdkVersion(project.hasProperty('android.targetSdkVersion')
? Integer.parseInt(project.property('android.targetSdkVersion')) : 30)
// default versionCode o 1 if not provided
versionCode(project.hasProperty('android.versionCode')
? Integer.parseInt(project.property('android.versionCode')) : 1)
versionName project.version
}
lintOptions {
abortOnError false
}
testOptions {
unitTests.all {
// All the usual Gradle options.
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
outputs.upToDateWhen { false }
showStandardStreams = true
}
}
}
packagingOptions {
pickFirst "androidsupportmultidexversion.txt"
pickFirst "META-INF/AL2.0"
pickFirst "META-INF/LGPL2.1"
}
}
dependencies {
//apparently google or gradle changed something so that
//transitive dependencies of submodules in the same project
//are not longer resolved...
//osmdroid-mapsforge
implementation 'org.mapsforge:mapsforge-map-android:0.21.0'
implementation 'org.mapsforge:mapsforge-map:0.21.0'
implementation 'org.mapsforge:mapsforge-themes:0.21.0'
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation project(':osmdroid-android')
implementation project(':osmdroid-geopackage')
implementation project(':osmdroid-mapsforge')
implementation project(':osmdroid-wms')
implementation project(':osmdroid-shape')
implementation 'io.github.missioncommand:mil-sym-android-renderer:0.1.59'
//used for various demos for picking offline tile archives
implementation 'com.github.angads25:filepicker:1.1.1'
//used for bookmark demo
implementation group: 'com.opencsv', name: 'opencsv', version: '5.8'
//usual android stuff
implementation "com.google.android.material:material:1.11.0" //needed for UI menuing
implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.recyclerview:recyclerview:1.3.2"
implementation 'androidx.multidex:multidex:2.0.1'
implementation "androidx.appcompat:appcompat:1.6.1"
//crash logging
implementation 'ch.acra:acra:4.7.0'
//memory leak testing
implementation 'com.squareup.leakcanary:leakcanary-android:2.13'
//on device testing
androidTestImplementation 'androidx.multidex:multidex:2.0.1'
androidTestImplementation "androidx.annotation:annotation:1.3.0"
androidTestImplementation "androidx.test:runner:1.5.2"
androidTestImplementation "androidx.test:rules:1.5.0"
// Optional -- UI testing with Espresso
androidTestImplementation "androidx.test.espresso:espresso-core:3.5.1"
// Optional -- UI testing with UI Automator
androidTestImplementation "androidx.test.uiautomator:uiautomator:2.3.0"
// Optional -- UI testing with Compose
androidTestImplementation "androidx.compose.ui:ui-test-junit4:1.6.5"
}
//the following sets the required permissions for API 23+ devices and AVDs
android.applicationVariants.all { variant ->
if (variant.getBuildType().name == "debug") {
task "configDevice${variant.name.capitalize()}"(type: Exec) {
dependsOn variant.install
group = 'nameofyourtaskgroup'
description = 'Describe your task here.'
def adb = android.getAdbExecutable().toString()
def mypermission = 'android.permission.ACCESS_FINE_LOCATION'
commandLine "$adb shell pm grant ${variant.applicationId} $mypermission".split(' ')
}
variant.testVariant.connectedInstrumentTest.dependsOn "configDevice${variant.name.capitalize()}"
}
}
android.applicationVariants.all { variant ->
if (variant.getBuildType().name == "debug") {
task "configDevice2${variant.name.capitalize()}"(type: Exec) {
dependsOn variant.install
group = 'nameofyourtaskgroup'
description = 'Describe your task here.'
def adb = android.getAdbExecutable().toString()
def mypermission = 'android.permission.WRITE_EXTERNAL_STORAGE '
commandLine "$adb shell pm grant ${variant.applicationId} $mypermission".split(' ')
}
variant.testVariant.connectedInstrumentTest.dependsOn "configDevice2${variant.name.capitalize()}"
}
}