From 3a5f4f04bd95949741fa9f50fc0c2f5aea1eb52f Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Wed, 22 May 2024 16:30:12 -0700 Subject: [PATCH] Improved integer-type arguments --- .../rife/bld/extension/dokka/SourceSet.java | 46 +++++++++++++++++-- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/src/main/java/rife/bld/extension/dokka/SourceSet.java b/src/main/java/rife/bld/extension/dokka/SourceSet.java index 4a2dfb9..2c83ef6 100644 --- a/src/main/java/rife/bld/extension/dokka/SourceSet.java +++ b/src/main/java/rife/bld/extension/dokka/SourceSet.java @@ -40,7 +40,7 @@ public class SourceSet { private AnalysisPlatform analysisPlatform_; private String apiVersion_; private String displayName_; - private int jdkVersion_; + private String jdkVersion_; private String languageVersion_; private boolean noJdkLink_; private boolean noSkipEmptyPackages_; @@ -73,6 +73,17 @@ public class SourceSet { return this; } + /** + * Sets the Kotlin API version used for setting up analysis and samples. + * + * @param apiVersion the api version + * @return this operation instance + */ + public SourceSet apiVersion(int apiVersion) { + apiVersion_ = String.valueOf(apiVersion); + return this; + } + /** * Returns the formatted arguments. * @@ -130,9 +141,9 @@ public class SourceSet { } // -jdkVersion - if (jdkVersion_ > 0) { + if (jdkVersion_ != null) { args.add("-jdkVersion"); - args.add(String.valueOf(jdkVersion_)); + args.add(jdkVersion_); } // -includes @@ -375,11 +386,27 @@ public class SourceSet { * @param jdkVersion the JDK version * @return this operation instance */ - public SourceSet jdkVersion(int jdkVersion) { + public SourceSet jdkVersion(String jdkVersion) { jdkVersion_ = jdkVersion; return this; } + /** + * Sets the version of JDK to use for linking to JDK Javadocs. + *

+ * The JDK version to use when generating external documentation links for Java types. + *

+ * For example, if you use {@link java.util.UUID} in some public declaration signature, and this option is set to 8, + * Dokka generates an external documentation link to JDK 8 Javadocs for it. + * + * @param jdkVersion the JDK version + * @return this operation instance + */ + public SourceSet jdkVersion(int jdkVersion) { + jdkVersion_ = String.valueOf(jdkVersion); + return this; + } + /** * Sets the language version used for setting up analysis and samples. * @@ -391,6 +418,17 @@ public class SourceSet { return this; } + /** + * Sets the language version used for setting up analysis and samples. + * + * @param languageVersion the language version + * @return this operation instance + */ + public SourceSet languageVersion(int languageVersion) { + languageVersion_ = String.valueOf(languageVersion); + return this; + } + /** * Sets whether to generate links to JDK Javadocs. *