-
Notifications
You must be signed in to change notification settings - Fork 135
/
build.gradle.kts
150 lines (139 loc) · 4.76 KB
/
build.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
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
buildscript {
repositories {
google()
mavenCentral()
maven {
url = uri("https://api.mapbox.com/downloads/v2/releases/maven")
credentials {
username = "mapbox"
password = System.getenv("SDK_REGISTRY_TOKEN") ?: project.property("SDK_REGISTRY_TOKEN") as String
}
authentication {
create<BasicAuthentication>("basic")
}
}
maven {
url = uri("https://plugins.gradle.org/m2/")
}
gradlePluginPortal()
}
dependencies {
classpath(libs.plugin.gradle)
classpath(libs.plugin.kotlin)
classpath(libs.plugin.jacoco)
classpath(libs.plugin.license)
classpath(libs.plugin.mapbox.accessToken)
classpath(libs.plugin.mapbox.sdkRegistry)
classpath(libs.plugin.mapbox.sdkVersions)
classpath(libs.plugin.mapbox.ndk)
classpath(libs.plugin.pitest)
classpath(libs.plugin.playPublisher)
classpath(libs.plugin.gradleVersions)
}
}
allprojects {
repositories {
google()
mavenCentral()
maven {
url = uri("https://api.mapbox.com/downloads/v2/releases/maven")
credentials {
username = "mapbox"
password = System.getenv("SDK_REGISTRY_TOKEN") ?: project.property("SDK_REGISTRY_TOKEN") as String
}
authentication {
create<BasicAuthentication>("basic")
}
}
if (!isBuildingReleaseTag && !isTargettingReleaseBranch) {
maven {
url = uri("https://api.mapbox.com/downloads/v2/snapshots/maven")
credentials {
username = "mapbox"
password = System.getenv("SDK_REGISTRY_TOKEN") ?: project.property("SDK_REGISTRY_TOKEN") as String
}
authentication {
create<BasicAuthentication>("basic")
}
}
}
maven {
url = uri("https://oss.jfrog.org/artifactory/oss-snapshot-local/")
}
maven {
url = uri("https://jitpack.io")
}
}
}
// hack to fix unit test, see https://github.com/robolectric/robolectric/issues/5131#issuecomment-509631890.
subprojects {
tasks.withType<Test>().configureEach {
maxParallelForks = 2
setForkEvery(80)
setMaxHeapSize("2048m")
setMinHeapSize("1024m")
}
}
plugins {
id("com.mapbox.gradle.root")
// the IDE mistakenly highlights `libs` as an error, see https://github.com/gradle/gradle/issues/22797
alias(libs.plugins.detekt) apply false
alias(libs.plugins.binaryCompatibilityValidatorId)
// Used to print dependency tree of the task, useful to debug gradle tasks
// Ticket to track adding this feature to gradle officially: https://github.com/gradle/gradle/issues/980
alias(libs.plugins.taskTreeId)
}
apiValidation {
/**
* Packages that are excluded from public API dumps even if they
* contain public API.
*/
// ignoredPackages.add("kotlinx.coroutines.internal")
/**
* Sub-projects that are excluded from API validation
*/
ignoredProjects.addAll(listOf("extension-style-app", "android-auto-app", "app"))
/**
* Classes (fully qualified) that are excluded from public API dumps even if they
* contain public API.
*/
ignoredClasses.addAll(
listOf(
"com.mapbox.maps.extension.androidauto.BuildConfig",
"com.mapbox.maps.extension.style.BuildConfig",
"com.mapbox.maps.extension.localization.BuildConfig",
"com.mapbox.maps.module.telemetry.BuildConfig",
"com.mapbox.maps.plugin.camera.animation.BuildConfig",
"com.mapbox.maps.plugin.annotation.BuildConfig",
"com.mapbox.maps.plugin.attribution.BuildConfig",
"com.mapbox.maps.plugin.compass.BuildConfig",
"com.mapbox.maps.plugin.gestures.BuildConfig",
"com.mapbox.maps.plugin.lifecycle.BuildConfig",
"com.mapbox.maps.plugin.locationcomponent.BuildConfig",
"com.mapbox.maps.plugin.logo.BuildConfig",
"com.mapbox.maps.plugin.overlay.BuildConfig",
"com.mapbox.maps.plugin.scalebar.BuildConfig",
"com.mapbox.maps.plugin.viewport.BuildConfig",
"com.mapbox.maps.BuildConfig",
"com.mapbox.maps.base.BuildConfig"
)
)
/**
* Set of annotations that exclude API from being public.
* Typically, it is all kinds of `@InternalApi` annotations that mark
* effectively private API that cannot be actually private for technical reasons.
*/
// nonPublicMarkers.add("com.mapbox.maps.MapboxExperimental")
/**
* Flag to programmatically disable compatibility validator
*/
validationDisabled = false
}
/**
* @return True if this build is part of Circleci job triggered from a release tag
*/
public val isBuildingReleaseTag = "^v[0-9]+\\.[0-9]+\\.[0-9]+.*\$".toRegex().matches(System.getenv("CIRCLE_TAG") ?: "")
/**
* @return True if this build is part of Circleci job triggered from a PR that targets a release branch
*/
public val isTargettingReleaseBranch = "^v[0-9]+\\.[0-9]+\$".toRegex().matches(System.getenv("PR_TARGET_BRANCH") ?: "")