-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsettings.gradle
More file actions
75 lines (74 loc) · 2.71 KB
/
settings.gradle
File metadata and controls
75 lines (74 loc) · 2.71 KB
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
import org.gradle.api.credentials.HttpHeaderCredentials
import org.gradle.authentication.http.HttpHeaderAuthentication
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
mavenLocal()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/" + (System.getenv("GITHUB_REPOSITORY") ?: "flexa/flexa-android"))
credentials {
def propertiesFile = file("local.properties")
if (propertiesFile.exists()) {
def localProperties = new Properties()
propertiesFile.withInputStream { localProperties.load(it) }
username = localProperties.getProperty('gpr.user', '')
password = localProperties.getProperty('gpr.key', '')
} else {
username = System.getenv("GITHUB_ACTOR") ?: ''
password = System.getenv("GITHUB_TOKEN") ?: ''
}
}
}
def localPropertiesFile = file("local.properties")
if (localPropertiesFile.exists()) {
def properties = new Properties()
localPropertiesFile.withInputStream { properties.load(it) }
def gitlabUrl = properties.getProperty("gitlab.url")
def gitlabToken = properties.getProperty("gitlab.token")
if (gitlabUrl && gitlabToken) {
maven {
name = "GitLab"
url = uri(gitlabUrl)
credentials(HttpHeaderCredentials) {
name = "Private-Token"
value = gitlabToken
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}
if (System.getenv("CI_JOB_TOKEN")) {
maven {
name = "GitLab-CI"
def apiUrl = System.getenv("CI_API_V4_URL")
def projectId = System.getenv("CI_PROJECT_ID")
url = uri("${apiUrl}/projects/${projectId}/packages/maven")
credentials(HttpHeaderCredentials) {
name = "Job-Token"
value = System.getenv("CI_JOB_TOKEN")
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}
}
rootProject.name = "Flexa"
include ':example'
include ':core'
include ':scan'
include ':spend'