Skip to content

Commit

Permalink
fix skips
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Jan 28, 2024
1 parent 7450dc7 commit 4095779
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ abstract class GenerateJavadocLinksFile : DefaultTask() {
@get:Input
abstract val overrides: MapProperty<String, String>

@get:Input
abstract val skip: SetProperty<String>

@get:OutputFile
abstract val linksFile: RegularFileProperty

Expand Down Expand Up @@ -56,12 +59,12 @@ abstract class GenerateJavadocLinksFile : DefaultTask() {
val output = StringBuilder()
for (resolvedArtifactResult in apiElements.sorted()) {
val id = resolvedArtifactResult.componentIdentifier() ?: continue
if (!filter.get().test(id)) {
val coordinates = coordinates(id)
if (!filter.get().test(id) || skip.get().any { coordinates.startsWith(it) }) {
continue
}

output.append("-link ")
val coordinates = coordinates(id)
var overridden = false
for ((c, o) in overrides.get()) {
if (coordinates.startsWith(c)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ abstract class JavadocLinksPlugin : Plugin<Project> {
val linksFileTask = target.tasks.register<GenerateJavadocLinksFile>(name + "JavadocLinksFile") {
linksFile.convention(target.layout.buildDirectory.file(name))
overrides.convention(ext.overrides)
skip.convention(ext.skip)
defaultJavadocProvider.convention("https://javadoc.io/doc/{group}/{name}/{version}")
filter.convention(ext.filter)
apiElements(apiElementsCopy)
Expand Down

0 comments on commit 4095779

Please sign in to comment.