-
Notifications
You must be signed in to change notification settings - Fork 410
Expand file tree
/
Copy pathsettings.gradle.kts
More file actions
146 lines (134 loc) · 4.5 KB
/
Copy pathsettings.gradle.kts
File metadata and controls
146 lines (134 loc) · 4.5 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
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:coroutine")
include(":core:feature-flags")
include(":core:formatter")
include(":core:navigation-contract")
include(":core:passcode:passcode")
include(":core:passcode:passcode-snowflake-components")
include(":core:navigation-snowflake-components")
include(":core:ui-components:node-components")
include(":core:ui-components:achievement-snowflake-components")
include(":core:passcode")
include(":core:transfers")
include(":data")
include(":data-test")
include(":domain")
include(":feature:chat:chat")
include(":feature:chat:chat-snowflake-components")
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:text-editor:text-editor-snowflake-components")
include(":feature:document-scanner:document-scanner")
include(":feature:document-scanner:document-scanner-snowflake-components")
include(":feature:media-player:media-player")
include(":feature:media-player:media-player-snowflake-components")
include(":feature:transfers:transfers")
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:pdfviewer")
include(":feature:sign-in-external")
include(":feature:video-editor:video-editor")
include(":feature:video-editor:video-editor-snowflakes")
include(":feature:share-link")
include(":feature:file-info")
include(":feature:settings")
include(":core:ui-components:shared-components")
include(":shared:nodes")
include(":shared:chats")
include(":shared:account")
include(":shared:ads")
include(":shared:transfers")
include(":shared:contact")
include(":shared:search")
// 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