Optional dependency on Gradle configured

This commit is contained in:
Andrey Breslav
2013-08-08 16:15:16 +04:00
committed by Natalia.Ukhorskaya
parent 96fd0862f0
commit a71e8f8695
5 changed files with 90 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
<component name="libraryTable">
<library name="gradle-and-groovy-plugin">
<CLASSES>
<root url="file://$PROJECT_DIR$/ideaSDK/plugins/gradle/lib" />
<root url="file://$PROJECT_DIR$/ideaSDK/plugins/Groovy/lib" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$PROJECT_DIR$/ideaSDK/plugins/gradle/lib" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.zip!/plugins/gradle/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.zip!/plugins/gradle/testSources" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.zip!/plugins/groovy/rt/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.zip!/plugins/groovy/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.zip!/plugins/groovy/test" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.zip!/plugins/groovy/hotswap/agentSrc" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.zip!/plugins/groovy/resources" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.zip!/plugins/groovy/jps-plugin/src" />
<root url="jar://$PROJECT_DIR$/ideaSDK/sources/sources.zip!/plugins/groovy/rt-constants/src" />
</SOURCES>
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/plugins/gradle/lib" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/plugins/Groovy/lib" recursive="false" />
<jarDirectory url="file://$PROJECT_DIR$/ideaSDK/plugins/gradle/lib" recursive="false" type="SOURCES" />
</library>
</component>
+1
View File
@@ -37,6 +37,7 @@
<orderEntry type="library" scope="PROVIDED" name="properties" level="project" />
<orderEntry type="library" scope="PROVIDED" name="java-i18n" level="project" />
<orderEntry type="library" name="kotlin-runtime" level="project" />
<orderEntry type="library" scope="PROVIDED" name="gradle-and-groovy-plugin" level="project" />
<orderEntry type="module" module-name="serialization" />
<orderEntry type="module" module-name="serialization.java" />
<orderEntry type="module" module-name="descriptor.loader.java" />
+5
View File
@@ -0,0 +1,5 @@
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<editorNotificationProvider implementation="org.jetbrains.jet.plugin.quickfix.ConfigureAndroidGradleProjectNotification"/>
</extensions>
</idea-plugin>
+1
View File
@@ -9,6 +9,7 @@
<idea-version since-build="132.27" until-build="133.0"/>
<depends optional="true" config-file="junit.xml">JUnit</depends>
<depends optional="true" config-file="gradle.xml">JUnit</depends>
<depends optional="true" config-file="testng-j.xml">TestNG-J</depends>
<depends optional="true" config-file="kotlin-copyright.xml">com.intellij.copyright</depends>
<depends optional="true" config-file="javaScriptDebug.xml">JavaScriptDebugger</depends>
@@ -0,0 +1,59 @@
/*
* Copyright 2010-2013 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.jet.plugin.quickfix;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiManager;
import com.intellij.ui.EditorNotificationPanel;
import com.intellij.ui.EditorNotifications;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.groovy.GroovyFileType;
import org.jetbrains.plugins.groovy.lang.psi.GroovyFile;
public class ConfigureAndroidGradleProjectNotification extends EditorNotifications.Provider<EditorNotificationPanel> {
private static final Key<EditorNotificationPanel> KEY = Key.create("kotlin.configure.android.gradle.project");
private final Project project;
public ConfigureAndroidGradleProjectNotification(Project project) {
this.project = project;
}
@Override
@Nullable
public EditorNotificationPanel createNotificationPanel(@NotNull VirtualFile file, @NotNull FileEditor fileEditor) {
if (file.getFileType() != GroovyFileType.GROOVY_FILE_TYPE) return null;
if (!"gradle".equals(file.getExtension())) return null;
PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
if (!(psiFile instanceof GroovyFile)) return null;
GroovyFile groovyFile = (GroovyFile) psiFile;
throw new UnsupportedOperationException();
}
@Override
public Key<EditorNotificationPanel> getKey() {
return KEY;
}
}