[Parcelize] Remove dependency from backend module to k2 module

This is needed to avoid dependencies on FIR classes inside Parcelize IDE
  plugin
This commit is contained in:
Dmitriy Novozhilov
2022-06-08 12:16:14 +03:00
committed by teamcity
parent 021e251143
commit 36a154507e
4 changed files with 5 additions and 6 deletions
@@ -8,7 +8,6 @@ plugins {
dependencies {
implementation(project(":plugins:parcelize:parcelize-compiler:parcelize.common"))
implementation(project(":plugins:parcelize:parcelize-compiler:parcelize.k1"))
implementation(project(":plugins:parcelize:parcelize-compiler:parcelize.k2"))
compileOnly(project(":compiler:backend"))
compileOnly(project(":compiler:ir.backend.common"))
@@ -16,7 +16,7 @@ import org.jetbrains.kotlin.ir.util.functions
import org.jetbrains.kotlin.ir.util.render
import org.jetbrains.kotlin.parcelize.ParcelizeNames.PARCELER_FQN
import org.jetbrains.kotlin.parcelize.ParcelizeSyntheticComponent
import org.jetbrains.kotlin.parcelize.fir.FirParcelizePluginKey
import org.jetbrains.kotlin.parcelize.fir.ParcelizePluginKey
class ParcelizeFirIrTransformer(
context: IrPluginContext,
@@ -47,7 +47,7 @@ class ParcelizeFirIrTransformer(
for (function in declaration.functions) {
val origin = function.origin
if (origin !is GeneratedByPlugin || origin.pluginKey != FirParcelizePluginKey) continue
if (origin !is GeneratedByPlugin || origin.pluginKey != ParcelizePluginKey) continue
when (function.name.identifier) {
ParcelizeSyntheticComponent.ComponentKind.DESCRIBE_CONTENTS.methodName -> {
function.generateDescribeContentsBody(parcelableProperties)
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -7,7 +7,7 @@ package org.jetbrains.kotlin.parcelize.fir
import org.jetbrains.kotlin.GeneratedDeclarationKey
object FirParcelizePluginKey : GeneratedDeclarationKey() {
object ParcelizePluginKey : GeneratedDeclarationKey() {
override fun toString(): String {
return "FirParcelize"
}
@@ -179,7 +179,7 @@ class FirParcelizeDeclarationGenerator(session: FirSession) : FirDeclarationGene
}
private val key: GeneratedDeclarationKey
get() = FirParcelizePluginKey
get() = ParcelizePluginKey
override fun FirDeclarationPredicateRegistrar.registerPredicates() {
register(PREDICATE)