Added method to reset the Dokka plugins

Added examples for generating documenation in HTML and markdown formats
This commit is contained in:
Erik C. Thauvin 2023-11-05 22:42:51 -08:00
parent c59a08542f
commit 84f14212f4
7 changed files with 78 additions and 29 deletions

View file

@ -47,6 +47,7 @@ public class CompileKotlinOperationBuild extends Project {
.include(dependency("org.jetbrains.dokka", "dokka-base", dokka))
.include(dependency("org.jetbrains.dokka", "analysis-kotlin-descriptors", dokka))
.include(dependency("org.jetbrains.dokka", "javadoc-plugin", dokka))
.include(dependency("org.jetbrains.dokka", "gfm-plugin", dokka))
.include(dependency("com.uwyn.rife2", "bld", version(1, 7, 5)));
scope(test)
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 0)))

View file

@ -426,28 +426,6 @@ public class DokkaOperation extends AbstractProcessOperation<DokkaOperation> {
return this;
}
/**
* Sets the list of jars with Dokka plugins and their dependencies.
*
* @param jars one or more jars
* @return this operation instance
*/
public DokkaOperation pluginClassPath(String... jars) {
pluginsClasspath_.addAll(Arrays.asList(jars));
return this;
}
/**
* Sets the list of jars with Dokka plugins and their dependencies.
*
* @param jars the list of jars
* @return this operation instance
*/
public DokkaOperation pluginClassPath(Collection<String> jars) {
pluginsClasspath_.addAll(jars);
return this;
}
/**
* Sets the configuration for Dokka plugins.
*
@ -472,6 +450,41 @@ public class DokkaOperation extends AbstractProcessOperation<DokkaOperation> {
return this;
}
/**
* Sets the list of jars with Dokka plugins and their dependencies.
*
* @param jars one or more jars
* @return this operation instance
*/
public DokkaOperation pluginsClasspath(String... jars) {
pluginsClasspath_.addAll(Arrays.asList(jars));
return this;
}
/**
* Sets the list of jars with Dokka plugins and their dependencies.
*
* @param jars the list of jars
* @return this operation instance
*/
public DokkaOperation pluginsClasspath(Collection<String> jars) {
pluginsClasspath_.addAll(jars);
return this;
}
/**
* Clears the list of Dokka plugins.
*
* @param clear set to clear the list
* @return this operation instance
*/
public DokkaOperation pluginsClasspath(boolean clear) {
if (clear) {
pluginsClasspath_.clear();
}
return this;
}
/**
* Sets the configurations for a source set.
*

View file

@ -43,8 +43,8 @@ class DokkaOperationTest {
.includes("file1", "file2")
.pluginConfiguration("name", "\"json\"")
.pluginConfiguration(Map.of("\"name2\"", "json2"))
.pluginClassPath("path1", "path2")
.pluginClassPath(List.of("path3", "path4"))
.pluginsClasspath("path1", "path2")
.pluginsClasspath(List.of("path3", "path4"))
.delayTemplateSubstitution(true)
.failOnWarning(true)
.loggingLevel(LoggingLevel.DEBUG)
@ -84,9 +84,9 @@ class DokkaOperationTest {
IntStream.range(0, args.size()).forEach(i -> {
if (args.get(i).contains(".jar;")) {
var jars = args.get(i).split(";");
var jars = args.get(i).split(";");
Arrays.stream(jars).forEach(jar -> assertThat(matches.get(i)).contains(jar));
} else{
} else {
assertThat(args.get(i)).isEqualTo(matches.get(i));
}
});