-
Notifications
You must be signed in to change notification settings - Fork 371
/
Copy pathsettings.gradle.kts
83 lines (74 loc) · 2.11 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
pluginManagement {
includeBuild("build-logic")
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven {
url =
uri("${System.getenv("ARTIFACTORY_BASE_URL")}/artifactory/mega-gradle/megagradle")
}
}
resolutionStrategy {
eachPlugin {
when (requested.id.id) {
"mega.android.release",
"mega.android.cicd",
"mega.artifactory.publish.convention",
-> useModule("mega.privacy:megagradle:${requested.version}")
else -> {}
}
}
}
}
dependencyResolutionManagement {
versionCatalogs {
for (file in fileTree("./gradle/catalogs").matching { include("**/*.toml") }) {
val name = file.name.split(".")[0]
create(name) {
from(files(file))
}
}
}
}
if (!shouldUsePrebuiltSdk() || isServerBuild()) {
include(":sdk")
}
include(":app")
include(":domain")
include(":core:formatter")
include(":shared:original-core-ui")
include(":data")
include(":lint")
include(":feature:sync")
include("feature:devicecenter")
include(":analytics")
include(":core-test")
include(":core-ui-test")
include(":baselineprofile")
include(":navigation")
include(":legacy-core-ui")
include(":icon-pack")
include(":shared:resources")
include(":shared:sync")
include(":feature:example-new-components")
println("isServerBuild = ${isServerBuild()}")
buildCache {
local {
isEnabled = !isServerBuild()
isPush = !isServerBuild()
}
remote<HttpBuildCache> {
url =
uri("${System.getenv()["ARTIFACTORY_BASE_URL"]}/artifactory/android-mega/gradle-cache/")
credentials {
username = System.getenv()["ARTIFACTORY_USER"]
password = System.getenv()["ARTIFACTORY_ACCESS_TOKEN"]
}
isPush = isServerBuild()
isEnabled = isServerBuild()
}
}
fun shouldUsePrebuiltSdk(): Boolean =
System.getenv("USE_PREBUILT_SDK")?.let { it != "false" } ?: true
fun isServerBuild(): Boolean = System.getenv("BUILD_NUMBER") != null