createKotlinFile

fun McProject.createKotlinFile(content: String, sourceSetName: SourceSetName = SourceSetName.MAIN): KotlinFile(source)

Creates a KotlinFile and adds it to the receiver McProject.

Return

the created Kotlin file

Parameters

content

the content of the Kotlin file

sourceSetName

the source set name of the Kotlin file


fun ProjectTestEnvironment.createKotlinFile(content: String, project: McProject = simpleProject(), sourceSetName: SourceSetName = SourceSetName.MAIN, jvmTarget: JvmTarget = JvmTarget.JVM_11): KotlinFile(source)

Creates a KotlinFile and adds it to the specified McProject.

Return

the created Kotlin file

Parameters

content

the content of the Kotlin file

project

the project to which the Kotlin file will be added

sourceSetName

the source set name of the Kotlin file

jvmTarget

the JVM target version for the Kotlin file