Skip to content

Commit

Permalink
Added script to list parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed May 27, 2024
1 parent 1bdbe86 commit 749f43b
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 44 deletions.
17 changes: 17 additions & 0 deletions cliargs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

java -cp "lib/compile/*" -jar lib/compile/dokka-cli-*.jar -h |\
grep " -" |\
sed -e "s/ -/\"-/" -e "s/ \[.*//" -e "s/ -.*//" -e "s/\$/\",/" -e '/help/d' |\
sort |\
sed -e '$s/,//'

echo
echo ----------------------------------------
echo

java -cp "lib/compile/*" -jar lib/compile/dokka-cli-*.jar -sourceSet -h |\
grep " -" |\
sed -e "s/ -/\"-/" -e "s/ \[.*//" -e "s/ -.*//" -e "s/\$/\",/" -e '/help/d' -e '/includeNonPublic/d' |\
sort |\
sed -e '$s/,//'
40 changes: 20 additions & 20 deletions src/test/java/rife/bld/extension/dokka/DokkaOperationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,27 @@ class DokkaOperationTest {
@SuppressWarnings({"ExtractMethodRecommender", "PMD.AvoidDuplicateLiterals"})
void executeConstructProcessCommandListTest() {
var params = List.of(
"-delayTemplateSubstitution",
"-failOnWarning",
"-globalLinks",
"-globalPackageOptions",
"-globalSrcLink",
"-includes",
"-loggingLevel",
"-moduleName",
"-moduleVersion",
"-noSuppressObviousFunctions",
"-offlineMode",
"-outputDir",
"-sourceSet",
"-pluginsConfiguration",
"-pluginsClasspath",
"-offlineMode",
"-failOnWarning",
"-delayTemplateSubstitution",
"-noSuppressObviousFunctions",
"-includes",
"-suppressInheritedMembers",
"-globalPackageOptions",
"-globalLinks",
"-globalSrcLink",
"-loggingLevel");
"-pluginsConfiguration",
"-sourceSet",
"-suppressInheritedMembers");
var examples = new File("examples");
var jsonConf = new File("config.json");
var args = new DokkaOperation()
.delayTemplateSubstitution(true)
.failOnWarning(true)
.fromProject(new BaseProjectBlueprint(examples, "com.example", "Example"))
.globalLinks("s", "link")
.globalLinks(Map.of("s2", "link2"))
Expand All @@ -60,26 +62,24 @@ void executeConstructProcessCommandListTest() {
.globalSrcLink(List.of("link3", "link4"))
.includes("file1", "file2")
.includes(List.of("file3", "file4"))
.pluginConfigurations("name", "{\"json\"}")
.pluginConfigurations(Map.of("{\"name2\"}", "json2", "name3}", "{json3"))
.pluginsClasspath("path1", "path2")
.pluginsClasspath(List.of("path3", "path4"))
.delayTemplateSubstitution(true)
.failOnWarning(true)
.json(jsonConf)
.loggingLevel(LoggingLevel.DEBUG)
.moduleName("name")
.moduleVersion("1.0")
.noSuppressObviousFunctions(true)
.offlineMode(true)
.outputDir(new File(examples, "build"))
.outputFormat(OutputFormat.JAVADOC)
.suppressInheritedMembers(true)
.pluginConfigurations("name", "{\"json\"}")
.pluginConfigurations(Map.of("{\"name2\"}", "json2", "name3}", "{json3"))
.pluginsClasspath("path1", "path2")
.pluginsClasspath(List.of("path3", "path4"))
.sourceSet(new SourceSet().classpath(
List.of(
new File("examples/foo.jar"),
new File("examples/bar.jar")
)))
.json(jsonConf)
.suppressInheritedMembers(true)
.executeConstructProcessCommandList();

for (var p : params) {
Expand Down
48 changes: 24 additions & 24 deletions src/test/java/rife/bld/extension/dokka/SourceSetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,52 +54,52 @@ void sourceSetCollectionsTest() {
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
void sourceSetTest() {
var params = List.of(
"-sourceSetName",
"-displayName",
"-analysisPlatform",
"-apiVersion",
"-classpath",
"-src",
"-dependentSourceSets",
"-samples",
"-includes",
"-displayName",
"-documentedVisibilities",
"-reportUndocumented",
"-noSkipEmptyPackages",
"-skipDeprecated",
"-externalDocumentationLinks",
"-includes",
"-jdkVersion",
"-languageVersion",
"-apiVersion",
"-noStdlibLink",
"-noJdkLink",
"-suppressedFiles",
"-analysisPlatform",
"-noSkipEmptyPackages",
"-noStdlibLink",
"-perPackageOptions",
"-externalDocumentationLinks",
"-srcLink"
"-reportUndocumented",
"-samples",
"-skipDeprecated",
"-sourceSetName",
"-src",
"-srcLink",
"-suppressedFiles"
);
var sourceSet = new SourceSet()
.analysisPlatform(AnalysisPlatform.JVM)
.apiVersion("1.0")
.classpath("classpath1", "classpath2")
.dependentSourceSets("moduleName", "sourceSetName")
.displayName("name")
.documentedVisibilities(DocumentedVisibility.PACKAGE, DocumentedVisibility.PRIVATE)
.externalDocumentationLinks("url1", "packageListUrl1")
.externalDocumentationLinks("url2", "packageListUrl2")
.includes("includes1", "includes2")
.perPackageOptions("options1", "options2")
.samples("samples1", "sample2")
.srcLink("path1", "remote1", "#suffix1")
.srcLink("path2", "remote2", "#suffix2")
.src("src1", "src2")
.suppressedFiles("sup1", "sup2")
.analysisPlatform(AnalysisPlatform.JVM)
.apiVersion("1.0")
.displayName("name")
.jdkVersion(18)
.languageVersion("2.0")
.noJdkLink(true)
.noSkipEmptyPackages(true)
.noStdlibLink(true)
.perPackageOptions("options1", "options2")
.reportUndocumented(true)
.samples("samples1", "sample2")
.skipDeprecated(true)
.sourceSetName("setName");
.sourceSetName("setName")
.src("src1", "src2")
.srcLink("path1", "remote1", "#suffix1")
.srcLink("path2", "remote2", "#suffix2")
.suppressedFiles("sup1", "sup2");

var args = sourceSet.args();

Expand Down

0 comments on commit 749f43b

Please sign in to comment.