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

@ -3,15 +3,18 @@
<CLASSES> <CLASSES>
<root url="file://$PROJECT_DIR$/lib/bld" /> <root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.5.jar!/" /> <root url="jar://$USER_HOME$/.bld/dist/bld-1.7.5.jar!/" />
<root url="file://$PROJECT_DIR$/lib/bld" />
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES> <SOURCES>
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.5-sources.jar!/" /> <root url="jar://$USER_HOME$/.bld/dist/bld-1.7.5-sources.jar!/" />
<root url="file://$PROJECT_DIR$/lib/bld" />
</SOURCES> </SOURCES>
<excluded> <excluded>
<root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" /> <root url="jar://$PROJECT_DIR$/lib/bld/bld-wrapper.jar!/" />
</excluded> </excluded>
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" /> <jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" type="SOURCES" /> <jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" type="SOURCES" />
</library> </library>
</component> </component>

1
.idea/misc.xml generated
View file

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="EntryPointsManager"> <component name="EntryPointsManager">
<pattern value="rife.bld.extension.CompileKotlinOperationBuild" method="pmd" /> <pattern value="rife.bld.extension.CompileKotlinOperationBuild" method="pmd" />

View file

@ -6,6 +6,7 @@
</CLASSES> </CLASSES>
<JAVADOC /> <JAVADOC />
<SOURCES> <SOURCES>
<root url="file://$PROJECT_DIR$/lib/bld" />
<root url="jar://$USER_HOME$/.bld/dist/bld-1.7.5-sources.jar!/" /> <root url="jar://$USER_HOME$/.bld/dist/bld-1.7.5-sources.jar!/" />
</SOURCES> </SOURCES>
<excluded> <excluded>
@ -14,4 +15,4 @@
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" /> <jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" type="SOURCES" /> <jarDirectory url="file://$PROJECT_DIR$/lib/bld" recursive="false" type="SOURCES" />
</library> </library>
</component> </component>

View file

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="EntryPointsManager"> <component name="EntryPointsManager">
<pattern value="com.example.ExampleBuild" /> <pattern value="com.example.ExampleBuild" />

View file

@ -62,7 +62,8 @@ public class CompileKotlinOperation extends AbstractOperation<CompileKotlinOpera
var files = directory.listFiles(); var files = directory.listFiles();
if (files != null) { if (files != null) {
for (var f : files) { 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()); jars.add(f.getAbsolutePath());
} }
} }

View file

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

View file

@ -123,7 +123,7 @@ public class SourceSet {
if (!externalDocumentationLinks_.isEmpty()) { if (!externalDocumentationLinks_.isEmpty()) {
args.add("-externalDocumentationLinks"); args.add("-externalDocumentationLinks");
var links = new ArrayList<String>(); 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)); args.add(String.join("^^", links));
} }
@ -193,11 +193,11 @@ public class SourceSet {
args.add(String.join(SEMICOLON, src_)); args.add(String.join(SEMICOLON, src_));
} }
// -srcLinks // -srcLink
if (!srcLinks_.isEmpty()) { if (!srcLinks_.isEmpty()) {
args.add("-srcLinks"); args.add("-srcLink");
var links = new ArrayList<String>(); 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)); 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 srcPath the source path
* @param remotePath the remote path * @param remotePath the remote path
* @param lineSuffix the line suffix * @param lineSuffix the line suffix
* @return this operation instance * @return this operation instance
*/ */
public SourceSet srcLinks(String srcPath, String remotePath, String lineSuffix) { public SourceSet srcLink(String srcPath, String remotePath, String lineSuffix) {
srcLinks_.put(srcPath, remotePath + '#' + lineSuffix); srcLinks_.put(srcPath, remotePath + lineSuffix);
return this; return this;
} }

View file

@ -69,7 +69,7 @@ class DokkaOperationTest {
"-outputDir", path + "/build", "-outputDir", path + "/build",
"-delayTemplateSubstitution", "true", "-delayTemplateSubstitution", "true",
"-failOnWarning", "true", "-failOnWarning", "true",
"-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",

View file

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