-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.gradle.kts
189 lines (175 loc) · 8.08 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
import net.twisterrob.gradle.settings.enableFeaturePreviewQuietly
import net.twisterrob.gradle.doNotNagAbout
import net.twisterrob.sun.plugins.isCI
import java.util.UUID
rootProject.name = "Sun"
enableFeaturePreviewQuietly("TYPESAFE_PROJECT_ACCESSORS", "Type-safe project accessors")
include(":app")
include(":feature:configuration")
include(":feature:preview")
include(":component:core")
include(":component:widget")
include(":component:states")
include(":component:lib")
include(":component:paparazzi")
include(":component:theme")
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
pluginManagement {
includeBuild("gradle/plugins")
repositories {
google {
content {
includeGroupByRegex("""^com\.android(\..*)?$""")
includeGroupByRegex("""^com\.google\..*$""")
includeGroupByRegex("""^androidx\..*$""")
}
}
mavenCentral()
gradlePluginPortal {
content {
includeGroup("com.gradle")
includeGroup("com.gradle.develocity")
includeGroup("gradle.plugin.org.gradle.android")
includeGroup("org.jetbrains.kotlin.android")
includeGroup("io.gitlab.arturbosch.detekt")
}
}
}
}
plugins {
id("com.gradle.develocity") version "3.17.4"
id("net.twisterrob.gradle.plugin.nagging") version "0.17"
id("project-settings")
}
develocity {
buildScan {
termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use"
termsOfUseAgree = "yes"
if (isCI) {
fun setOutput(name: String, value: Any?) {
// Using `appendText` to make sure out outputs are not cleared.
// Using `\n` at the end to make sure further outputs are correct.
val delimiter = UUID.randomUUID().toString()
File(System.getenv("GITHUB_OUTPUT"))
.appendText("${name}<<${delimiter}\n${value}\n${delimiter}\n")
}
buildScanPublished {
setOutput("build-scan-url", buildScanUri.toASCIIString())
}
gradle.addBuildListener(object : BuildAdapter() {
@Deprecated("Won't work with configuration caching.")
override fun buildFinished(result: BuildResult) {
setOutput("result-success", result.failure == null)
setOutput("result-text", resultText(result))
}
private fun resultText(result: BuildResult): String =
"${result.action} ${resultText(result.failure)}"
private fun resultText(ex: Throwable?): String =
when (ex) {
null ->
"Successful"
is org.gradle.internal.exceptions.LocationAwareException ->
"Failed: ${ex.message}"
else ->
"Failed with ${ex}"
}
})
}
}
}
val gradleVersion: String = GradleVersion.current().version
// TODEL Gradle 8.2 sync in AS FL 2022.2.1 / AS GI 2022.3.1 / IDEA 2023.1, fixed in 2023.2.
// https://youtrack.jetbrains.com/issue/IDEA-320266
@Suppress("MaxLineLength")
if ((System.getProperty("idea.version") ?: "") < "2023.3") {
doNotNagAbout(
"The org.gradle.api.plugins.JavaPluginConvention type has been deprecated. " +
"This is scheduled to be removed in Gradle 9.0. " +
"Consult the upgrading guide for further information: " +
"https://docs.gradle.org/${gradleVersion}/userguide/upgrading_version_8.html#java_convention_deprecation",
"at org.jetbrains.kotlin.idea.gradleTooling.KotlinTasksPropertyUtilsKt.getPureKotlinSourceRoots(KotlinTasksPropertyUtils.kt:59)"
)
doNotNagAbout(
"The Project.getConvention() method has been deprecated. " +
"This is scheduled to be removed in Gradle 9.0. " +
"Consult the upgrading guide for further information: " +
"https://docs.gradle.org/${gradleVersion}/userguide/upgrading_version_8.html#deprecated_access_to_conventions",
"at org.jetbrains.kotlin.idea.gradleTooling.KotlinTasksPropertyUtilsKt.getPureKotlinSourceRoots(KotlinTasksPropertyUtils.kt:59)"
)
doNotNagAbout(
"The org.gradle.api.plugins.Convention type has been deprecated. " +
"This is scheduled to be removed in Gradle 9.0. " +
"Consult the upgrading guide for further information: " +
"https://docs.gradle.org/${gradleVersion}/userguide/upgrading_version_8.html#deprecated_access_to_conventions",
"at org.jetbrains.kotlin.idea.gradleTooling.KotlinTasksPropertyUtilsKt.getPureKotlinSourceRoots(KotlinTasksPropertyUtils.kt:59)"
)
doNotNagAbout(
"The Project.getConvention() method has been deprecated. " +
"This is scheduled to be removed in Gradle 9.0. " +
"Consult the upgrading guide for further information: " +
"https://docs.gradle.org/${gradleVersion}/userguide/upgrading_version_8.html#deprecated_access_to_conventions",
"at org.jetbrains.plugins.gradle.tooling.builder.ProjectExtensionsDataBuilderImpl.buildAll(ProjectExtensionsDataBuilderImpl.groovy:"
)
doNotNagAbout(
"The org.gradle.api.plugins.Convention type has been deprecated. " +
"This is scheduled to be removed in Gradle 9.0. " +
"Consult the upgrading guide for further information: " +
"https://docs.gradle.org/${gradleVersion}/userguide/upgrading_version_8.html#deprecated_access_to_conventions",
"at org.jetbrains.plugins.gradle.tooling.builder.ProjectExtensionsDataBuilderImpl.buildAll(ProjectExtensionsDataBuilderImpl.groovy:"
)
doNotNagAbout(
"The org.gradle.api.plugins.JavaPluginConvention type has been deprecated. " +
"This is scheduled to be removed in Gradle 9.0. " +
"Consult the upgrading guide for further information: " +
"https://docs.gradle.org/${gradleVersion}/userguide/upgrading_version_8.html#java_convention_deprecation",
// at org.jetbrains.plugins.gradle.tooling.builder.ExternalProjectBuilderImpl.doBuild(ExternalProjectBuilderImpl.groovy:108)
// at org.jetbrains.plugins.gradle.tooling.builder.ExternalProjectBuilderImpl.doBuild(ExternalProjectBuilderImpl.groovy:117)
// at org.jetbrains.plugins.gradle.tooling.builder.ExternalProjectBuilderImpl.doBuild(ExternalProjectBuilderImpl.groovy:118)
"at org.jetbrains.plugins.gradle.tooling.builder.ExternalProjectBuilderImpl.doBuild(ExternalProjectBuilderImpl.groovy:1"
)
// No method and line number in stack to match all these:
// * JavaPluginUtil.getJavaPluginConvention(JavaPluginUtil.java:13)
// * JavaPluginUtil.getSourceSetContainer(JavaPluginUtil.java:18)
// * JavaPluginUtil.getSourceSetContainer(JavaPluginUtil.java:19)
doNotNagAbout(
"The org.gradle.api.plugins.JavaPluginConvention type has been deprecated. " +
"This is scheduled to be removed in Gradle 9.0. " +
"Consult the upgrading guide for further information: " +
"https://docs.gradle.org/${gradleVersion}/userguide/upgrading_version_8.html#java_convention_deprecation",
"at org.jetbrains.plugins.gradle.tooling.util.JavaPluginUtil."
)
doNotNagAbout(
"The Project.getConvention() method has been deprecated. " +
"This is scheduled to be removed in Gradle 9.0. " +
"Consult the upgrading guide for further information: " +
"https://docs.gradle.org/${gradleVersion}/userguide/upgrading_version_8.html#deprecated_access_to_conventions",
"at org.jetbrains.plugins.gradle.tooling.util.JavaPluginUtil."
)
doNotNagAbout(
"The org.gradle.api.plugins.Convention type has been deprecated. " +
"This is scheduled to be removed in Gradle 9.0. " +
"Consult the upgrading guide for further information: " +
"https://docs.gradle.org/${gradleVersion}/userguide/upgrading_version_8.html#deprecated_access_to_conventions",
"at org.jetbrains.plugins.gradle.tooling.util.JavaPluginUtil."
)
} else {
val error: (String) -> Unit = (if (isCI) ::error else logger::warn)
error("Android Studio version changed, please review hack.")
}
// TODEL Gradle 8.2 sync in AS FL https://youtrack.jetbrains.com/issue/IDEA-320307, maybe fixed in AS HH, probably I.
@Suppress("MaxLineLength")
doNotNagAbout(
"The BuildIdentifier.getName() method has been deprecated. " +
"This is scheduled to be removed in Gradle 9.0. " +
"Use getBuildPath() to get a unique identifier for the build. " +
"Consult the upgrading guide for further information: " +
"https://docs.gradle.org/${gradleVersion}/userguide/upgrading_version_8.html#build_identifier_name_and_current_deprecation",
// There are 4 stack traces coming to this line, ignore them all at once.
"at org.jetbrains.plugins.gradle.tooling.util.resolve.DependencyResolverImpl.resolveDependencies(DependencyResolverImpl.java:266)"
)