Compare commits
4 commits
d2560125d7
...
10fd25ebf6
Author | SHA1 | Date | |
---|---|---|---|
10fd25ebf6 | |||
9de0095fbd | |||
e82810eaed | |||
6f5d20b2c0 |
5 changed files with 93 additions and 8 deletions
|
@ -3,12 +3,15 @@
|
||||||
TMPNEW=/tmp/checkcliargs-new
|
TMPNEW=/tmp/checkcliargs-new
|
||||||
TMPOLD=/tmp/checkcliargs-old
|
TMPOLD=/tmp/checkcliargs-old
|
||||||
|
|
||||||
cd lib/compile
|
java -cp "lib/compile/*" -jar lib/compile/dokka-cli-*.jar -h >$TMPNEW
|
||||||
java -cp "*" -jar dokka-cli-*.jar -h >$TMPNEW
|
java -cp "/examples/lib/bld*" -jar examples/lib/bld/dokka-cli-*.jar -h >$TMPOLD
|
||||||
|
|
||||||
cd ../../examples/lib/bld
|
|
||||||
java -cp "*" -jar dokka-cli-*.jar -h >$TMPOLD
|
|
||||||
|
|
||||||
diff $TMPOLD $TMPNEW
|
diff $TMPOLD $TMPNEW
|
||||||
|
|
||||||
|
java -cp "lib/compile/*" -jar lib/compile/dokka-cli-*.jar -sourceSet -h >$TMPNEW
|
||||||
|
java -cp "/examples/lib/bld*" -jar examples/lib/bld/dokka-cli-*.jar -sourceSet -h >$TMPOLD
|
||||||
|
|
||||||
|
diff $TMPOLD $TMPNEW
|
||||||
|
|
||||||
|
|
||||||
rm -rf $TMPNEW $TMPOLD
|
rm -rf $TMPNEW $TMPOLD
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class CompileKotlinOperationBuild extends Project {
|
||||||
scope(test)
|
scope(test)
|
||||||
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 2)))
|
.include(dependency("org.junit.jupiter", "junit-jupiter", version(5, 10, 2)))
|
||||||
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 2)))
|
.include(dependency("org.junit.platform", "junit-platform-console-standalone", version(1, 10, 2)))
|
||||||
.include(dependency("org.assertj", "assertj-core", version(3, 25, 3)));
|
.include(dependency("org.assertj", "assertj-core", version(3, 26, 0)));
|
||||||
|
|
||||||
javadocOperation()
|
javadocOperation()
|
||||||
.javadocOptions()
|
.javadocOptions()
|
||||||
|
|
|
@ -54,6 +54,7 @@ public class DokkaOperation extends AbstractProcessOperation<DokkaOperation> {
|
||||||
private final Map<String, String> pluginsConfiguration_ = new ConcurrentHashMap<>();
|
private final Map<String, String> pluginsConfiguration_ = new ConcurrentHashMap<>();
|
||||||
private boolean delayTemplateSubstitution_;
|
private boolean delayTemplateSubstitution_;
|
||||||
private boolean failOnWarning_;
|
private boolean failOnWarning_;
|
||||||
|
private File json;
|
||||||
private LoggingLevel loggingLevel_;
|
private LoggingLevel loggingLevel_;
|
||||||
private String moduleName_;
|
private String moduleName_;
|
||||||
private String moduleVersion_;
|
private String moduleVersion_;
|
||||||
|
@ -216,6 +217,11 @@ public class DokkaOperation extends AbstractProcessOperation<DokkaOperation> {
|
||||||
args.add("-suppressInheritedMembers");
|
args.add("-suppressInheritedMembers");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// json
|
||||||
|
if (json != null) {
|
||||||
|
args.add(json.getAbsolutePath());
|
||||||
|
}
|
||||||
|
|
||||||
if (LOGGER.isLoggable(Level.FINE)) {
|
if (LOGGER.isLoggable(Level.FINE)) {
|
||||||
LOGGER.fine(String.join(" ", args));
|
LOGGER.fine(String.join(" ", args));
|
||||||
}
|
}
|
||||||
|
@ -381,6 +387,16 @@ public class DokkaOperation extends AbstractProcessOperation<DokkaOperation> {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JSON configuration file path.
|
||||||
|
*
|
||||||
|
* @param configuration the configuration file path
|
||||||
|
*/
|
||||||
|
public DokkaOperation json(File configuration) {
|
||||||
|
json = configuration;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the logging level.
|
* Sets the logging level.
|
||||||
*
|
*
|
||||||
|
|
|
@ -31,7 +31,25 @@ class DokkaOperationTest {
|
||||||
@Test
|
@Test
|
||||||
@SuppressWarnings({"ExtractMethodRecommender", "PMD.AvoidDuplicateLiterals"})
|
@SuppressWarnings({"ExtractMethodRecommender", "PMD.AvoidDuplicateLiterals"})
|
||||||
void executeConstructProcessCommandListTest() {
|
void executeConstructProcessCommandListTest() {
|
||||||
|
var params = List.of(
|
||||||
|
"-moduleName",
|
||||||
|
"-moduleVersion",
|
||||||
|
"-outputDir",
|
||||||
|
"-sourceSet",
|
||||||
|
"-pluginsConfiguration",
|
||||||
|
"-pluginsClasspath",
|
||||||
|
"-offlineMode",
|
||||||
|
"-failOnWarning",
|
||||||
|
"-delayTemplateSubstitution",
|
||||||
|
"-noSuppressObviousFunctions",
|
||||||
|
"-includes",
|
||||||
|
"-suppressInheritedMembers",
|
||||||
|
"-globalPackageOptions",
|
||||||
|
"-globalLinks",
|
||||||
|
"-globalSrcLink",
|
||||||
|
"-loggingLevel");
|
||||||
var examples = new File("examples");
|
var examples = new File("examples");
|
||||||
|
var jsonConf = new File("config.json");
|
||||||
var args = new DokkaOperation()
|
var args = new DokkaOperation()
|
||||||
.fromProject(new BaseProjectBlueprint(examples, "com.example", "Example"))
|
.fromProject(new BaseProjectBlueprint(examples, "com.example", "Example"))
|
||||||
.globalLinks("s", "link")
|
.globalLinks("s", "link")
|
||||||
|
@ -41,6 +59,7 @@ class DokkaOperationTest {
|
||||||
.globalSrcLink("link1", "link2")
|
.globalSrcLink("link1", "link2")
|
||||||
.globalSrcLink(List.of("link3", "link4"))
|
.globalSrcLink(List.of("link3", "link4"))
|
||||||
.includes("file1", "file2")
|
.includes("file1", "file2")
|
||||||
|
.includes(List.of("file3", "file4"))
|
||||||
.pluginConfigurations("name", "{\"json\"}")
|
.pluginConfigurations("name", "{\"json\"}")
|
||||||
.pluginConfigurations(Map.of("{\"name2\"}", "json2", "name3}", "{json3"))
|
.pluginConfigurations(Map.of("{\"name2\"}", "json2", "name3}", "{json3"))
|
||||||
.pluginsClasspath("path1", "path2")
|
.pluginsClasspath("path1", "path2")
|
||||||
|
@ -60,8 +79,20 @@ class DokkaOperationTest {
|
||||||
new File("examples/foo.jar"),
|
new File("examples/foo.jar"),
|
||||||
new File("examples/bar.jar")
|
new File("examples/bar.jar")
|
||||||
)))
|
)))
|
||||||
|
.json(jsonConf)
|
||||||
.executeConstructProcessCommandList();
|
.executeConstructProcessCommandList();
|
||||||
|
|
||||||
|
for (var p : params) {
|
||||||
|
var found = false;
|
||||||
|
for (var a : args) {
|
||||||
|
if (a.startsWith(p)) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assertThat(found).as(p + " not found.").isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
var path = examples.getAbsolutePath();
|
var path = examples.getAbsolutePath();
|
||||||
var dokkaJar = "1.9.20.jar";
|
var dokkaJar = "1.9.20.jar";
|
||||||
var matches = List.of("java",
|
var matches = List.of("java",
|
||||||
|
@ -78,14 +109,15 @@ class DokkaOperationTest {
|
||||||
"-globalLinks", "s^link^^s2^link2",
|
"-globalLinks", "s^link^^s2^link2",
|
||||||
"-globalPackageOptions", "option1;option2;option3;option4",
|
"-globalPackageOptions", "option1;option2;option3;option4",
|
||||||
"-globalSrcLinks_", "link1;link2;link3;link4",
|
"-globalSrcLinks_", "link1;link2;link3;link4",
|
||||||
"-includes", "file1;file2",
|
"-includes", "file1;file2;file3;file4",
|
||||||
"-loggingLevel", "debug",
|
"-loggingLevel", "debug",
|
||||||
"-moduleName", "name",
|
"-moduleName", "name",
|
||||||
"-moduleVersion", "1.0",
|
"-moduleVersion", "1.0",
|
||||||
"-noSuppressObviousFunctions",
|
"-noSuppressObviousFunctions",
|
||||||
"-offlineMode",
|
"-offlineMode",
|
||||||
"-pluginsConfiguration", "{\\\"name2\\\"}={json2}^^{name}={\\\"json\\\"}^^{name3}}={{json3}",
|
"-pluginsConfiguration", "{\\\"name2\\\"}={json2}^^{name}={\\\"json\\\"}^^{name3}}={{json3}",
|
||||||
"-suppressInheritedMembers");
|
"-suppressInheritedMembers",
|
||||||
|
jsonConf.getAbsolutePath());
|
||||||
|
|
||||||
assertThat(args).hasSize(matches.size());
|
assertThat(args).hasSize(matches.size());
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,29 @@ class SourceSetTest {
|
||||||
@Test
|
@Test
|
||||||
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
|
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
|
||||||
void sourceSetTest() {
|
void sourceSetTest() {
|
||||||
|
var params = List.of(
|
||||||
|
"-sourceSetName",
|
||||||
|
"-displayName",
|
||||||
|
"-classpath",
|
||||||
|
"-src",
|
||||||
|
"-dependentSourceSets",
|
||||||
|
"-samples",
|
||||||
|
"-includes",
|
||||||
|
"-documentedVisibilities",
|
||||||
|
"-reportUndocumented",
|
||||||
|
"-noSkipEmptyPackages",
|
||||||
|
"-skipDeprecated",
|
||||||
|
"-jdkVersion",
|
||||||
|
"-languageVersion",
|
||||||
|
"-apiVersion",
|
||||||
|
"-noStdlibLink",
|
||||||
|
"-noJdkLink",
|
||||||
|
"-suppressedFiles",
|
||||||
|
"-analysisPlatform",
|
||||||
|
"-perPackageOptions",
|
||||||
|
"-externalDocumentationLinks",
|
||||||
|
"-srcLink"
|
||||||
|
);
|
||||||
var sourceSet = new SourceSet()
|
var sourceSet = new SourceSet()
|
||||||
.classpath("classpath1", "classpath2")
|
.classpath("classpath1", "classpath2")
|
||||||
.dependentSourceSets("moduleName", "sourceSetName")
|
.dependentSourceSets("moduleName", "sourceSetName")
|
||||||
|
@ -80,6 +103,17 @@ class SourceSetTest {
|
||||||
|
|
||||||
var args = sourceSet.args();
|
var args = sourceSet.args();
|
||||||
|
|
||||||
|
for (var p : params) {
|
||||||
|
var found = false;
|
||||||
|
for (var a : args) {
|
||||||
|
if (a.startsWith(p)) {
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assertThat(found).as(p + " not found.").isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
var matches = List.of(
|
var matches = List.of(
|
||||||
"-analysisPlatform", "jvm",
|
"-analysisPlatform", "jvm",
|
||||||
"-apiVersion", "1.0",
|
"-apiVersion", "1.0",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue