-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
settings.gradle.kts
347 lines (317 loc) · 9.5 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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
/*
* Copyright (c) 2024 Elide Technologies, Inc.
*
* Licensed under the MIT license (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* https://opensource.org/license/mit/
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under the License.
*/
@file:Suppress(
"UnstableApiUsage",
"DSL_SCOPE_VIOLATION",
)
pluginManagement {
repositories {
maven {
name = "oss-snapshots"
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
content {
includeGroup("dev.elide")
}
}
maven {
name = "elide-snapshots"
url = uri("https://maven.elide.dev")
content {
includeGroup("dev.elide")
includeGroup("dev.elide.tools")
includeGroup("com.google.devtools.ksp")
includeGroup("org.jetbrains.reflekt")
}
}
maven {
name = "gvm-plugin-snapshots"
url = uri("https://raw.githubusercontent.com/graalvm/native-build-tools/snapshots")
content {
includeGroup("org.graalvm.buildtools")
}
}
gradlePluginPortal()
mavenCentral()
google()
}
includeBuild("tools/elide-build")
}
plugins {
id("build.less") version ("1.0.0-rc2")
id("com.gradle.enterprise") version ("3.16.2")
id("org.gradle.toolchains.foojay-resolver-convention") version ("0.8.0")
id("com.gradle.common-custom-user-data-gradle-plugin") version ("1.12.1")
id("io.micronaut.platform.catalog") version (extra.properties["micronautVersion"] as String)
id("elide.toolchains.jvm")
}
// Fix: Force CWD to proper value and store secondary value.
System.setProperty("user.dir", rootProject.projectDir.toString())
System.setProperty("elide.home", rootProject.projectDir.toString())
val buildUuid: String by settings
val buildPkl: String by settings
val buildAuxImage: String by settings
val buildlessApiKey: String by settings
val enableSubstrate: String by settings
toolchainManagement {
jvm {
javaRepositories {
repository("gvm-edge") {
resolverClass = elide.toolchain.jvm.JvmToolchainResolver::class.java
}
}
}
}
dependencyResolutionManagement {
repositoriesMode = RepositoriesMode.PREFER_PROJECT
repositories {
maven {
name = "jpms-modules"
url = uri("https://jpms.pkg.st/repository")
content {
includeGroup("dev.javamodules")
}
}
maven {
name = "elide-snapshots"
url = uri("https://maven.elide.dev")
content {
includeGroup("dev.elide")
includeGroup("org.capnproto")
includeGroup("net.java.dev.jna")
includeGroup("org.jetbrains.reflekt")
includeGroup("com.google.devtools.ksp")
includeGroupAndSubgroups("org.graalvm")
includeGroupByRegex("org.graalvm.*")
listOf(
"org.graalvm.ruby",
"org.graalvm.llvm",
"org.graalvm.python",
"org.graalvm.js",
"org.graalvm.polyglot",
"org.graalvm.tools",
).forEach(::includeGroupAndSubgroups)
}
}
maven {
name = "oss-snapshots"
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
content {
includeGroup("dev.elide")
}
}
maven {
name = "dokka-dev"
url = uri("https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev")
content {
includeGroup("org.jetbrains.dokka")
}
}
maven {
name = "compose-dev"
url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev/")
content {
includeGroup("androidx.compose")
includeGroup("androidx.compose.compiler")
includeGroup("org.jetbrains.compose")
includeGroup("org.jetbrains.compose.compiler")
includeGroup("web")
}
}
maven {
name = "compose-edge"
url = uri("https://androidx.dev/storage/compose-compiler/repository/")
content {
includeGroup("androidx.compose")
includeGroup("androidx.compose.compiler")
includeGroup("org.jetbrains.compose")
includeGroup("org.jetbrains.compose.compiler")
}
}
maven {
name = "sonatype-snapshots"
url = uri("https://oss.sonatype.org/content/repositories/snapshots/")
}
mavenCentral()
google()
}
versionCatalogs {
create("libs") {
from(files("./gradle/elide.versions.toml"))
}
create("attic") {
from("dev.javamodules:jpms-catalog:1.0.9")
}
}
}
rootProject.name = "elide"
// External builds.
if (buildUuid == "true") {
includeBuild("packages/uuid") {
dependencySubstitution {
substitute(module("dev.elide:uuid")).using(project(":subprojects:uuid-core"))
substitute(module("dev.elide:elide-uuid")).using(project(":subprojects:uuid-core"))
substitute(module("dev.elide:elide-uuid-kotlinx")).using(project(":subprojects:uuid-kotlinx"))
}
}
}
if (enableSubstrate == "true") {
includeBuild("tools/conventions")
includeBuild("tools/substrate") {
dependencySubstitution {
substitute(module("dev.elide.tools:compiler-util")).using(project(":compiler-util"))
substitute(module("dev.elide.tools.kotlin.plugin:redakt-plugin")).using(project(":redakt"))
}
}
}
// Auxiliary image builder.
if (buildAuxImage == "true") {
include(
":tools:auximage",
)
}
// Embedded languages.
if (buildPkl == "true") {
includeBuild("third_party/apple/pkl") {
dependencySubstitution {
substitute(module("org.pkl-lang:pkl-core")).using(project(":pkl-core"))
substitute(module("org.pkl-lang:pkl-executor")).using(project(":pkl-executor"))
substitute(module("org.pkl-lang:pkl-commons-cli")).using(project(":pkl-commons-cli"))
substitute(module("org.pkl-lang:pkl-codegen-java")).using(project(":pkl-codegen-java"))
substitute(module("org.pkl-lang:pkl-codegen-kotlin")).using(project(":pkl-codegen-kotlin"))
substitute(module("org.pkl-lang:pkl-config-java")).using(project(":pkl-config-java"))
substitute(module("org.pkl-lang:pkl-config-kotlin")).using(project(":pkl-config-kotlin"))
substitute(module("org.pkl-lang:pkl-tools")).using(project(":pkl-tools"))
substitute(module("org.pkl-lang:pkl-server")).using(project(":pkl-server"))
substitute(module("org.pkl-lang:pkl-doc")).using(project(":pkl-doc"))
substitute(module("org.pkl-lang:pkl-cli")).using(project(":pkl-cli"))
}
}
}
// Build modules.
include(
":crates:base",
":crates:builder",
":crates:deps",
":crates:entry",
":crates:model",
":crates:project",
":crates:protocol",
":crates:sqlite",
":crates:substrate",
":crates:terminal",
":crates:transport",
":packages:base",
":packages:bom",
":packages:cli",
":packages:core",
":packages:engine",
":packages:graalvm",
":packages:graalvm-java",
":packages:graalvm-jvm",
":packages:graalvm-kt",
":packages:graalvm-llvm",
":packages:graalvm-py",
":packages:graalvm-rb",
":packages:graalvm-ts",
":packages:graalvm-wasm",
":packages:http",
":packages:platform",
":packages:proto:proto-capnp",
":packages:proto:proto-core",
":packages:proto:proto-kotlinx",
":packages:proto:proto-protobuf",
":packages:proto:proto-test",
":packages:server",
":packages:sqlite",
":packages:ssr",
":packages:tcnative",
":packages:terminal",
":packages:test",
":packages:tooling",
":packages:transport:transport-common",
":packages:transport:transport-epoll",
":packages:transport:transport-kqueue",
":packages:transport:transport-uring",
":tools:reports",
":tools:umbrella",
)
val buildDeprecated: String by settings
val buildDocs: String by settings
val buildEmbedded: String by settings
val buildDocsModules: String by settings
val buildSamples: String by settings
val buildPlugins: String by settings
val buildBenchmarks: String by settings
val buildFlatbuffers: String by settings
if (buildSamples == "true") {
includeBuild("samples")
}
if (buildEmbedded == "true") {
include(
":packages:embedded",
)
}
if (buildPlugins == "true") {
includeBuild("tools/plugin/gradle-plugin")
}
if (buildBenchmarks == "true") {
include(
":benchmarks:core",
":benchmarks:graalvm",
":benchmarks:server",
)
}
gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
}
val cachePush: String? by settings
val isCI: Boolean = System.getenv("CI") != "true"
val enableRemoteCache: String? by settings
buildless {
remoteCache {
enabled = enableRemoteCache == "true"
// allow disabling pushing to the remote cache
push.set(cachePush?.toBooleanStrictOrNull() ?: true)
}
localCache {
enabled = true
}
}
buildCache {
local {
isEnabled = true
directory = layout.rootDirectory.dir(".codebase/build-cache")
}
}
//
// -- Begin Caching Tricks
//
val inertTasks = sortedSetOf("clean", "tasks", "projects")
if (gradle.startParameter.taskNames.size == 1 && gradle.startParameter.taskNames.first() in inertTasks) {
// disable the build cache when cleaning because having it on is just silly
buildCache {
local.isEnabled = false
remote?.isEnabled = false
}
// force-disable
gradle.startParameter.isBuildCacheEnabled = false
}
//
// -- End Caching Tricks
//
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")
enableFeaturePreview("GROOVY_COMPILATION_AVOIDANCE")
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")