Make property collection serializable (with runtime check)

This commit is contained in:
Ilya Chernikov
2018-09-06 12:52:50 +02:00
parent ae107339fd
commit ba2e08c014
4 changed files with 25 additions and 8 deletions
@@ -5,6 +5,7 @@
package kotlin.script.experimental.api
import java.io.Serializable
import kotlin.reflect.KClass
import kotlin.reflect.KType
@@ -13,9 +14,9 @@ import kotlin.reflect.KType
*/
class KotlinType private constructor(
val typeName: String,
val fromClass: KClass<*>?
@Transient val fromClass: KClass<*>? = null
// TODO: copy properties from KType
) {
) : Serializable {
/**
* Constructs KotlinType from fully-qualified [qualifiedTypeName] in a dot-separated form, e.g. "org.acme.Outer.Inner"
*/
@@ -7,6 +7,7 @@
package kotlin.script.experimental.api
import java.io.Serializable
import kotlin.reflect.KClass
import kotlin.script.experimental.util.PropertiesCollection
@@ -104,17 +105,17 @@ typealias RefineScriptCompilationConfigurationHandler =
// to make it "hasheable" for cashing
class RefineConfigurationBeforeParsingData(
val handler: RefineScriptCompilationConfigurationHandler
)
) : Serializable
class RefineConfigurationOnAnnotationsData(
val annotations: List<KotlinType>,
val handler: RefineScriptCompilationConfigurationHandler
)
) : Serializable
class RefineConfigurationOnSectionsData(
val sections: List<String>,
val handler: RefineScriptCompilationConfigurationHandler
)
) : Serializable
interface ScriptCompiler {
@@ -7,6 +7,7 @@
package kotlin.script.experimental.api
import java.io.Serializable
import java.net.URL
import kotlin.script.experimental.util.PropertiesCollection
@@ -39,7 +40,7 @@ data class ResolvingRestrictionRule(
}
}
interface ScriptDependency {
interface ScriptDependency : Serializable {
// Q: anything generic here?
}