Cleaned up Javadocs
This commit is contained in:
parent
d800fda561
commit
2f9b7a5056
5 changed files with 261 additions and 46 deletions
204
.idea/intellij-javadocs-4.0.1.xml
generated
Normal file
204
.idea/intellij-javadocs-4.0.1.xml
generated
Normal file
|
@ -0,0 +1,204 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="JavaDocConfiguration">
|
||||||
|
<GENERAL>
|
||||||
|
<MODE>UPDATE</MODE>
|
||||||
|
<OVERRIDDEN_METHODS>false</OVERRIDDEN_METHODS>
|
||||||
|
<SPLITTED_CLASS_NAME>true</SPLITTED_CLASS_NAME>
|
||||||
|
<LEVELS>
|
||||||
|
<LEVEL>FIELD</LEVEL>
|
||||||
|
<LEVEL>TYPE</LEVEL>
|
||||||
|
<LEVEL>METHOD</LEVEL>
|
||||||
|
</LEVELS>
|
||||||
|
<VISIBILITIES>
|
||||||
|
<VISIBILITY>DEFAULT</VISIBILITY>
|
||||||
|
<VISIBILITY>PUBLIC</VISIBILITY>
|
||||||
|
<VISIBILITY>PROTECTED</VISIBILITY>
|
||||||
|
</VISIBILITIES>
|
||||||
|
</GENERAL>
|
||||||
|
<TEMPLATES>
|
||||||
|
<CLASSES>
|
||||||
|
<CLASS>
|
||||||
|
<KEY>^.*(public|protected|private)*.+interface\s+\w+.*</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* The interface ${name}.\n
|
||||||
|
<#if element.typeParameters?has_content> * \n
|
||||||
|
</#if>
|
||||||
|
<#list element.typeParameters as typeParameter>
|
||||||
|
* @param <${typeParameter.name}> the type parameter\n
|
||||||
|
</#list>
|
||||||
|
*/</VALUE>
|
||||||
|
</CLASS>
|
||||||
|
<CLASS>
|
||||||
|
<KEY>^.*(public|protected|private)*.+enum\s+\w+.*</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* The enum ${name}.\n
|
||||||
|
*/</VALUE>
|
||||||
|
</CLASS>
|
||||||
|
<CLASS>
|
||||||
|
<KEY>^.*(public|protected|private)*.+class\s+\w+.*</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* The type ${name}.\n
|
||||||
|
<#if element.typeParameters?has_content> * \n
|
||||||
|
</#if>
|
||||||
|
<#list element.typeParameters as typeParameter>
|
||||||
|
* @param <${typeParameter.name}> the type parameter\n
|
||||||
|
</#list>
|
||||||
|
*/</VALUE>
|
||||||
|
</CLASS>
|
||||||
|
<CLASS>
|
||||||
|
<KEY>.+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* The type ${name}.\n
|
||||||
|
*/</VALUE>
|
||||||
|
</CLASS>
|
||||||
|
</CLASSES>
|
||||||
|
<CONSTRUCTORS>
|
||||||
|
<CONSTRUCTOR>
|
||||||
|
<KEY>.+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* Instantiates a new ${name}.\n
|
||||||
|
<#if element.parameterList.parameters?has_content>
|
||||||
|
*\n
|
||||||
|
</#if>
|
||||||
|
<#list element.parameterList.parameters as parameter>
|
||||||
|
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
|
||||||
|
</#list>
|
||||||
|
<#if element.throwsList.referenceElements?has_content>
|
||||||
|
*\n
|
||||||
|
</#if>
|
||||||
|
<#list element.throwsList.referenceElements as exception>
|
||||||
|
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
|
||||||
|
</#list>
|
||||||
|
*/</VALUE>
|
||||||
|
</CONSTRUCTOR>
|
||||||
|
</CONSTRUCTORS>
|
||||||
|
<METHODS>
|
||||||
|
<METHOD>
|
||||||
|
<KEY>^.*(public|protected|private)*\s*.*(\w(\s*<.+>)*)+\s+get\w+\s*\(.*\).+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* Gets ${partName}.\n
|
||||||
|
<#if element.typeParameters?has_content> * \n
|
||||||
|
</#if>
|
||||||
|
<#list element.typeParameters as typeParameter>
|
||||||
|
* @param <${typeParameter.name}> the type parameter\n
|
||||||
|
</#list>
|
||||||
|
<#if element.parameterList.parameters?has_content>
|
||||||
|
*\n
|
||||||
|
</#if>
|
||||||
|
<#list element.parameterList.parameters as parameter>
|
||||||
|
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
|
||||||
|
</#list>
|
||||||
|
<#if isNotVoid>
|
||||||
|
*\n
|
||||||
|
* @return the ${partName}\n
|
||||||
|
</#if>
|
||||||
|
<#if element.throwsList.referenceElements?has_content>
|
||||||
|
*\n
|
||||||
|
</#if>
|
||||||
|
<#list element.throwsList.referenceElements as exception>
|
||||||
|
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
|
||||||
|
</#list>
|
||||||
|
*/</VALUE>
|
||||||
|
</METHOD>
|
||||||
|
<METHOD>
|
||||||
|
<KEY>^.*(public|protected|private)*\s*.*(void|\w(\s*<.+>)*)+\s+set\w+\s*\(.*\).+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* Sets ${partName}.\n
|
||||||
|
<#if element.typeParameters?has_content> * \n
|
||||||
|
</#if>
|
||||||
|
<#list element.typeParameters as typeParameter>
|
||||||
|
* @param <${typeParameter.name}> the type parameter\n
|
||||||
|
</#list>
|
||||||
|
<#if element.parameterList.parameters?has_content>
|
||||||
|
*\n
|
||||||
|
</#if>
|
||||||
|
<#list element.parameterList.parameters as parameter>
|
||||||
|
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
|
||||||
|
</#list>
|
||||||
|
<#if isNotVoid>
|
||||||
|
*\n
|
||||||
|
* @return the ${partName}\n
|
||||||
|
</#if>
|
||||||
|
<#if element.throwsList.referenceElements?has_content>
|
||||||
|
*\n
|
||||||
|
</#if>
|
||||||
|
<#list element.throwsList.referenceElements as exception>
|
||||||
|
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
|
||||||
|
</#list>
|
||||||
|
*/</VALUE>
|
||||||
|
</METHOD>
|
||||||
|
<METHOD>
|
||||||
|
<KEY>^.*((public\s+static)|(static\s+public))\s+void\s+main\s*\(\s*String\s*(\[\s*\]|\.\.\.)\s+\w+\s*\).+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* The entry point of application.\n
|
||||||
|
|
||||||
|
<#if element.parameterList.parameters?has_content>
|
||||||
|
*\n
|
||||||
|
</#if>
|
||||||
|
* @param ${element.parameterList.parameters[0].name} the input arguments\n
|
||||||
|
<#if element.throwsList.referenceElements?has_content>
|
||||||
|
*\n
|
||||||
|
</#if>
|
||||||
|
<#list element.throwsList.referenceElements as exception>
|
||||||
|
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
|
||||||
|
</#list>
|
||||||
|
*/</VALUE>
|
||||||
|
</METHOD>
|
||||||
|
<METHOD>
|
||||||
|
<KEY>.+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* ${name}<#if isNotVoid> ${return}</#if>.\n
|
||||||
|
<#if element.typeParameters?has_content> * \n
|
||||||
|
</#if>
|
||||||
|
<#list element.typeParameters as typeParameter>
|
||||||
|
* @param <${typeParameter.name}> the type parameter\n
|
||||||
|
</#list>
|
||||||
|
<#if element.parameterList.parameters?has_content>
|
||||||
|
*\n
|
||||||
|
</#if>
|
||||||
|
<#list element.parameterList.parameters as parameter>
|
||||||
|
* @param ${parameter.name} the ${paramNames[parameter.name]}\n
|
||||||
|
</#list>
|
||||||
|
<#if isNotVoid>
|
||||||
|
*\n
|
||||||
|
* @return the ${return}\n
|
||||||
|
</#if>
|
||||||
|
<#if element.throwsList.referenceElements?has_content>
|
||||||
|
*\n
|
||||||
|
</#if>
|
||||||
|
<#list element.throwsList.referenceElements as exception>
|
||||||
|
* @throws ${exception.referenceName} the ${exceptionNames[exception.referenceName]}\n
|
||||||
|
</#list>
|
||||||
|
*/</VALUE>
|
||||||
|
</METHOD>
|
||||||
|
</METHODS>
|
||||||
|
<FIELDS>
|
||||||
|
<FIELD>
|
||||||
|
<KEY>^.*(public|protected|private)*.+static.*(\w\s\w)+.+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
* The constant ${element.getName()}.\n
|
||||||
|
*/</VALUE>
|
||||||
|
</FIELD>
|
||||||
|
<FIELD>
|
||||||
|
<KEY>^.*(public|protected|private)*.*(\w\s\w)+.+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
<#if element.parent.isInterface()>
|
||||||
|
* The constant ${element.getName()}.\n
|
||||||
|
<#else>
|
||||||
|
* The ${name}.\n
|
||||||
|
</#if> */</VALUE>
|
||||||
|
</FIELD>
|
||||||
|
<FIELD>
|
||||||
|
<KEY>.+</KEY>
|
||||||
|
<VALUE>/**\n
|
||||||
|
<#if element.parent.isEnum()>
|
||||||
|
*${name} ${typeName}.\n
|
||||||
|
<#else>
|
||||||
|
* The ${name}.\n
|
||||||
|
</#if>*/</VALUE>
|
||||||
|
</FIELD>
|
||||||
|
</FIELDS>
|
||||||
|
</TEMPLATES>
|
||||||
|
</component>
|
||||||
|
</project>
|
|
@ -35,6 +35,9 @@ import java.util.regex.Pattern;
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public class CompileKotlinOperation extends AbstractOperation<CompileKotlinOperation> {
|
public class CompileKotlinOperation extends AbstractOperation<CompileKotlinOperation> {
|
||||||
|
/**
|
||||||
|
* The Kotlin file (.kt) pattern.
|
||||||
|
*/
|
||||||
public static final Pattern KOTLIN_FILE_PATTERN = Pattern.compile("^.*\\.kt$");
|
public static final Pattern KOTLIN_FILE_PATTERN = Pattern.compile("^.*\\.kt$");
|
||||||
private static final Logger LOGGER = Logger.getLogger(CompileKotlinOperation.class.getName());
|
private static final Logger LOGGER = Logger.getLogger(CompileKotlinOperation.class.getName());
|
||||||
private final Collection<String> compileMainClasspath_ = new ArrayList<>();
|
private final Collection<String> compileMainClasspath_ = new ArrayList<>();
|
||||||
|
@ -177,6 +180,8 @@ public class CompileKotlinOperation extends AbstractOperation<CompileKotlinOpera
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the list of compilation options for the compiler.
|
* Retrieves the list of compilation options for the compiler.
|
||||||
|
*
|
||||||
|
* @return the compile kotlin options
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions compileOptions() {
|
public CompileKotlinOptions compileOptions() {
|
||||||
return compileOptions_;
|
return compileOptions_;
|
||||||
|
@ -246,12 +251,16 @@ public class CompileKotlinOperation extends AbstractOperation<CompileKotlinOpera
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Part of the {@link #execute execute} operation, builds the main sources.
|
* Part of the {@link #execute execute} operation, builds the main sources.
|
||||||
|
*
|
||||||
|
* @throws IOException if an error occurs
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("PMD.SystemPrintln")
|
||||||
protected void executeBuildMainSources()
|
protected void executeBuildMainSources()
|
||||||
throws IOException {
|
throws IOException {
|
||||||
if (!silent()) {
|
if (!silent()) {
|
||||||
System.out.println("Compiling Kotlin main sources.");
|
System.out.println("Compiling Kotlin main sources.");
|
||||||
}
|
}
|
||||||
|
|
||||||
executeBuildSources(
|
executeBuildSources(
|
||||||
compileMainClasspath(),
|
compileMainClasspath(),
|
||||||
sources(mainSourceFiles(), mainSourceDirectories()),
|
sources(mainSourceFiles(), mainSourceDirectories()),
|
||||||
|
@ -266,6 +275,7 @@ public class CompileKotlinOperation extends AbstractOperation<CompileKotlinOpera
|
||||||
* @param sources the source files to compile
|
* @param sources the source files to compile
|
||||||
* @param destination the destination directory
|
* @param destination the destination directory
|
||||||
* @param friendPaths the output directory for friendly modules
|
* @param friendPaths the output directory for friendly modules
|
||||||
|
* @throws IOException if an error occurs
|
||||||
*/
|
*/
|
||||||
protected void executeBuildSources(Collection<String> classpath, Collection<File> sources, File destination,
|
protected void executeBuildSources(Collection<String> classpath, Collection<File> sources, File destination,
|
||||||
File friendPaths)
|
File friendPaths)
|
||||||
|
@ -315,7 +325,10 @@ public class CompileKotlinOperation extends AbstractOperation<CompileKotlinOpera
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Part of the {@link #execute execute} operation, builds the test sources.
|
* Part of the {@link #execute execute} operation, builds the test sources.
|
||||||
|
*
|
||||||
|
* @throws IOException if an error occurs
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("PMD.SystemPrintln")
|
||||||
protected void executeBuildTestSources()
|
protected void executeBuildTestSources()
|
||||||
throws IOException {
|
throws IOException {
|
||||||
if (!silent()) {
|
if (!silent()) {
|
||||||
|
@ -330,6 +343,8 @@ public class CompileKotlinOperation extends AbstractOperation<CompileKotlinOpera
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Part of the {@link #execute execute} operation, creates the build directories.
|
* Part of the {@link #execute execute} operation, creates the build directories.
|
||||||
|
*
|
||||||
|
* @throws IOException if an error occurs
|
||||||
*/
|
*/
|
||||||
protected void executeCreateBuildDirectories() throws IOException {
|
protected void executeCreateBuildDirectories() throws IOException {
|
||||||
if (buildMainDirectory() != null && !buildMainDirectory().exists() && !buildMainDirectory().mkdirs()) {
|
if (buildMainDirectory() != null && !buildMainDirectory().exists() && !buildMainDirectory().mkdirs()) {
|
||||||
|
@ -358,6 +373,7 @@ public class CompileKotlinOperation extends AbstractOperation<CompileKotlinOpera
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @param project the project to configure the compile operation from
|
* @param project the project to configure the compile operation from
|
||||||
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOperation fromProject(BaseProject project) {
|
public CompileKotlinOperation fromProject(BaseProject project) {
|
||||||
project_ = project;
|
project_ = project;
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class CompileKotlinOptions {
|
||||||
* Allow using declarations only from the specified version of Kotlin bundled libraries.
|
* Allow using declarations only from the specified version of Kotlin bundled libraries.
|
||||||
*
|
*
|
||||||
* @param version the api version
|
* @param version the api version
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions apiVersion(String version) {
|
public CompileKotlinOptions apiVersion(String version) {
|
||||||
apiVersion_ = version;
|
apiVersion_ = version;
|
||||||
|
@ -81,7 +81,7 @@ public class CompileKotlinOptions {
|
||||||
* If the files reside in locations different from the current directory, use relative paths.
|
* If the files reside in locations different from the current directory, use relative paths.
|
||||||
*
|
*
|
||||||
* @param files one or more files
|
* @param files one or more files
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions argFile(String... files) {
|
public CompileKotlinOptions argFile(String... files) {
|
||||||
argFile_.addAll(List.of(files));
|
argFile_.addAll(List.of(files));
|
||||||
|
@ -92,7 +92,7 @@ public class CompileKotlinOptions {
|
||||||
* Read the compiler options from the given files.
|
* Read the compiler options from the given files.
|
||||||
*
|
*
|
||||||
* @param files the list of files
|
* @param files the list of files
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
* @see #argFile(String...)
|
* @see #argFile(String...)
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions argFile(Collection<String> files) {
|
public CompileKotlinOptions argFile(Collection<String> files) {
|
||||||
|
@ -191,12 +191,10 @@ public class CompileKotlinOptions {
|
||||||
}
|
}
|
||||||
|
|
||||||
// opt-in
|
// opt-in
|
||||||
if (!optIn_.isEmpty()) {
|
optIn_.stream().filter(CompileKotlinOperation::isNotBlank).forEach(o -> {
|
||||||
optIn_.forEach(o -> {
|
args.add("-opt-in");
|
||||||
args.add("-opt-in");
|
args.add(o);
|
||||||
args.add(o);
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// options
|
// options
|
||||||
if (!options_.isEmpty()) {
|
if (!options_.isEmpty()) {
|
||||||
|
@ -210,12 +208,10 @@ public class CompileKotlinOptions {
|
||||||
}
|
}
|
||||||
|
|
||||||
// plugin
|
// plugin
|
||||||
if (!plugin_.isEmpty()) {
|
plugin_.stream().filter(CompileKotlinOperation::isNotBlank).forEach(p -> {
|
||||||
plugin_.forEach(p -> {
|
args.add("-P");
|
||||||
args.add("-P");
|
args.add("plugin:" + p);
|
||||||
args.add("plugin:" + p);
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// progressive
|
// progressive
|
||||||
if (progressive_) {
|
if (progressive_) {
|
||||||
|
@ -247,7 +243,7 @@ public class CompileKotlinOptions {
|
||||||
* The classpath can contain file and directory paths, ZIP, or JAR files.
|
* The classpath can contain file and directory paths, ZIP, or JAR files.
|
||||||
*
|
*
|
||||||
* @param paths one pr more paths
|
* @param paths one pr more paths
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions classpath(String... paths) {
|
public CompileKotlinOptions classpath(String... paths) {
|
||||||
classpath_.addAll(List.of(paths));
|
classpath_.addAll(List.of(paths));
|
||||||
|
@ -260,7 +256,7 @@ public class CompileKotlinOptions {
|
||||||
* The classpath can contain file and directory paths, ZIP, or JAR files.
|
* The classpath can contain file and directory paths, ZIP, or JAR files.
|
||||||
*
|
*
|
||||||
* @param paths the list of paths
|
* @param paths the list of paths
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions classpath(Collection<String> paths) {
|
public CompileKotlinOptions classpath(Collection<String> paths) {
|
||||||
classpath_.addAll(paths);
|
classpath_.addAll(paths);
|
||||||
|
@ -281,7 +277,7 @@ public class CompileKotlinOptions {
|
||||||
* environment.
|
* environment.
|
||||||
*
|
*
|
||||||
* @param includeRuntime {@code true} or {@code false}
|
* @param includeRuntime {@code true} or {@code false}
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions includeRuntime(boolean includeRuntime) {
|
public CompileKotlinOptions includeRuntime(boolean includeRuntime) {
|
||||||
includeRuntime_ = includeRuntime;
|
includeRuntime_ = includeRuntime;
|
||||||
|
@ -292,7 +288,7 @@ public class CompileKotlinOptions {
|
||||||
* Generate metadata for Java 1.8 reflection on method parameters.
|
* Generate metadata for Java 1.8 reflection on method parameters.
|
||||||
*
|
*
|
||||||
* @param javaParameters {@code true} or {@code false}
|
* @param javaParameters {@code true} or {@code false}
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions javaParameters(boolean javaParameters) {
|
public CompileKotlinOptions javaParameters(boolean javaParameters) {
|
||||||
javaParameters_ = javaParameters;
|
javaParameters_ = javaParameters;
|
||||||
|
@ -303,7 +299,7 @@ public class CompileKotlinOptions {
|
||||||
* Use a custom JDK home directory to include into the classpath if it differs from the default {@code JAVA_HOME}.
|
* Use a custom JDK home directory to include into the classpath if it differs from the default {@code JAVA_HOME}.
|
||||||
*
|
*
|
||||||
* @param jdkHome the JDK home path
|
* @param jdkHome the JDK home path
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions jdkHome(String jdkHome) {
|
public CompileKotlinOptions jdkHome(String jdkHome) {
|
||||||
jdkHome_ = jdkHome;
|
jdkHome_ = jdkHome;
|
||||||
|
@ -319,7 +315,7 @@ public class CompileKotlinOptions {
|
||||||
* Possible values are 1.8, 9, 10, ..., 21. The default value is 1.8.
|
* Possible values are 1.8, 9, 10, ..., 21. The default value is 1.8.
|
||||||
*
|
*
|
||||||
* @param version the target version
|
* @param version the target version
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions jdkRelease(String version) {
|
public CompileKotlinOptions jdkRelease(String version) {
|
||||||
jdkRelease_ = version;
|
jdkRelease_ = version;
|
||||||
|
@ -330,7 +326,7 @@ public class CompileKotlinOptions {
|
||||||
* Specify the target version of the generated JVM bytecode.
|
* Specify the target version of the generated JVM bytecode.
|
||||||
*
|
*
|
||||||
* @param version the target version
|
* @param version the target version
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
* @see #jdkRelease(String)
|
* @see #jdkRelease(String)
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions jdkRelease(int version) {
|
public CompileKotlinOptions jdkRelease(int version) {
|
||||||
|
@ -344,7 +340,7 @@ public class CompileKotlinOptions {
|
||||||
* Possible values are 1.8, 9, 10, ..., 21. The default value is 1.8.
|
* Possible values are 1.8, 9, 10, ..., 21. The default value is 1.8.
|
||||||
*
|
*
|
||||||
* @param target the target version
|
* @param target the target version
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions jvmTarget(String target) {
|
public CompileKotlinOptions jvmTarget(String target) {
|
||||||
jvmTarget_ = target;
|
jvmTarget_ = target;
|
||||||
|
@ -355,7 +351,7 @@ public class CompileKotlinOptions {
|
||||||
* Specify the target version of the generated JVM bytecode.
|
* Specify the target version of the generated JVM bytecode.
|
||||||
*
|
*
|
||||||
* @param target the target version
|
* @param target the target version
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
* @see #jvmTarget(String)
|
* @see #jvmTarget(String)
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions jvmTarget(int target) {
|
public CompileKotlinOptions jvmTarget(int target) {
|
||||||
|
@ -367,7 +363,7 @@ public class CompileKotlinOptions {
|
||||||
* Specify a custom path to the Kotlin compiler used for the discovery of runtime libraries.
|
* Specify a custom path to the Kotlin compiler used for the discovery of runtime libraries.
|
||||||
*
|
*
|
||||||
* @param path the Kotlin home path
|
* @param path the Kotlin home path
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions kotlinHome(String path) {
|
public CompileKotlinOptions kotlinHome(String path) {
|
||||||
kotlinHome_ = path;
|
kotlinHome_ = path;
|
||||||
|
@ -378,7 +374,7 @@ public class CompileKotlinOptions {
|
||||||
* Provide source compatibility with the specified version of Kotlin.
|
* Provide source compatibility with the specified version of Kotlin.
|
||||||
*
|
*
|
||||||
* @param version the language version
|
* @param version the language version
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions languageVersion(String version) {
|
public CompileKotlinOptions languageVersion(String version) {
|
||||||
languageVersion_ = version;
|
languageVersion_ = version;
|
||||||
|
@ -389,7 +385,7 @@ public class CompileKotlinOptions {
|
||||||
* Set a custom name for the generated {@code .kotlin_module} file.
|
* Set a custom name for the generated {@code .kotlin_module} file.
|
||||||
*
|
*
|
||||||
* @param name the module name
|
* @param name the module name
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions moduleName(String name) {
|
public CompileKotlinOptions moduleName(String name) {
|
||||||
moduleName_ = name;
|
moduleName_ = name;
|
||||||
|
@ -400,7 +396,7 @@ public class CompileKotlinOptions {
|
||||||
* Don't automatically include the Java runtime into the classpath.
|
* Don't automatically include the Java runtime into the classpath.
|
||||||
*
|
*
|
||||||
* @param noJdk {@code true} or {@code false}
|
* @param noJdk {@code true} or {@code false}
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions noJdk(boolean noJdk) {
|
public CompileKotlinOptions noJdk(boolean noJdk) {
|
||||||
noJdk_ = noJdk;
|
noJdk_ = noJdk;
|
||||||
|
@ -411,7 +407,7 @@ public class CompileKotlinOptions {
|
||||||
* Don't automatically include the Kotlin reflection ({@code kotlin-reflect.jar}) into the classpath.
|
* Don't automatically include the Kotlin reflection ({@code kotlin-reflect.jar}) into the classpath.
|
||||||
*
|
*
|
||||||
* @param noReflect {@code true} or {@code false}
|
* @param noReflect {@code true} or {@code false}
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions noReflect(boolean noReflect) {
|
public CompileKotlinOptions noReflect(boolean noReflect) {
|
||||||
noReflect_ = noReflect;
|
noReflect_ = noReflect;
|
||||||
|
@ -423,7 +419,7 @@ public class CompileKotlinOptions {
|
||||||
* ({@code kotlin-reflect.jar}) into the classpath.
|
* ({@code kotlin-reflect.jar}) into the classpath.
|
||||||
*
|
*
|
||||||
* @param noStdLib {@code true} or {@code false}
|
* @param noStdLib {@code true} or {@code false}
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions noStdLib(boolean noStdLib) {
|
public CompileKotlinOptions noStdLib(boolean noStdLib) {
|
||||||
noStdLib_ = noStdLib;
|
noStdLib_ = noStdLib;
|
||||||
|
@ -434,7 +430,7 @@ public class CompileKotlinOptions {
|
||||||
* Suppress the compiler from displaying warnings during compilation.
|
* Suppress the compiler from displaying warnings during compilation.
|
||||||
*
|
*
|
||||||
* @param noWarn {@code true} or {@code false}
|
* @param noWarn {@code true} or {@code false}
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions noWarn(boolean noWarn) {
|
public CompileKotlinOptions noWarn(boolean noWarn) {
|
||||||
noWarn_ = noWarn;
|
noWarn_ = noWarn;
|
||||||
|
@ -445,7 +441,7 @@ public class CompileKotlinOptions {
|
||||||
* Enable usages of API that requires opt-in with a requirement annotation with the given fully qualified name.
|
* Enable usages of API that requires opt-in with a requirement annotation with the given fully qualified name.
|
||||||
*
|
*
|
||||||
* @param annotations one or more annotation names
|
* @param annotations one or more annotation names
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions optIn(String... annotations) {
|
public CompileKotlinOptions optIn(String... annotations) {
|
||||||
optIn_.addAll(List.of(annotations));
|
optIn_.addAll(List.of(annotations));
|
||||||
|
@ -456,7 +452,7 @@ public class CompileKotlinOptions {
|
||||||
* Enable usages of API that requires opt-in with a requirement annotation with the given fully qualified name.
|
* Enable usages of API that requires opt-in with a requirement annotation with the given fully qualified name.
|
||||||
*
|
*
|
||||||
* @param annotations list of annotation names
|
* @param annotations list of annotation names
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions optIn(Collection<String> annotations) {
|
public CompileKotlinOptions optIn(Collection<String> annotations) {
|
||||||
optIn_.addAll(annotations);
|
optIn_.addAll(annotations);
|
||||||
|
@ -467,7 +463,7 @@ public class CompileKotlinOptions {
|
||||||
* Specify additional compiler options.
|
* Specify additional compiler options.
|
||||||
*
|
*
|
||||||
* @param options one or more compiler options
|
* @param options one or more compiler options
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions options(String... options) {
|
public CompileKotlinOptions options(String... options) {
|
||||||
options_.addAll(List.of(options));
|
options_.addAll(List.of(options));
|
||||||
|
@ -478,7 +474,7 @@ public class CompileKotlinOptions {
|
||||||
* Specify additional compiler options.
|
* Specify additional compiler options.
|
||||||
*
|
*
|
||||||
* @param options list of compiler options
|
* @param options list of compiler options
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions options(Collection<String> options) {
|
public CompileKotlinOptions options(Collection<String> options) {
|
||||||
options_.addAll(options);
|
options_.addAll(options);
|
||||||
|
@ -491,7 +487,7 @@ public class CompileKotlinOptions {
|
||||||
* The location can be a directory, a ZIP, or a JAR file.
|
* The location can be a directory, a ZIP, or a JAR file.
|
||||||
*
|
*
|
||||||
* @param path the location path
|
* @param path the location path
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions path(File path) {
|
public CompileKotlinOptions path(File path) {
|
||||||
path_ = path.getAbsolutePath();
|
path_ = path.getAbsolutePath();
|
||||||
|
@ -504,7 +500,7 @@ public class CompileKotlinOptions {
|
||||||
* The location can be a directory, a ZIP, or a JAR file.
|
* The location can be a directory, a ZIP, or a JAR file.
|
||||||
*
|
*
|
||||||
* @param path the location path
|
* @param path the location path
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions path(String path) {
|
public CompileKotlinOptions path(String path) {
|
||||||
path_ = path;
|
path_ = path;
|
||||||
|
@ -517,6 +513,7 @@ public class CompileKotlinOptions {
|
||||||
* @param id the plugin ID
|
* @param id the plugin ID
|
||||||
* @param optionName the plugin option name
|
* @param optionName the plugin option name
|
||||||
* @param value the plugin option value
|
* @param value the plugin option value
|
||||||
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions plugin(String id, String optionName, String value) {
|
public CompileKotlinOptions plugin(String id, String optionName, String value) {
|
||||||
plugin_.add(id + ':' + optionName + ':' + value);
|
plugin_.add(id + ':' + optionName + ':' + value);
|
||||||
|
@ -527,7 +524,7 @@ public class CompileKotlinOptions {
|
||||||
* Allow using declarations only from the specified version of Kotlin bundled libraries.
|
* Allow using declarations only from the specified version of Kotlin bundled libraries.
|
||||||
*
|
*
|
||||||
* @param progressive {@code true} or {@code false}
|
* @param progressive {@code true} or {@code false}
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions progressive(boolean progressive) {
|
public CompileKotlinOptions progressive(boolean progressive) {
|
||||||
progressive_ = progressive;
|
progressive_ = progressive;
|
||||||
|
@ -540,7 +537,7 @@ public class CompileKotlinOptions {
|
||||||
* Use fully qualified class names.
|
* Use fully qualified class names.
|
||||||
*
|
*
|
||||||
* @param classNames one or more class names
|
* @param classNames one or more class names
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions scriptTemplates(String... classNames) {
|
public CompileKotlinOptions scriptTemplates(String... classNames) {
|
||||||
scriptTemplates_.addAll(List.of(classNames));
|
scriptTemplates_.addAll(List.of(classNames));
|
||||||
|
@ -553,7 +550,7 @@ public class CompileKotlinOptions {
|
||||||
* Use fully qualified class names.
|
* Use fully qualified class names.
|
||||||
*
|
*
|
||||||
* @param classNames the list class names
|
* @param classNames the list class names
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions scriptTemplates(Collection<String> classNames) {
|
public CompileKotlinOptions scriptTemplates(Collection<String> classNames) {
|
||||||
scriptTemplates_.addAll(classNames);
|
scriptTemplates_.addAll(classNames);
|
||||||
|
@ -564,7 +561,7 @@ public class CompileKotlinOptions {
|
||||||
* Enable verbose logging output which includes details of the compilation process.
|
* Enable verbose logging output which includes details of the compilation process.
|
||||||
*
|
*
|
||||||
* @param verbose {@code true} or {@code false}
|
* @param verbose {@code true} or {@code false}
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions verbose(boolean verbose) {
|
public CompileKotlinOptions verbose(boolean verbose) {
|
||||||
verbose_ = verbose;
|
verbose_ = verbose;
|
||||||
|
@ -575,7 +572,7 @@ public class CompileKotlinOptions {
|
||||||
* Turn any warnings into a compilation error.
|
* Turn any warnings into a compilation error.
|
||||||
*
|
*
|
||||||
* @param wError {@code true} or {@code false}
|
* @param wError {@code true} or {@code false}
|
||||||
* @return this class instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public CompileKotlinOptions wError(boolean wError) {
|
public CompileKotlinOptions wError(boolean wError) {
|
||||||
wError_ = wError;
|
wError_ = wError;
|
||||||
|
|
|
@ -271,7 +271,7 @@ public class DokkaOperation extends AbstractProcessOperation<DokkaOperation> {
|
||||||
*
|
*
|
||||||
* @param globalLinks the map of global links
|
* @param globalLinks the map of global links
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
* @see #globalSrcLink(String...)
|
* @see #globalSrcLink(String...) #globalSrcLink(String...)#globalSrcLink(String...)
|
||||||
*/
|
*/
|
||||||
public DokkaOperation globalLinks(Map<String, String> globalLinks) {
|
public DokkaOperation globalLinks(Map<String, String> globalLinks) {
|
||||||
globalLinks_.putAll(globalLinks);
|
globalLinks_.putAll(globalLinks);
|
||||||
|
|
|
@ -35,7 +35,6 @@ import java.util.logging.Logger;
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
||||||
class CompileKotlinOperationTest {
|
class CompileKotlinOperationTest {
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
static void beforeAll() {
|
static void beforeAll() {
|
||||||
var level = Level.ALL;
|
var level = Level.ALL;
|
||||||
|
@ -69,7 +68,6 @@ class CompileKotlinOperationTest {
|
||||||
testJars.add(f.getAbsolutePath());
|
testJars.add(f.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var op = new CompileKotlinOperation()
|
var op = new CompileKotlinOperation()
|
||||||
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example",
|
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example",
|
||||||
"Example"))
|
"Example"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue