com.lightningkite.khrysalis.determineTranslatable.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-compiler-plugin-common Show documentation
Show all versions of kotlin-compiler-plugin-common Show documentation
Common translational tools between Typescript and Swift.
The newest version!
package com.lightningkite.khrysalis
import org.jetbrains.kotlin.psi.KtFile
import java.io.File
fun KtFile.shouldBeTranslated(): Boolean {
if(this.packageFqName.asString().contains("shared")) return true
if(this.virtualFilePath.contains(".shared")) return true
if(this.annotationEntries.any { it.shortName?.asString()?.endsWith("SharedCode") == true }) return true
if(this.text.contains("//! This file will translate using Khrysalis.")) return true
return false
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy