api / org.gradle.api.tasks.compile / CompileOptions / getSourcepath

getSourcepath

@Incubating @Optional @PathSensitive(PathSensitivity.RELATIVE) @InputFiles open fun getSourcepath(): FileCollection

The source path to use for the compilation.

The source path indicates the location of source files that may be compiled if necessary. It is effectively a complement to the class path, where the classes to be compiled against are in source form. It does not indicate the actual primary source being compiled.

The source path feature of the Java compiler is rarely needed for modern builds that use dependency management.

The default value for the source path is null, which indicates an empty source path. Note that this is different to the default value for the -sourcepath option for javac, which is to use the value specified by -classpath. If you wish to use any source path, it must be explicitly set.

Return
the source path

See Also
#setSourcepath(FileCollection)