forked from elide-dev/elide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.gradle.kts
185 lines (163 loc) · 5.09 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
@file:Suppress(
"UnstableApiUsage",
)
pluginManagement {
repositories {
gradlePluginPortal()
maven("https://oss.sonatype.org/content/repositories/snapshots")
google()
}
}
plugins {
id("com.gradle.enterprise") version("3.11.4")
id("org.gradle.toolchains.foojay-resolver-convention") version("0.4.0")
}
// 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 micronautVersion: String by settings
val embeddedCompose: String by settings
val embeddedR8: String by settings
dependencyResolutionManagement {
repositoriesMode.set(
RepositoriesMode.PREFER_PROJECT
)
repositories {
maven("https://maven.pkg.st/")
maven("https://elide-snapshots.storage-download.googleapis.com/repository/v3/")
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
maven("https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev")
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
maven("https://maven.pkg.jetbrains.space/public/p/ktor/eap")
google()
}
versionCatalogs {
create("libs") {
from(files("./gradle/elide.versions.toml"))
}
create("mnLibs") {
from("io.micronaut:micronaut-bom:$micronautVersion")
}
}
}
rootProject.name = "elide"
// 1: Gradle convention plugins.
includeBuild("tools/conventions") {
dependencySubstitution {
substitute(module("dev.elide.tools:elide-convention-plugins")).using(project(":"))
}
}
// 2: Kotlin Compiler substrate.
includeBuild("tools/substrate") {
dependencySubstitution {
substitute(module("dev.elide.tools:elide-substrate")).using(project(":"))
substitute(module("dev.elide.tools:elide-substrate-bom")).using(project(":bom"))
substitute(module("dev.elide.tools:compiler-util")).using(project(":compiler-util"))
substitute(module("dev.elide.tools.kotlin.plugin:injekt-plugin")).using(project(":injekt"))
substitute(module("dev.elide.tools.kotlin.plugin:interakt-plugin")).using(project(":interakt"))
substitute(module("dev.elide.tools.kotlin.plugin:redakt-plugin")).using(project(":redakt"))
substitute(module("dev.elide.tools.kotlin.plugin:sekret-plugin")).using(project(":sekret"))
}
}
// 3: Third-party modules.
if (embeddedR8 == "true") includeBuild("tools/third_party/google/r8")
if (embeddedCompose == "true") includeBuild("tools/third_party/jetbrains/compose/web")
// 4: Build modules.
include(
":packages:base",
":packages:bom",
":packages:core",
":packages:cli",
":packages:frontend",
":packages:graalvm",
":packages:graalvm-js",
":packages:graalvm-react",
":packages:model",
":packages:platform",
":packages:proto:proto-core",
":packages:proto:proto-flatbuffers",
":packages:proto:proto-kotlinx",
":packages:proto:proto-protobuf",
":packages:rpc",
":packages:server",
":packages:ssg",
":packages:ssr",
":packages:test",
":tools:bundler",
":tools:processor",
":tools:reports",
)
val buildDocs: String by settings
val buildDocsSite: String by settings
val buildSamples: String by settings
val buildPlugins: String by settings
val buildBenchmarks: String by settings
if (buildPlugins == "true") {
includeBuild(
"tools/plugin/gradle-plugin",
)
}
include(
":samples:server:hellocss",
)
if (buildSamples == "true") {
include(
":samples:server:helloworld",
":samples:fullstack:basic:frontend",
":samples:fullstack:basic:server",
":samples:fullstack:react:frontend",
":samples:fullstack:react:server",
":samples:fullstack:ssr:node",
":samples:fullstack:ssr:server",
":samples:fullstack:react-ssr:frontend",
":samples:fullstack:react-ssr:node",
":samples:fullstack:react-ssr:server",
)
}
if (buildDocs == "true") {
include(
":docs:architecture",
":docs:guide",
)
}
if (buildDocsSite == "true") {
include(
":site:docs:content",
":site:docs:ui",
":site:docs:node",
":site:docs:app",
)
}
if (buildBenchmarks == "true") {
includeBuild("benchmarks")
}
gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
}
val cacheUsername: String? by settings
val cachePassword: String? by settings
val cachePush: String? by settings
val remoteCache = System.getenv("GRADLE_CACHE_REMOTE")?.toBoolean() ?: true
val localCache = System.getenv("GRADLE_CACHE_LOCAL")?.toBoolean() ?: true
buildCache {
local {
isEnabled = localCache
}
if (remoteCache) {
remote<HttpBuildCache> {
isEnabled = true
isPush = (cachePush ?: System.getenv("GRADLE_CACHE_PUSH")) == "true"
isUseExpectContinue = true
url = uri(System.getenv("CACHE_ENDPOINT") ?: "https://global.less.build/cache/generic/")
credentials {
username = cacheUsername ?: System.getenv("GRADLE_CACHE_USERNAME") ?: "apikey"
password = cachePassword ?: System.getenv("GRADLE_CACHE_PASSWORD") ?: error("Failed to resolve cache password")
}
}
}
}
enableFeaturePreview("STABLE_CONFIGURATION_CACHE")