Kotlin command-line options

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

Kotlin option Description

-cp <paths> |
-classpath <paths>

Specifies the class path used to analyze Kotlin source code, which is a semicolon- or colon-separated list of directories. You can use OpenText SAST file specifiers as shown in the following example:

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

For information about file specifiers, see "Specifying Files".

Equivalent property name:
com.fortify.sca.JavaClasspath

-source <version>
-jdk <version>

Indicates the JDK version for which the Kotlin code is written. For supported versions, see Supported languagesSee the OpenText™ Application Security 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

Java and Kotlin Properties