+ * The contents of specified files are parsed and embedded into documentation as module and package descriptions. + *
+ * This can be configured on per-package basis.
+ *
+ * @param files one or more files
+ * @return this operation instance
+ * @see #includesPaths(Collection)
+ */
+ public DokkaOperation includes(Path... files) {
+ return includesPaths(List.of(files));
+ }
+
+
/**
* Retrieves the markdown files that contain the module and package documentation.
*
@@ -483,12 +501,43 @@ public class DokkaOperation extends AbstractProcessOperation
+ * The contents of specified files are parsed and embedded into documentation as module and package descriptions.
+ *
+ * This can be configured on per-package basis.
+ *
+ * @param files the markdown files
+ * @return this operation instance
+ * @see #includes(Path...)
+ */
+ public DokkaOperation includesPaths(Collection
+ * The contents of specified files are parsed and embedded into documentation as module and package descriptions.
+ *
+ * This can be configured on per-package basis.
+ *
+ * @param files the markdown files
+ * @return this operation instance
+ * @see #includes(String...)
+ */
+ public DokkaOperation includesStrings(Collection
@@ -598,8 +683,19 @@ public class DokkaOperation extends AbstractProcessOperation
+ * The directory to where documentation is generated, regardless of output format.
+ *
+ * @param outputDir the output directory
+ * @return this operation instance
+ */
+ public DokkaOperation outputDir(Path outputDir) {
+ return outputDir(outputDir.toFile());
}
/**
@@ -641,12 +737,12 @@ public class DokkaOperation extends AbstractProcessOperation
diff --git a/src/main/java/rife/bld/extension/dokka/AnalysisPlatform.java b/src/main/java/rife/bld/extension/dokka/AnalysisPlatform.java
index dd6ff1a..0f6c1a4 100644
--- a/src/main/java/rife/bld/extension/dokka/AnalysisPlatform.java
+++ b/src/main/java/rife/bld/extension/dokka/AnalysisPlatform.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2023-2024 the original author or authors.
+ * Copyright 2023-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/rife/bld/extension/dokka/DocumentedVisibility.java b/src/main/java/rife/bld/extension/dokka/DocumentedVisibility.java
index dae65a4..76e368c 100644
--- a/src/main/java/rife/bld/extension/dokka/DocumentedVisibility.java
+++ b/src/main/java/rife/bld/extension/dokka/DocumentedVisibility.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2023-2024 the original author or authors.
+ * Copyright 2023-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/rife/bld/extension/dokka/LoggingLevel.java b/src/main/java/rife/bld/extension/dokka/LoggingLevel.java
index b493e11..1cac7ae 100644
--- a/src/main/java/rife/bld/extension/dokka/LoggingLevel.java
+++ b/src/main/java/rife/bld/extension/dokka/LoggingLevel.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2023-2024 the original author or authors.
+ * Copyright 2023-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/rife/bld/extension/dokka/OutputFormat.java b/src/main/java/rife/bld/extension/dokka/OutputFormat.java
index 0d4a2c0..a1a5f37 100644
--- a/src/main/java/rife/bld/extension/dokka/OutputFormat.java
+++ b/src/main/java/rife/bld/extension/dokka/OutputFormat.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2023-2024 the original author or authors.
+ * Copyright 2023-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/src/main/java/rife/bld/extension/dokka/SourceSet.java b/src/main/java/rife/bld/extension/dokka/SourceSet.java
index 2b5f24a..a6336e7 100644
--- a/src/main/java/rife/bld/extension/dokka/SourceSet.java
+++ b/src/main/java/rife/bld/extension/dokka/SourceSet.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2023-2024 the original author or authors.
+ * Copyright 2023-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,8 +19,12 @@ package rife.bld.extension.dokka;
import rife.bld.extension.DokkaOperation;
import java.io.File;
-import java.util.*;
-import java.util.concurrent.ConcurrentHashMap;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentSkipListMap;
import java.util.stream.Collectors;
/**
@@ -29,15 +33,16 @@ import java.util.stream.Collectors;
* @author Erik C. Thauvin
* @since 1.0
*/
+@SuppressWarnings("PMD.UseConcurrentHashMap")
public class SourceSet {
private final Collection
+ * This is useful if some types that come from dependencies are not resolved/picked up automatically.
+ *
+ * This option accepts both {@code .jar} and {@code .klib} files.
+ *
+ * @param files one or more file
+ * @return this operation instance
+ * @see #classpathPaths(Collection)
+ */
+ public SourceSet classpath(Path... files) {
+ return classpathPaths(List.of(files));
}
/**
@@ -266,6 +285,7 @@ public class SourceSet {
*
* @param files the collection of files
* @return this operation instance
+ * @see #classpath(File...)
*/
public SourceSet classpath(Collection
+ * This is useful if some types that come from dependencies are not resolved/picked up automatically.
+ *
+ * This option accepts both {@code .jar} and {@code .klib} files.
+ *
+ * @param files the collection of files
+ * @return this operation instance
+ * @see #classpath(Path...)
+ */
+ public SourceSet classpathPaths(Collection
+ * This is useful if some types that come from dependencies are not resolved/picked up automatically.
+ *
+ * This option accepts both {@code .jar} and {@code .klib} files.
+ *
+ * @param files the collection of files
+ * @return this operation instance
+ * @see #classpath(String...)
+ */
+ public SourceSet classpathStrings(Collection
+ * The Markdown files that contain module and package documentation.
+ *
+ * The contents of the specified files are parsed and embedded into documentation as module and package
+ * descriptions.
+ *
+ * @param files one or more files
+ * @return this operation instance
+ * @see #classpathPaths(Collection)
+ */
+ public SourceSet includes(Path... files) {
+ return includesPaths(List.of(files));
+ }
+
+
/**
* Retrieves the Markdown files that contain module and package documentation.
*
@@ -443,12 +510,45 @@ public class SourceSet {
*
* @param files the collection of files
* @return this operation instance
+ * @see #includes(File...)
*/
public SourceSet includes(Collection
+ * The Markdown files that contain module and package documentation.
+ *
+ * The contents of the specified files are parsed and embedded into documentation as module and package
+ * descriptions.
+ *
+ * @param files the collection of files
+ * @return this operation instance
+ * @see #includes(Path...)
+ */
+ public SourceSet includesPaths(Collection
+ * The Markdown files that contain module and package documentation.
+ *
+ * The contents of the specified files are parsed and embedded into documentation as module and package
+ * descriptions.
+ *
+ * @param files the collection of files
+ * @return this operation instance
+ * @see #classpath(String...)
+ */
+ public SourceSet includesStrings(Collection
@@ -465,6 +565,15 @@ public class SourceSet {
return this;
}
+ /**
+ * Retrieves the version of the JDK to use for linking to JDK Javadocs.
+ *
+ * @return the JDK version.
+ */
+ public String jdkVersion() {
+ return jdkVersion_;
+ }
+
/**
* Sets the version of JDK to use for linking to JDK Javadocs.
*
@@ -477,8 +586,7 @@ public class SourceSet {
* @return this operation instance
*/
public SourceSet jdkVersion(int jdkVersion) {
- jdkVersion_ = String.valueOf(jdkVersion);
- return this;
+ return jdkVersion(String.valueOf(jdkVersion));
}
/**
@@ -499,8 +607,7 @@ public class SourceSet {
* @return this operation instance
*/
public SourceSet languageVersion(int languageVersion) {
- languageVersion_ = String.valueOf(languageVersion);
- return this;
+ return languageVersion(String.valueOf(languageVersion));
}
/**
@@ -602,8 +709,7 @@ public class SourceSet {
* @return this operation instance
*/
public SourceSet perPackageOptions(String... perPackageOptions) {
- perPackageOptions_.addAll(List.of(perPackageOptions));
- return this;
+ return perPackageOptions(List.of(perPackageOptions));
}
/**
@@ -632,6 +738,7 @@ public class SourceSet {
*
* @param samples the samples
* @return this operation instance
+ * @see #samples(File...)
*/
public SourceSet samples(Collection
+ * The directories or files that contain sample functions which are referenced via the {@code @sample} KDoc
+ * tag.
+ *
+ * @param samples nne or more samples
+ * @return this operation instance
+ * @see #samplesPaths(Collection)
+ */
+ public SourceSet samples(Path... samples) {
+ return samplesPaths(List.of(samples));
+ }
+
+ /**
+ * Set the directories or files that contain sample functions.
+ *
+ * The directories or files that contain sample functions which are referenced via the {@code @sample} KDoc
+ * tag.
+ *
+ * @param samples the samples
+ * @return this operation instance
+ * @see #samples(Path...)
+ */
+ public SourceSet samplesPaths(Collection
+ * The directories or files that contain sample functions which are referenced via the {@code @sample} KDoc
+ * tag.
+ *
+ * @param samples the samples
+ * @return this operation instance
+ * @see #samples(String...)
+ */
+ public SourceSet samplesStrings(Collection
+ * The source code roots to be analyzed and documented. Acceptable inputs are directories and individual
+ * {@code .kt} / {@code .java} files.
+ *
+ * @param src pne ore moe source code roots
+ * @return this operation instance
+ * @see #srcPaths(Collection)
+ */
+ public SourceSet src(Path... src) {
+ return srcPaths(List.of(src));
}
/**
@@ -774,8 +938,19 @@ public class SourceSet {
* @return this operation instance
*/
public SourceSet srcLink(File srcPath, String remotePath, String lineSuffix) {
- srcLinks_.put(srcPath.getAbsolutePath(), remotePath + lineSuffix);
- return this;
+ return srcLink(srcPath.getAbsolutePath(), remotePath, lineSuffix);
+ }
+
+ /**
+ * Sets the mapping between a source directory and a Web service for browsing the code.
+ *
+ * @param srcPath the source path
+ * @param remotePath the remote path
+ * @param lineSuffix the line suffix
+ * @return this operation instance
+ */
+ public SourceSet srcLink(Path srcPath, String remotePath, String lineSuffix) {
+ return srcLink(srcPath.toFile().getAbsolutePath(), remotePath, lineSuffix);
}
/**
@@ -787,6 +962,34 @@ public class SourceSet {
return srcLinks_;
}
+ /**
+ * Sets the source code roots to be analyzed and documented.
+ *
+ * The source code roots to be analyzed and documented. Acceptable inputs are directories and individual
+ * {@code .kt} / {@code .java} files.
+ *
+ * @param src the source code roots
+ * @return this operation instance
+ * @see #src(Path...)
+ */
+ public SourceSet srcPaths(Collection
+ * The source code roots to be analyzed and documented. Acceptable inputs are directories and individual
+ * {@code .kt} / {@code .java} files.
+ *
+ * @param src the source code roots
+ * @return this operation instance
+ * @see #src(String...)
+ */
+ public SourceSet srcStrings(Collection
@@ -794,13 +997,13 @@ public class SourceSet {
*
* @param suppressedFiles the suppressed files
* @return this operation instance
+ * @see #suppressedFiles(File...)
*/
public SourceSet suppressedFiles(Collection
+ * The files to be suppressed when generating documentation.
+ *
+ * @param suppressedFiles one or moe suppressed files
+ * @return this operation instance
+ * @see #suppressedFilesPaths(Collection)
+ */
+ public SourceSet suppressedFiles(Path... suppressedFiles) {
+ return suppressedFilesPaths(List.of(suppressedFiles));
+ }
+
+ /**
+ * Sets the paths to files to be suppressed.
+ *
+ * The files to be suppressed when generating documentation.
+ *
+ * @param suppressedFiles the suppressed files
+ * @return this operation instance
+ * @see #suppressedFiles(Path...)
+ */
+ public SourceSet suppressedFilesPaths(Collection
+ * The files to be suppressed when generating documentation.
+ *
+ * @param suppressedFiles the suppressed files
+ * @return this operation instance
+ * @see #suppressedFiles(String...)
+ */
+ public SourceSet suppressedFilesStrings(Collection