Fixed Dokka source links

This commit is contained in:
Erik C. Thauvin 2023-11-11 19:36:47 -08:00
parent 02f56a8373
commit 8597447422
9 changed files with 22 additions and 19 deletions

View file

@ -62,7 +62,8 @@ public class CompileKotlinOperation extends AbstractOperation<CompileKotlinOpera
var files = directory.listFiles();
if (files != null) {
for (var f : files) {
if (!f.getName().contains("-sources") && f.getName().matches(regex)) {
if (!f.getName().endsWith("-sources.jar") && (!f.getName().endsWith("-javadoc.jar")) &&
f.getName().matches(regex)) {
jars.add(f.getAbsolutePath());
}
}

View file

@ -142,7 +142,7 @@ public class DokkaOperation extends AbstractProcessOperation<DokkaOperation> {
args.add("-globalLinks");
var links = new ArrayList<String>();
globalLinks_.forEach((k, v) ->
links.add(String.format("{%s}^{%s}", k, v)));
links.add(String.format("%s^%s", k, v)));
args.add(String.join("^^", links));
}

View file

@ -123,7 +123,7 @@ public class SourceSet {
if (!externalDocumentationLinks_.isEmpty()) {
args.add("-externalDocumentationLinks");
var links = new ArrayList<String>();
externalDocumentationLinks_.forEach((k, v) -> links.add(String.format("{%s}^{%s}", k, v)));
externalDocumentationLinks_.forEach((k, v) -> links.add(String.format("%s^%s", k, v)));
args.add(String.join("^^", links));
}
@ -193,11 +193,11 @@ public class SourceSet {
args.add(String.join(SEMICOLON, src_));
}
// -srcLinks
// -srcLink
if (!srcLinks_.isEmpty()) {
args.add("-srcLinks");
args.add("-srcLink");
var links = new ArrayList<String>();
srcLinks_.forEach((k, v) -> links.add(String.format("{%s}={%s}", k, v)));
srcLinks_.forEach((k, v) -> links.add(String.format("%s=%s", k, v)));
args.add(String.join(SEMICOLON, links));
}
@ -501,15 +501,15 @@ public class SourceSet {
}
/**
* Sets the mpping between a source directory and a Web service for browsing the code.
* Sets the mapping between a source directory and a Web service for browsing the code.
*
* @param srcPath the source path
* @param remotePath the remote path
* @param lineSuffix the line suffix
* @return this operation instance
*/
public SourceSet srcLinks(String srcPath, String remotePath, String lineSuffix) {
srcLinks_.put(srcPath, remotePath + '#' + lineSuffix);
public SourceSet srcLink(String srcPath, String remotePath, String lineSuffix) {
srcLinks_.put(srcPath, remotePath + lineSuffix);
return this;
}

View file

@ -69,7 +69,7 @@ class DokkaOperationTest {
"-outputDir", path + "/build",
"-delayTemplateSubstitution", "true",
"-failOnWarning", "true",
"-globalLinks", "{s}^{link}^^{s2}^{link2}",
"-globalLinks", "s^link^^s2^link2",
"-globalPackageOptions", "option1;option2;option3;option4",
"-globalSrcLinks_", "link1;link2;link3;link4",
"-includes", "file1;file2",

View file

@ -39,7 +39,7 @@ class SourceSetTest {
var matches = List.of(
"-classpath", "path1;path2",
"-dependentSourceSets", "set1/set2;set3/set4",
"-externalDocumentationLinks", "{link3}^{link4}^^{link1}^{link2}",
"-externalDocumentationLinks", "link3^link4^^link1^link2",
"-perPackageOptions", "option1;option2",
"-samples", "samples1;samples1",
"-suppressedFiles", "sup1;sup2"
@ -62,8 +62,8 @@ class SourceSetTest {
.includes("includes1", "includes2")
.perPackageOptions("options1", "options2")
.samples("samples1", "sample2")
.srcLinks("path1", "remote1", "suffix1")
.srcLinks("path2", "remote2", "suffix2")
.srcLink("path1", "remote1", "#suffix1")
.srcLink("path2", "remote2", "#suffix2")
.src("src1", "src2")
.suppressedFiles("sup1", "sup2")
.analysisPlatform(AnalysisPlatform.JVM)
@ -86,7 +86,7 @@ class SourceSetTest {
"-dependentSourceSets", "moduleName/sourceSetName",
"-displayName", "name",
"-documentedVisibilities", "package;private",
"-externalDocumentationLinks", "{url1}^{packageListUrl1}^^{url2}^{packageListUrl2}",
"-externalDocumentationLinks", "url1^packageListUrl1^^url2^packageListUrl2",
"-jdkVersion", "18",
"-includes", "includes1;includes2",
"-languageVersion", "2.0",
@ -98,7 +98,7 @@ class SourceSetTest {
"-samples", "samples1;sample2",
"-skipDeprecated", "true",
"-src", "src1;src2",
"-srcLinks", "{path1}={remote1#suffix1};{path2}={remote2#suffix2}",
"-srcLink", "path1=remote1#suffix1;path2=remote2#suffix2",
"-sourceSetName", "setName",
"-suppressedFiles", "sup1;sup2");