* Such a file can contain compiler options with values and paths to the source files. * Options and paths should be separated by whitespaces. For example: *
* Such a file can contain compiler options with values and paths to the source files. * Options and paths should be separated by whitespaces. For example: *
* Such a file can contain compiler options with values and paths to the source files. * Options and paths should be separated by whitespaces. For example: *
* The classpath can contain file and directory paths, ZIP, or JAR files. * * @param paths one pr more paths * @return this operation instance * @see #classpathStrings(Collection) */ public CompileOptions classpath(String... paths) { return classpathStrings(List.of(paths)); } /** * Search for class files in the specified paths. *
* The classpath can contain file and directory paths, ZIP, or JAR files. * * @param paths one or more path * @return this operation instance * @see #classpath(Collection) */ public CompileOptions classpath(File... paths) { return classpath(List.of(paths)); } /** * Search for class files in the specified paths. *
* The classpath can contain file and directory paths, ZIP, or JAR files. * * @param paths one or more path * @return this operation instance * @see #classpathPaths(Collection) */ public CompileOptions classpath(Path... paths) { return classpathPaths(List.of(paths)); } /** * Search for class files in the specified paths. *
* The classpath can contain file and directory paths, ZIP, or JAR files.
*
* @param paths the search paths
* @return this operation instance
* @see #classpath(File...)
*/
public CompileOptions classpath(Collection
* The classpath can contain file and directory paths, ZIP, or JAR files.
*
* @param paths one pr more paths
* @return this operation instance
* @see #classpath(Path...)
*/
public CompileOptions classpathPaths(Collection
* The classpath can contain file and directory paths, ZIP, or JAR files.
*
* @param paths one pr more paths
* @return this operation instance
* @see #classpath(String...)
*/
public CompileOptions classpathStrings(Collection
* Limit the API of the JDK in the classpath to the specified Java version. Automatically sets
* {@link #jvmTarget(String) JVM target} version.
*
* Possible values are 1.8, 9, 10, ..., 22. The default value is 1.8.
*
* @param version the target version
* @return this operation instance
*/
public CompileOptions jdkRelease(String version) {
jdkRelease_ = version;
return this;
}
/**
* Compile against the specified JDK API version.
*
* Limit the API of the JDK in the classpath to the specified Java version. Automatically sets
* {@link #jvmTarget(String) JVM target} version.
*
* Possible values are 1.8, 9, 10, ..., 22. The default value is 1.8.
*
* @param version the target version
* @return this operation instance
* @see #jdkRelease(String)
*/
public CompileOptions jdkRelease(int version) {
return jdkRelease(String.valueOf(version));
}
/**
* Retrieves the Java Virtual Machine options.
*
* @return the JVM options
*/
public JvmOptions jvmOptions() {
return jvmOptions_;
}
/**
* Pass an option directly to the Java Virtual Machine
*
* @param jvmOptions the JVM options
* @return this operation instance
*/
public CompileOptions jvmOptions(Collection
* Possible values are 1.8, 9, 10, ..., 22. The default value is 1.8.
*
* @param target the target version
* @return this operation instance
*/
public CompileOptions jvmTarget(String target) {
jvmTarget_ = target;
return this;
}
/**
* Retrieves the target version of the generated JVM bytecode.
*
* @return the target version
*/
public String jvmTarget() {
return jvmTarget_;
}
/**
* Specify a custom path to the Kotlin compiler used for the discovery of runtime libraries.
*
* @param path the Kotlin home path
* @return this operation instance
*/
public CompileOptions kotlinHome(File path) {
kotlinHome_ = path;
return this;
}
/**
* Retrieves the custom path of the Kotlin compiler.
*
* @return the Kotlin home path
*/
public File kotlinHome() {
return kotlinHome_;
}
/**
* Specify a custom path to the Kotlin compiler used for the discovery of runtime libraries.
*
* @param path the Kotlin home path
* @return this operation instance
*/
public CompileOptions kotlinHome(Path path) {
return kotlinHome(path.toFile());
}
/**
* Specify a custom path to the Kotlin compiler used for the discovery of runtime libraries.
*
* @param path the Kotlin home path
* @return this operation instance
*/
public CompileOptions kotlinHome(String path) {
return kotlinHome(new File(path));
}
/**
* Provide source compatibility with the specified version of Kotlin.
*
* @param version the language version
* @return this operation instance
*/
public CompileOptions languageVersion(String version) {
languageVersion_ = version;
return this;
}
/**
* Retrieves the {@link #languageVersion(String) language version}.
*
* @return the language version
*/
public String languageVersion() {
return languageVersion_;
}
/**
* Set a custom name for the generated {@code .kotlin_module} file.
*
* @param name the module name
* @return this operation instance
*/
public CompileOptions moduleName(String name) {
moduleName_ = name;
return this;
}
/**
* Retrieves the {@link #moduleName(String) module name}.
*
* @return the module name
*/
public String moduleName() {
return moduleName_;
}
/**
* Don't automatically include the Java runtime into the classpath.
*
* @param noJdk {@code true} or {@code false}
* @return this operation instance
*/
public CompileOptions noJdk(boolean noJdk) {
noJdk_ = noJdk;
return this;
}
/**
* Don't automatically include the Kotlin reflection ({@code kotlin-reflect.jar}) into the classpath.
*
* @param noReflect {@code true} or {@code false}
* @return this operation instance
*/
public CompileOptions noReflect(boolean noReflect) {
noReflect_ = noReflect;
return this;
}
/**
* Don't automatically include the Kotlin/JVM stdlib ({@code kotlin-stdlib.jar}) and Kotlin reflection
* ({@code kotlin-reflect.jar}) into the classpath.
*
* @param noStdLib {@code true} or {@code false}
* @return this operation instance
*/
public CompileOptions noStdLib(boolean noStdLib) {
noStdLib_ = noStdLib;
return this;
}
/**
* Suppress the compiler from displaying warnings during compilation.
*
* @param noWarn {@code true} or {@code false}
* @return this operation instance
*/
public CompileOptions noWarn(boolean noWarn) {
noWarn_ = noWarn;
return this;
}
/**
* 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
* @return this operation instance
*/
public CompileOptions optIn(String... annotations) {
return optIn(List.of(annotations));
}
/**
* Retrieves the opt-in fully qualified names.
*
* @return the fully qualified names
*/
public Collection
* The location can be a directory, a ZIP, or a JAR file.
*
* @param path the location path
* @return this operation instance
*/
public CompileOptions path(File path) {
path_ = path;
return this;
}
/**
* Retrieves the location to place generated class files into.
*
* @return the location path.
*/
public File path() {
return path_;
}
/**
* Place the generated class files into the specified location.
*
* The location can be a directory, a ZIP, or a JAR file.
*
* @param path the location path
* @return this operation instance
*/
public CompileOptions path(Path path) {
return path(path.toFile());
}
/**
* Place the generated class files into the specified location.
*
* The location can be a directory, a ZIP, or a JAR file.
*
* @param path the location path
* @return this operation instance
*/
public CompileOptions path(String path) {
return path(new File(path));
}
/**
* Pass an option to a plugin.
*
* @param id the plugin ID
* @param optionName the plugin option name
* @param value the plugin option value
* @return this operation instance
*/
public CompileOptions plugin(String id, String optionName, String value) {
plugin_.add(id + ':' + optionName + ':' + value);
return this;
}
/**
* Retrieves the plugin options.
*
* @return the plugin options.
*/
public Collection
* Use fully qualified class names.
*
* @param classNames one or more class names
* @return this operation instance
*/
public CompileOptions scriptTemplates(String... classNames) {
return scriptTemplates(List.of(classNames));
}
/**
* Retrieves the script templates.
*
* @return the script templates.
*/
public Collection
* Use fully qualified class names.
*
* @param classNames the class names
* @return this operation instance
*/
public CompileOptions scriptTemplates(Collection