Introduce @ImplicitReflectionSerializer for API which involves reflection.
Set up experimental usage in buildfiles
Add Boolean.Companion.serializer() extension method.
diff --git a/build.gradle b/build.gradle
index d757ea8..b0d2cba 100644
--- a/build.gradle
+++ b/build.gradle
@@ -21,15 +21,22 @@
ext.compilerVersion = property('kotlin.version.snapshot')
ext.librariesVersion = property('kotlin.version.snapshot')
ext.serializationPluginVersion = property('plugin.version.snapshot')
- ext.serializationCoordinates = "org.jetbrains.kotlin:kotlin-serialization"
} else {
ext.compilerVersion = property('kotlin.version')
ext.librariesVersion = property('kotlin.version')
ext.serializationPluginVersion = property('plugin.version')
- ext.serializationCoordinates = "org.jetbrains.kotlin:kotlin-serialization"
}
+ ext.serializationCoordinates = "org.jetbrains.kotlin:kotlin-serialization"
ext.eapChannel = 'https://dl.bintray.com/kotlin/kotlin-eap'
ext.serializationRepo = 'https://kotlin.bintray.com/kotlinx'
+ ext.experimentalsEnabled = ["-Xuse-experimental=kotlin.Experimental",
+ "-Xuse-experimental=kotlin.ExperimentalMultiplatform",
+ ]
+
+ ext.experimentalsInTestEnabled = ["-Xuse-experimental=kotlin.Experimental",
+ "-Xuse-experimental=kotlin.ExperimentalMultiplatform",
+ "-Xuse-experimental=kotlinx.serialization.ImplicitReflectionSerializer",
+ ]
repositories {
jcenter()
@@ -97,6 +104,14 @@
apply plugin: 'kotlinx-serialization'
+ tasks.withType(org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile).all { task ->
+ if (task.name.contains("Test") || task.name.contains("Jmh")) {
+ task.kotlinOptions.freeCompilerArgs += experimentalsInTestEnabled
+ } else {
+ task.kotlinOptions.freeCompilerArgs += experimentalsEnabled
+ }
+ }
+
if (project.name.contains("benchmark")) return
apply plugin: 'maven-publish'