ru.pocketbyte.locolaser.kotlinmpp.resource.KotlinAbsImplementationResources.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.
The newest version!
package ru.pocketbyte.locolaser.kotlinmpp.resource
import ru.pocketbyte.locolaser.config.resources.ResourceFileProvider
import ru.pocketbyte.locolaser.config.resources.filter.ResourcesFilter
import java.io.File
abstract class KotlinAbsImplementationResources(
dir: File,
name: String,
interfaceName: String?,
resourceFileProvider: ResourceFileProvider,
filter: ResourcesFilter?
) : KotlinAbsResources(dir, name, resourceFileProvider, filter) {
val interfaceName: String?
val interfacePackage: String?
init {
if (interfaceName != null) {
val lastSegmentIndex = interfaceName.lastIndexOf(".")
if (lastSegmentIndex <= 0)
throw IllegalArgumentException("Invalid interface name: $interfaceName")
this.interfaceName = interfaceName.substring(lastSegmentIndex + 1)
this.interfacePackage = interfaceName.substring(0, lastSegmentIndex)
} else {
this.interfaceName = null
this.interfacePackage = null
}
}
}