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"
137
+
138
+
val mainSourceSetOutput = ownerPath.map {
139
+
project.project(it)
140
+
.extensions.getByType<SourceSetContainer>()
141
+
.named(SourceSet.MAIN_SOURCE_SET_NAME)
142
+
.map { main -> main.output }
143
+
}
144
+
inputs.files(mainSourceSetOutput)
145
+
146
+
doLast {
147
+
val repoRoot:Path= project.rootProject.projectDir.toPath()
148
+
val configDir = repoRoot.resolve("dd-trace-api/src/main/java/datadog/trace/api/config").toFile()
149
+
150
+
if (!configDir.exists()) {
151
+
throwGradleException("Config directory not found: ${configDir.absolutePath}")
152
+
}
153
+
154
+
val urls = mainSourceSetOutput.get().get().files.map { it.toURI().toURL() }.toTypedArray()
155
+
val (supported, aliasMapping) =URLClassLoader(urls, javaClass.classLoader).use { cl ->
156
+
val clazz =Class.forName(generatedFile.get(), true, cl)
157
+
@Suppress("UNCHECKED_CAST")
158
+
val supportedSet = clazz.getField("SUPPORTED").get(null) asSet<String>
159
+
@Suppress("UNCHECKED_CAST")
160
+
val aliasMappingMap = clazz.getField("ALIAS_MAPPING").get(null) asMap<String, String>
161
+
Pair(supportedSet, aliasMappingMap)
162
+
}
163
+
164
+
val stringFieldRegex =Regex("""public\s+static\s+final\s+String\s+\w+\s*=\s*"([^"]+)"\s*;""")
0 commit comments