RED-9986 - Add component rules path to be scanned for Javadoc generation
This commit is contained in:
parent
9fc065518d
commit
ecd57e17a2
@ -145,18 +145,19 @@ tasks.named<BootBuildImage>("bootBuildImage") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun parseDroolsImports(droolsFilePath: String): List<String> {
|
fun parseDroolsImports(vararg droolsFilePaths: String): List<String> {
|
||||||
|
|
||||||
val imports = mutableListOf<String>()
|
val imports = mutableListOf<String>()
|
||||||
val importPattern = Regex("^import\\s+(com\\.iqser\\.red\\.service\\.redaction\\.v1\\.[\\w.]+);")
|
val importPattern = Regex("^import\\s+(com\\.iqser\\.red\\.service\\.redaction\\.v1\\.[\\w.]+);")
|
||||||
val desiredPrefix = "com.iqser.red.service.redaction.v1"
|
val desiredPrefix = "com.iqser.red.service.redaction.v1"
|
||||||
|
|
||||||
File(droolsFilePath).forEachLine { line ->
|
droolsFilePaths.forEach { filePath ->
|
||||||
importPattern.find(line)?.let { matchResult ->
|
File(filePath).forEachLine { line ->
|
||||||
val importPath = matchResult.groupValues[1].trim()
|
importPattern.find(line)?.let { matchResult ->
|
||||||
if (importPath.startsWith(desiredPrefix)) {
|
val importPath = matchResult.groupValues[1].trim()
|
||||||
val formattedPath = importPath.replace('.', '/')
|
if (importPath.startsWith(desiredPrefix)) {
|
||||||
imports.add("$formattedPath.java")
|
val formattedPath = importPath.replace('.', '/')
|
||||||
|
imports.add("$formattedPath.java")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -164,7 +165,11 @@ fun parseDroolsImports(droolsFilePath: String): List<String> {
|
|||||||
return imports
|
return imports
|
||||||
}
|
}
|
||||||
|
|
||||||
val droolsImports = parseDroolsImports("redaction-service-v1/redaction-service-server-v1/src/main/resources/drools/all_rules_documine.drl")
|
// Combine imports from both drools files
|
||||||
|
val droolsImports = parseDroolsImports(
|
||||||
|
"redaction-service-v1/redaction-service-server-v1/src/main/resources/drools/all_rules_documine.drl",
|
||||||
|
"redaction-service-v1/redaction-service-server-v1/src/main/resources/drools/base_component_rules.drl"
|
||||||
|
)
|
||||||
|
|
||||||
tasks.register("generateJavaDoc", Javadoc::class) {
|
tasks.register("generateJavaDoc", Javadoc::class) {
|
||||||
|
|
||||||
@ -178,8 +183,6 @@ tasks.register("generateJavaDoc", Javadoc::class) {
|
|||||||
|
|
||||||
options.memberLevel = JavadocMemberLevel.PUBLIC
|
options.memberLevel = JavadocMemberLevel.PUBLIC
|
||||||
(options as StandardJavadocDocletOptions).apply {
|
(options as StandardJavadocDocletOptions).apply {
|
||||||
header = "Redaction Service ${project.version}"
|
|
||||||
footer = "Redaction Service ${project.version}"
|
|
||||||
title = "API Documentation for Redaction Service ${project.version}"
|
title = "API Documentation for Redaction Service ${project.version}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user