[K/JS] Prepare JS Plain Objects plugin to publication
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
description = "Kotlin JavaScript Plain Objects Compiler Plugin (CLI)"
|
||||
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly(project(":compiler:util"))
|
||||
compileOnly(project(":compiler:cli"))
|
||||
compileOnly(project(":compiler:plugin-api"))
|
||||
compileOnly(project(":compiler:fir:entrypoint"))
|
||||
compileOnly(project(":compiler:ir.backend.common"))
|
||||
|
||||
implementation(project(":plugins:js-plain-objects:compiler-plugin:js-plain-objects.common"))
|
||||
implementation(project(":plugins:js-plain-objects:compiler-plugin:js-plain-objects.backend"))
|
||||
implementation(project(":plugins:js-plain-objects:compiler-plugin:js-plain-objects.k2"))
|
||||
|
||||
compileOnly(intellijCore())
|
||||
}
|
||||
|
||||
optInToExperimentalCompilerApi()
|
||||
|
||||
sourceSets {
|
||||
"main" { projectDefault() }
|
||||
"test" { none() }
|
||||
}
|
||||
|
||||
runtimeJar()
|
||||
sourcesJar()
|
||||
javadocJar()
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
#
|
||||
# Copyright 2010-2023 JetBrains s.r.o.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
org.jetbrains.kotlinx.jspo.compiler.cli.JsPlainObjectsComponentRegistrar
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 2010-2023 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.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlinx.jspo.compiler.cli
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
|
||||
import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar
|
||||
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||
import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrarAdapter
|
||||
import org.jetbrains.kotlinx.jspo.compiler.backend.JsPlainObjectsLoweringExtension
|
||||
import org.jetbrains.kotlinx.jspo.compiler.fir.JsPlainObjectsExtensionRegistrar
|
||||
|
||||
class JsPlainObjectsComponentRegistrar : CompilerPluginRegistrar() {
|
||||
override val supportsK2: Boolean get() = true
|
||||
|
||||
override fun ExtensionStorage.registerExtensions(configuration: CompilerConfiguration) {
|
||||
Companion.registerExtensions(this)
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun registerExtensions(extensionStorage: ExtensionStorage) = with(extensionStorage) {
|
||||
FirExtensionRegistrarAdapter.registerExtension(JsPlainObjectsExtensionRegistrar())
|
||||
IrGenerationExtension.registerExtension(JsPlainObjectsLoweringExtension())
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user