Interface KotlinProject
- All Superinterfaces:
FileProject,JavaProject,Project
-
Method Summary
Modifier and TypeMethodDescriptiondefault FilesetGenerates Dokka documentation for Kotlin (and Java) sources.default voidRuns a Kotlin program.default FilesetCompiles Kotlin code.default FilekotlincJar(String jarPath, Fileset sources, String... args) Compiles Kotlin code directly to a self-contained.jararchive, bundling the Kotlin runtime with-include-runtime.default FilesetkotlincJava(String path, Fileset kotlinSources, Fileset javaSources, String... args) Compiles mixed Kotlin and Java sources.Methods inherited from interface FileProject
buildPath, buildPath, builtFiles, clean, exec, exec, read, rmdir, sourceFile, sourceFiles, sourcePath, writeMethods inherited from interface JavaProject
classpath, cleanPkgCache, jar, java, javac, javadoc, junit, jUnitLib, packageResolver, pkgCachePath, resolve
-
Method Details
-
kotlin
Runs a Kotlin program.- Parameters:
args- arguments to be supplied to the Kotlin runtime- See Also:
-
kotlinc
Compiles Kotlin code.- Parameters:
path- the directory path for class files, relative toFileProject.buildPath()sources- the source files to compileargs- the command-line options to be passed to the kotlinc compiler- Returns:
- a reference to the compiled
.classfiles - See Also:
-
kotlincJar
Compiles Kotlin code directly to a self-contained.jararchive, bundling the Kotlin runtime with-include-runtime.- Parameters:
jarPath- the location and name of the generated archive, relative toFileProject.buildPath()sources- the source files to compileargs- additional command-line options to be passed to the kotlinc compiler- Returns:
- a reference to the generated archive
- See Also:
-
kotlincJava
default Fileset kotlincJava(String path, Fileset kotlinSources, Fileset javaSources, String... args) Compiles mixed Kotlin and Java sources.Mixed compilation requires two passes:
kotlinccompiles Kotlin sources first with the Java sources provided as context, thenjavaccompiles the Java sources against the Kotlin output. Getting this order wrong produces broken output.- Parameters:
path- the directory path for class files, relative toFileProject.buildPath()kotlinSources- the Kotlin source files to compilejavaSources- the Java source files to compileargs- the command-line options to be passed to both compilers- Returns:
- a reference to all compiled
.classfiles - See Also:
-
dokka
Generates Dokka documentation for Kotlin (and Java) sources.- Parameters:
destination- the path of the generated documentation, relative toFileProject.buildPath()args- the command-line arguments for the Dokka CLI- Returns:
- a reference to the generated documentation
- See Also:
-