ru.pocketbyte.locolaser.kotlinmpp.KotlinCommonResourcesConfig.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resource-kotlin-mpp Show documentation
Show all versions of resource-kotlin-mpp Show documentation
Implementation of platform for LocoLaser tool to work with Kotlin MPP projects.
package ru.pocketbyte.locolaser.kotlinmpp
import ru.pocketbyte.locolaser.config.resources.BaseResourcesConfig
import ru.pocketbyte.locolaser.config.resources.ResourcesConfigBuilderFactory
import ru.pocketbyte.locolaser.kotlinmpp.KotlinBaseResourcesConfig.Companion.DEFAULT_INTERFACE_NAME
import ru.pocketbyte.locolaser.kotlinmpp.KotlinBaseResourcesConfig.Companion.DEFAULT_PACKAGE
import ru.pocketbyte.locolaser.kotlinmpp.resource.KotlinCommonResources
import ru.pocketbyte.locolaser.kotlinmpp.resource.file.provider.KotlinClassResourceFileProvider
import java.io.File
class KotlinCommonResourcesConfig(
workDir: File?,
resourceName: String?,
resourcesDirPath: String?,
filter: ((key: String) -> Boolean)?
) : BaseResourcesConfig(
workDir,
resourceName,
resourcesDirPath,
KotlinClassResourceFileProvider,
filter
) {
companion object : ResourcesConfigBuilderFactory {
const val TYPE = "kotlin-common"
override fun getBuilder(): KotlinCommonResourcesConfigBuilder {
return KotlinCommonResourcesConfigBuilder()
}
}
override val type = TYPE
override val defaultResourcesPath = "./build/generated/src/commonMain/kotlin/"
override val defaultResourceName = "$DEFAULT_PACKAGE.$DEFAULT_INTERFACE_NAME"
override val resources by lazy {
KotlinCommonResources(
dir = this.resourcesDir,
name = this.resourceName,
resourceFileProvider = this.resourceFileProvider,
filter = this.filter
)
}
}