-
Notifications
You must be signed in to change notification settings - Fork 403
Expand file tree
/
Copy pathsettings.gradle.kts
More file actions
123 lines (111 loc) · 3.63 KB
/
settings.gradle.kts
File metadata and controls
123 lines (111 loc) · 3.63 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
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
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(":baselineprofile")
include(":core-test")
include(":core-ui-test")
include(":core:analytics:analytics-test")
include(":core:analytics:analytics-tracker")
include(":core:feature-flags")
include(":core:formatter")
include(":core:navigation-contract")
include(":core:navigation-snowflake-components")
include(":core:ui-components:node-components")
include(":core:ui-components:achievement-snowflake-components")
include(":core:transfers")
include(":data")
include(":domain")
include(":feature:chat")
include(":feature:cloud-drive:cloud-drive")
include(":feature:devicecenter")
include(":feature:home:home")
include(":feature:myaccount")
include(":feature:payment:payment")
include(":feature:payment:payment-snowflake-components")
include(":feature:notifications:notifications-snowflakes")
include(":feature:cloudexplorer")
include(":feature:sync")
include(":feature:text-editor:text-editor")
include(":feature:transfers:transfers-snowflake-components")
include(":resources:icon-pack")
include(":legacy-core-ui")
include(":lint")
include(":navigation")
include(":shared:original-core-ui")
include(":resources:string-resources")
include(":shared:sync")
include(":third-party-lib:pdfiumAndroid")
include(":third-party-lib:twemoji")
include(":feature:photos:photos")
include(":feature:photos:photos-snowflake-components")
include(":feature:contact:contact")
include(":feature:contact:contact-snowflake-components")
include(":feature:pdfviewer")
include(":core:ui-components:shared-components")
include(":shared:nodes")
// Configure modules to use their own name as the build file name
// app/build.gradle.kts -> app/app.gradle.kts
// features/home/build.gradle.kts -> features/home/home.gradle.kts
rootProject.children.forEach { project ->
fun configureProject(project: ProjectDescriptor) {
project.buildFileName = "${project.name}.gradle.kts"
project.children.forEach { child ->
configureProject(child)
}
}
configureProject(project)
}
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