You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description ="Validates that all config definitions in `dd-trace-api/src/main/java/datadog/trace/api/config` exist in `metadata/supported-configurations.json`"
153
+
154
+
val mainSourceSetOutput = ownerPath.map {
155
+
project.project(it)
156
+
.extensions.getByType<SourceSetContainer>()
157
+
.named(SourceSet.MAIN_SOURCE_SET_NAME)
158
+
.map { main -> main.output }
159
+
}
160
+
inputs.files(mainSourceSetOutput)
161
+
162
+
doLast {
163
+
val repoRoot:Path= project.rootProject.projectDir.toPath()
164
+
val configDir = repoRoot.resolve("dd-trace-api/src/main/java/datadog/trace/api/config").toFile()
165
+
166
+
if (!configDir.exists()) {
167
+
throwGradleException("Config directory not found: ${configDir.absolutePath}")
168
+
}
169
+
170
+
val urls = mainSourceSetOutput.get().get().files.map { it.toURI().toURL() }.toTypedArray()
171
+
val (supported, aliasMapping) =URLClassLoader(urls, javaClass.classLoader).use { cl ->
172
+
val clazz =Class.forName(generatedFile.get(), true, cl)
173
+
@Suppress("UNCHECKED_CAST")
174
+
val supportedSet = clazz.getField("SUPPORTED").get(null) asSet<String>
175
+
@Suppress("UNCHECKED_CAST")
176
+
val aliasMappingMap = clazz.getField("ALIAS_MAPPING").get(null) asMap<String, String>
0 commit comments