+ * 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
+ */
+ public DokkaOperation includes(Path... files) {
+ return includesPaths(List.of(files));
+ }
+
+
/**
* Retrieves the markdown files that contain the module and package documentation.
*
@@ -489,6 +506,36 @@ 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
+ */
+ 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
+ */
+ public DokkaOperation includesStrings(Collection
@@ -598,8 +681,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 +735,12 @@ public class DokkaOperation extends AbstractProcessOperation
diff --git a/src/main/java/rife/bld/extension/dokka/SourceSet.java b/src/main/java/rife/bld/extension/dokka/SourceSet.java
index 2b5f24a..78a7074 100644
--- a/src/main/java/rife/bld/extension/dokka/SourceSet.java
+++ b/src/main/java/rife/bld/extension/dokka/SourceSet.java
@@ -19,7 +19,11 @@ package rife.bld.extension.dokka;
import rife.bld.extension.DokkaOperation;
import java.io.File;
-import java.util.*;
+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.ConcurrentHashMap;
import java.util.stream.Collectors;
@@ -238,8 +242,7 @@ public class SourceSet {
* @return this operation instance
*/
public SourceSet classpath(File... files) {
- classpath_.addAll(List.of(files));
- return this;
+ return classpath(List.of(files));
}
/**
@@ -253,8 +256,21 @@ public class SourceSet {
* @return this operation instance
*/
public SourceSet classpath(String... files) {
- classpath_.addAll(Arrays.stream(files).map(File::new).toList());
- return this;
+ return classpathStrings(List.of(files));
+ }
+
+ /**
+ * Sets classpath for analysis and interactive samples.
+ *
+ * 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
+ */
+ public SourceSet classpath(Path... files) {
+ return classpathPaths(List.of(files));
}
/**
@@ -281,6 +297,36 @@ public class SourceSet {
return classpath_;
}
+ /**
+ * Sets classpath for analysis and interactive samples.
+ *
+ * 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
+ */
+ 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
+ */
+ 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
+ */
+ public SourceSet includes(Path... files) {
+ return includesPaths(List.of(files));
+ }
+
+
/**
* Retrieves the Markdown files that contain module and package documentation.
*
@@ -449,6 +510,38 @@ public class SourceSet {
return this;
}
+ /**
+ * Sets the Markdown files that contain module and package documentation.
+ *
+ * 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
+ */
+ 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
+ */
+ public SourceSet includesStrings(Collection
@@ -465,6 +558,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.
*
@@ -657,8 +759,7 @@ public class SourceSet {
* @return this operation instance
*/
public SourceSet samples(File... samples) {
- samples_.addAll(List.of(samples));
- return this;
+ return samples(List.of(samples));
}
/**
@@ -671,7 +772,47 @@ public class SourceSet {
* @return this operation instance
*/
public SourceSet samples(String... samples) {
- samples_.addAll(Arrays.stream(samples).map(File::new).toList());
+ return samplesStrings(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 nne or more samples
+ * @return this operation instance
+ */
+ 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
+ */
+ 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
+ */
+ 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
+ */
+ public SourceSet src(Path... src) {
+ return srcPaths(List.of(src));
}
/**
@@ -787,6 +939,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
+ */
+ 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
+ */
+ public SourceSet srcStrings(Collection
@@ -800,7 +980,6 @@ public class SourceSet {
return this;
}
-
/**
* Retrieves the paths to files to be suppressed.
*
@@ -819,8 +998,7 @@ public class SourceSet {
* @return this operation instance
*/
public SourceSet suppressedFiles(String... suppressedFiles) {
- suppressedFiles_.addAll(Arrays.stream(suppressedFiles).map(File::new).toList());
- return this;
+ return suppressedFilesStrings(List.of(suppressedFiles));
}
/**
@@ -832,7 +1010,44 @@ public class SourceSet {
* @return this operation instance
*/
public SourceSet suppressedFiles(File... suppressedFiles) {
- suppressedFiles_.addAll(List.of(suppressedFiles));
+ return suppressedFiles(List.of(suppressedFiles));
+ }
+
+ /**
+ * Sets the paths to files to be suppressed.
+ *
+ * The files to be suppressed when generating documentation.
+ *
+ * @param suppressedFiles one or moe suppressed files
+ * @return this operation instance
+ */
+ 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
+ */
+ public SourceSet suppressedFilesPaths(Collection
+ * The files to be suppressed when generating documentation.
+ *
+ * @param suppressedFiles the suppressed files
+ * @return this operation instance
+ */
+ public SourceSet suppressedFilesStrings(Collection