-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsettings.gradle.kts
48 lines (45 loc) · 1.4 KB
/
settings.gradle.kts
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
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
// This will find your MAPBOX_DOWNLOADS_TOKEN in ~/.gradle/gradle.properties
val MAPBOX_DOWNLOADS_TOKEN: String? by settings
val SDK_REGISTRY_TOKEN: String? by settings
dependencyResolutionManagement {
val token = MAPBOX_DOWNLOADS_TOKEN
?: SDK_REGISTRY_TOKEN
?: System.getenv("MAPBOX_DOWNLOADS_TOKEN").takeIf { !it.isNullOrBlank() }
?: System.getenv("SDK_REGISTRY_TOKEN").takeIf { !it.isNullOrBlank() }
checkNotNull(token) {
"'MAPBOX_DOWNLOADS_TOKEN' or 'SDK_REGISTRY_TOKEN' should be defined in gradle properties or env variables"
}
repositories {
google()
mavenCentral()
maven {
url = uri("https://api.mapbox.com/downloads/v2/snapshots/maven")
credentials {
username = "mapbox"
password = token
}
authentication {
create<BasicAuthentication>("basic")
}
}
maven {
url = uri("https://api.mapbox.com/downloads/v2/releases/maven")
credentials {
username = "mapbox"
password = token
}
authentication {
create<BasicAuthentication>("basic")
}
}
}
}
rootProject.name = "Dash Examples"
include(":app")