Minor. Move serialization annotation fq-names to IDE light-classes
They are a kind of a hack applied in light-classes and it'd be nice to prevent them being used in irrelevant contexts kotlin-serialization-compiler module should not depend on idea, thus we can't use annotations directly there. So, we copy-paste them and add a test on names consistency
This commit is contained in:
@@ -20,7 +20,7 @@ dependencies {
|
||||
|
||||
sourceSets {
|
||||
"main" { projectDefault() }
|
||||
"test" {}
|
||||
"test" { projectDefault() }
|
||||
}
|
||||
|
||||
runtimeJar()
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
package org.jetbrains.kotlinx.serialization.idea
|
||||
|
||||
import junit.framework.TestCase
|
||||
import org.jetbrains.kotlin.idea.caches.lightClasses.annotations.KOTLINX_SERIALIZABLE_FQ_NAME
|
||||
import org.jetbrains.kotlin.idea.caches.lightClasses.annotations.KOTLINX_SERIALIZER_FQ_NAME
|
||||
import org.jetbrains.kotlinx.serialization.compiler.resolve.SerializationAnnotations
|
||||
|
||||
|
||||
class AnnotationNamesConsistencyTest : TestCase() {
|
||||
fun testConsistency() {
|
||||
assertEquals(KOTLINX_SERIALIZABLE_FQ_NAME, SerializationAnnotations.serializableAnnotationFqName)
|
||||
assertEquals(KOTLINX_SERIALIZER_FQ_NAME, SerializationAnnotations.serializerAnnotationFqName)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user