createJavaFile

fun McProject.createJavaFile(content: String, sourceSetName: SourceSetName = SourceSetName.MAIN): JavaFile(source)

Creates a JavaFile and adds it to the receiver McProject.

Return

the created Java file

Parameters

content

the content of the Java file

sourceSetName

the source set name of the Java file


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

Creates a JavaFile and adds it to the specified McProject.

Return

the created Java file

Parameters

content

the content of the Java file

project

the project to which the Java file will be added

sourceSetName

the source set name of the Java file

jvmTarget

the JVM target version for the Java file