[IDEA plugin for K/N] Source code reorganization

Move Gradle part of plugin from 'idea-gradle/native' to
'idea-gradle-native' module
This commit is contained in:
Dmitriy Dolovov
2018-09-05 12:35:34 +03:00
committed by Mikhail Glukhikh
parent f6c61fbe30
commit 04fca2ac0d
6 changed files with 2 additions and 2 deletions
+35
View File
@@ -0,0 +1,35 @@
plugins {
kotlin("jvm")
id("jps-compatible")
}
dependencies {
compile(project(":konan:konan-serializer"))
// compile("org.jetbrains.kotlin:kotlin-native-gradle-plugin")
compileOnly(project(":idea:idea-gradle"))
compileOnly(project(":idea:idea-native"))
compileOnly(project(":idea")) { isTransitive = false }
compileOnly(project(":idea:idea-jvm"))
compile(project(":idea:kotlin-gradle-tooling"))
compile(project(":compiler:frontend"))
compile(project(":compiler:frontend.java"))
compile(project(":compiler:frontend.script"))
compile(project(":js:js.frontend"))
compileOnly(intellijDep())
compileOnly(intellijPluginDep("gradle"))
compileOnly(intellijPluginDep("Groovy"))
compileOnly(intellijPluginDep("junit"))
}
sourceSets {
"main" { projectDefault() }
"test" { none() }
}
configureInstrumentation()
@@ -0,0 +1,14 @@
/*
* 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.konan.gradle
import com.intellij.openapi.project.Project
import org.jetbrains.konan.settings.KonanModelProvider
import java.nio.file.Path
class GradleKonanModelProvider : KonanModelProvider {
override fun getKonanHome(project: Project): Path? = null
}
@@ -0,0 +1,17 @@
/*
* 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.konan.gradle
import com.intellij.openapi.project.Project
import org.jetbrains.konan.settings.KonanProjectComponent
import org.jetbrains.plugins.gradle.settings.GradleSettings
class GradleKonanProjectComponent(project: Project) : KonanProjectComponent(project) {
override fun looksLikeKotlinNativeProject(): Boolean {
//TODO not just any gradle project
return GradleSettings.getInstance(project).linkedProjectsSettings.isNotEmpty()
}
}
@@ -0,0 +1,33 @@
/*
* 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.konan.gradle.internal;
import com.intellij.codeInspection.LocalInspectionEP;
import com.intellij.openapi.components.ApplicationComponent;
import com.intellij.openapi.extensions.ExtensionPoint;
import com.intellij.openapi.extensions.Extensions;
public class KotlinNativeIdeInitializer implements ApplicationComponent {
@Override
public void initComponent() {
unregisterGroovyInspections();
}
// There are groovy local inspections which should not be loaded w/o groovy plugin enabled.
// Those plugin definitions should become optional and dependant on groovy plugin.
// This is a temp workaround before it happens.
private static void unregisterGroovyInspections() {
ExtensionPoint<LocalInspectionEP> extensionPoint =
Extensions.getRootArea().getExtensionPoint(LocalInspectionEP.LOCAL_INSPECTION);
for (LocalInspectionEP ep : extensionPoint.getExtensions()) {
if ("Kotlin".equals(ep.groupDisplayName) && "Groovy".equals(ep.language)) {
extensionPoint.unregisterExtension(ep);
}
}
}
}