-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.gradle.kts
62 lines (54 loc) · 1.81 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import org.gradle.api.internal.provider.MissingValueException
pluginManagement {
//includeBuild("buildLogic")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven(
"https://maven.pkg.github.com/govuk-one-login/mobile-android-ui",
setupGithubCredentials()
)
maven(
"https://maven.pkg.github.com/govuk-one-login/mobile-android-authentication",
setupGithubCredentials()
)
}
}
fun setupGithubCredentials(): MavenArtifactRepository.() -> Unit =
{
val (credUser, credToken) = fetchGithubCredentials()
credentials {
username = credUser
password = credToken
}
}
fun fetchGithubCredentials(): Pair<String, String> {
val gprUser = providers.gradleProperty("gpr.user")
val gprToken = providers.gradleProperty("gpr.token")
return try {
gprUser.get() to gprToken.get()
} catch (exception: MissingValueException) {
logger.warn(
"Could not find 'Github Package Registry' properties. Refer to the proceeding " +
"location for instructions:\n\n" +
"${rootDir.path}/docs/developerSetup/github-authentication.md\n",
exception
)
System.getenv("USERNAME") to System.getenv("TOKEN")
}
}
// https://docs.gradle.org/8.0/userguide/kotlin_dsl.html#type-safe-accessors
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
rootProject.name = "OneLogin-Android"
includeBuild("buildLogic")
include(":app")
include(":features")
gradle.startParameter.excludedTaskNames.addAll(listOf(":buildLogic:plugins:testClasses"))