Interface KotlinCompilation
-
- All Implemented Interfaces:
-
org.gradle.api.Named
,org.gradle.api.attributes.HasAttributes
,org.jetbrains.kotlin.gradle.plugin.HasKotlinDependencies
,org.jetbrains.kotlin.gradle.plugin.HasProject
,org.jetbrains.kotlin.tooling.core.HasExtras
,org.jetbrains.kotlin.tooling.core.HasMutableExtras
public interface KotlinCompilation<T extends KotlinCommonOptions> implements Named, HasProject, HasMutableExtras, HasAttributes, HasKotlinDependencies
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
KotlinCompilation.Companion
-
Method Summary
-
Methods inherited from class org.gradle.api.attributes.HasAttributes
getAttributes
-
Methods inherited from class org.jetbrains.kotlin.gradle.plugin.HasKotlinDependencies
dependencies, dependencies, getApiConfigurationName, getCompileOnlyConfigurationName, getImplementationConfigurationName, getRuntimeOnlyConfigurationName
-
Methods inherited from class org.jetbrains.kotlin.gradle.plugin.HasProject
getProject
-
Methods inherited from class org.jetbrains.kotlin.tooling.core.HasMutableExtras
getExtras
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
defaultSourceSet
abstract Unit defaultSourceSet(Function1<KotlinSourceSet, Unit> configure)
-
defaultSourceSet
Unit defaultSourceSet(Action<KotlinSourceSet> configure)
-
compilerOptions
Unit compilerOptions(Function1<KotlinCommonCompilerOptions, Unit> configure)
-
compilerOptions
Unit compilerOptions(Action<KotlinCommonCompilerOptions> configure)
-
kotlinOptions
Unit kotlinOptions(Function1<T, Unit> configure)
-
kotlinOptions
Unit kotlinOptions(Action<T> configure)
-
attributes
Unit attributes(Function1<AttributeContainer, Unit> configure)
-
attributes
Unit attributes(Action<AttributeContainer> configure)
-
source
abstract Unit source(KotlinSourceSet sourceSet)
Will add a KotlinSourceSet directly into this compilation. This method is deprecated and targets Kotlin 2.0 for its removal. After Kotlin 2.0 there will be exactly one SourceSet associated with a given Kotlin Compilation.
In order to include other sources into the compilation, please build a hierarchy of Source Sets instead. See: KotlinSourceSet.dependsOn or KotlinTargetHierarchyDsl. This approach is most applicable if
The sources can be shared for multiple compilations
The sources shall be analyzed in a different context than defaultSourceSet
The project uses multiplatform and sources shall provide expects
Alternatively, when just including source files from another directory, the SourceDirectorySet from the defaultSourceSet can be used. This approach is most applicable if
sources are not intended to be shared across multiple compilations
sources shall be analyzed in the same context as other sources in the defaultSourceSet
kotlin { val compilation = target.compilations.getByName("main") val utilsSourceSet = sourceSets.create("utils") compilation.defaultSourceSet.dependsOn(utilsSourceSet) }
kotlin { val compilation = target.compilations.getByName("main") compilation.defaultSourceSet.kotlin.srcDir("src/utils/kotlin") }
Further details: https://kotl.in/compilation-source-deprecation
-
associateWith
abstract Unit associateWith(KotlinCompilation<?> other)
-
getTarget
abstract KotlinTarget getTarget()
-
getCompilationName
abstract String getCompilationName()
-
getKotlinSourceSets
abstract Set<KotlinSourceSet> getKotlinSourceSets()
-
getAllKotlinSourceSets
abstract Set<KotlinSourceSet> getAllKotlinSourceSets()
-
getDefaultSourceSetName
String getDefaultSourceSetName()
-
getDefaultSourceSet
abstract KotlinSourceSet getDefaultSourceSet()
-
getCompileDependencyConfigurationName
abstract String getCompileDependencyConfigurationName()
-
getCompileDependencyFiles
abstract FileCollection getCompileDependencyFiles()
-
setCompileDependencyFiles
abstract Unit setCompileDependencyFiles(FileCollection compileDependencyFiles)
-
getRuntimeDependencyConfigurationName
abstract String getRuntimeDependencyConfigurationName()
-
getRuntimeDependencyFiles
abstract FileCollection getRuntimeDependencyFiles()
-
getOutput
abstract KotlinCompilationOutput getOutput()
-
getPlatformType
KotlinPlatformType getPlatformType()
-
getCompileKotlinTaskName
abstract String getCompileKotlinTaskName()
-
getCompilerOptions
abstract HasCompilerOptions<?> getCompilerOptions()
-
getCompileKotlinTask
abstract KotlinCompile<T> getCompileKotlinTask()
-
getCompileKotlinTaskProvider
abstract TaskProvider<out KotlinCompile<T>> getCompileKotlinTaskProvider()
-
getCompileTaskProvider
abstract TaskProvider<out KotlinCompilationTask<?>> getCompileTaskProvider()
-
getKotlinOptions
abstract T getKotlinOptions()
-
getCompileAllTaskName
abstract String getCompileAllTaskName()
-
getAssociateWith
List<KotlinCompilation<?>> getAssociateWith()
-
getAssociatedCompilations
abstract Set<KotlinCompilation<?>> getAssociatedCompilations()
All compilations previously associated using associateWith
e.g. 'test' compilations will return 'setOf(main)' by default
-
getAllAssociatedCompilations
abstract Set<KotlinCompilation<?>> getAllAssociatedCompilations()
Full transitive closure of associatedCompilations
-
getDisambiguatedName
String getDisambiguatedName()
-
-
-
-