Added the compile and provided classpaths to the sourceSet when DokkaOperation().fromProject() is called. Closes #3

This commit is contained in:
Erik C. Thauvin 2024-05-25 00:59:51 -07:00
parent deb66a2d20
commit d2560125d7
Signed by: erik
GPG key ID: 776702A6A2DA330E
4 changed files with 45 additions and 16 deletions

View file

@ -55,6 +55,11 @@ class DokkaOperationTest {
.outputDir(new File(examples, "build"))
.outputFormat(OutputFormat.JAVADOC)
.suppressInheritedMembers(true)
.sourceSet(new SourceSet().classpath(
List.of(
new File("examples/foo.jar"),
new File("examples/bar.jar")
)))
.executeConstructProcessCommandList();
var path = examples.getAbsolutePath();
@ -66,7 +71,7 @@ class DokkaOperationTest {
path + "/lib/bld/javadoc-plugin-" + dokkaJar + ';' +
path + "/lib/bld/korte-jvm-4.0.10.jar;" +
path + "/lib/bld/kotlin-as-java-plugin-" + dokkaJar + ";path1;path2;path3;path4",
"-sourceSet", "-src " + path + "/src/main/kotlin",
"-sourceSet", "-src " + path + "/src/main/kotlin" + " -classpath " + path + "/foo.jar;" + path + "/bar.jar",
"-outputDir", path + "/build",
"-delayTemplateSubstitution",
"-failOnWarning",
@ -87,9 +92,9 @@ class DokkaOperationTest {
IntStream.range(0, args.size()).forEach(i -> {
if (args.get(i).contains(".jar;")) {
var jars = args.get(i).split(";");
Arrays.stream(jars).forEach(jar -> assertThat(matches.get(i)).contains(jar));
Arrays.stream(jars).forEach(jar -> assertThat(matches.get(i)).as(matches.get(i)).contains(jar));
} else {
assertThat(args.get(i)).isEqualTo(matches.get(i));
assertThat(args.get(i)).as(args.get(i)).isEqualTo(matches.get(i));
}
});
}