Kotlin Command-Line Options

The following table describes the Kotlin-specific command-line options.

Kotlin Option Description

-cp <paths> |
-classpath <dirs>

Specifies the class path to use for translating Kotlin source code, which is a semicolon- or colon-separated list of directories. You can use Fortify Static Code Analyzer file specifiers as shown in the following example:

-cp "build/classes:lib/*.jar"

For information about file specifiers, see Specifying Files and Directories.

Equivalent Property Name:
com.fortify.sca.JavaClasspath

-source <version>
-jdk <version>

Indicates the JDK version for which the Kotlin code is written. See the Fortify Software System Requirements document for supported versions. The default is version 11.

Equivalent Property Name:
com.fortify.sca.JdkVersion

-sourcepath <dirs>

Specifies a semicolon- or colon-separated list of directories that contain Java source code that is not included in the scan but is used for name resolution. The source path is similar to class path, except it uses source files instead of class files for resolution. Only source files that are referenced by the target file list are translated.

Equivalent Property Name:
com.fortify.sca.JavaSourcePath

-jvm-default <mode>

Specifies the generation of the DefaultImpls class for methods with bodies in Kotlin interfaces. The valid values for <mode> are:

  • disable—Specifies to generate the DefaultImpls class for each interface that contains methods with bodies.

  • all—Specifies to generate the DefaultImpls class if an interface is annotated with @JvmDefaultWithCompatibility.

  • all-compatibility—Specifies to generate the DefaultImpls class unless an interface is annotated with @JvmDefaultWithoutCompatibility.

Equivalent Property Name:
com.fortify.sca.KotlinJvmDefault

See Also

Java and Kotlin Properties