[Import] Downgrade jvmTarget & move Models and ModelBuilderServices

Fixed KT-35921
Fixed KT-36673
This commit is contained in:
Yaroslav Chernyshev
2020-04-13 19:20:30 +03:00
committed by Yaroslav Chernyshev
parent 385ddba2d9
commit 0b8c497d2e
22 changed files with 373 additions and 315 deletions
+1
View File
@@ -20,6 +20,7 @@ dependencies {
compileOnly(intellijDep())
excludeInAndroidStudio(rootProject) { compileOnly(intellijPluginDep("maven")) }
compileOnly(intellijPluginDep("gradle"))
compileOnly(project(":idea:kotlin-gradle-tooling"))
testRuntime(project(":kotlin-reflect"))
@@ -1 +0,0 @@
org.jetbrains.kotlin.noarg.ide.NoArgModelBuilderService
@@ -1,54 +0,0 @@
/*
* Copyright 2010-2017 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.
*/
package org.jetbrains.kotlin.noarg.ide
import com.intellij.openapi.util.Key
import org.jetbrains.kotlin.annotation.plugin.ide.*
interface NoArgModel : AnnotationBasedPluginModel {
val invokeInitializers: Boolean
override fun dump(): DumpedPluginModel {
return DumpedPluginModelImpl(NoArgModelImpl::class.java, annotations.toList(), presets.toList(), invokeInitializers)
}
}
class NoArgModelImpl(
override val annotations: List<String>,
override val presets: List<String>,
override val invokeInitializers: Boolean
) : NoArgModel
class NoArgModelBuilderService : AnnotationBasedPluginModelBuilderService<NoArgModel>() {
override val gradlePluginNames get() = listOf("org.jetbrains.kotlin.plugin.noarg", "kotlin-noarg")
override val extensionName get() = "noArg"
override val modelClass get() = NoArgModel::class.java
override fun createModel(annotations: List<String>, presets: List<String>, extension: Any?): NoArgModel {
val invokeInitializers = extension?.getFieldValue("invokeInitializers") as? Boolean ?: false
return NoArgModelImpl(annotations, presets, invokeInitializers)
}
}
class NoArgProjectResolverExtension : AnnotationBasedPluginProjectResolverExtension<NoArgModel>() {
companion object {
val KEY = Key<NoArgModel>("NoArgModel")
}
override val modelClass get() = NoArgModel::class.java
override val userDataKey get() = KEY
}
@@ -0,0 +1,29 @@
/*
* Copyright 2010-2017 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.
*/
package org.jetbrains.kotlin.noarg.ide
import com.intellij.openapi.util.Key
import org.jetbrains.kotlin.annotation.plugin.ide.*
class NoArgProjectResolverExtension : AnnotationBasedPluginProjectResolverExtension<NoArgModel>() {
companion object {
val KEY = Key<NoArgModel>("NoArgModel")
}
override val modelClass get() = NoArgModel::class.java
override val userDataKey get() = KEY
}