All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.name.remal.gradle_plugins.plugins.generate_sources.BaseGeneratingClassStringWriter.kt Maven / Gradle / Ivy

There is a newer version: 1.9.2
Show newest version
package name.remal.gradle_plugins.plugins.generate_sources

import java.io.File

abstract class BaseGeneratingClassStringWriter>(
    override val packageName: String = "",
    val simpleName: String = "",
    classpath: Iterable = emptyList(),
    protected val wrapDepth: Int = 0
) : GeneratingStringWriter(classpath), GeneratingClassWriterInterface {

    protected abstract val classFileExtension: String

    val relativePath = buildString {
        if (packageName.isNotEmpty()) append(packageName.replace('.', '/')).append('/')
        append(simpleName).append('.').append(classFileExtension)
    }

    protected abstract fun newSubWriter(): Self

    override fun writeBlock(expression: String, blockAction: Self.() -> Unit) = writeBlock(this::newSubWriter, expression, blockAction)

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy