Giter Site home page Giter Site logo

jetbrains / gradle-intellij-plugin Goto Github PK

View Code? Open in Web Editor NEW
1.4K 78.0 270.0 12.01 MB

Gradle plugin for building plugins for IntelliJ-based IDEs

Home Page: https://plugins.jetbrains.com/docs/intellij/gradle-prerequisites.html

License: Apache License 2.0

Kotlin 99.16% Java 0.84%
intellij gradle gradle-intellij-plugin intellij-platform jetbrains-plugin intellij-plugin plugin-verifier intellij-ides intellij-sdk

gradle-intellij-plugin's Introduction

official JetBrains project Gradle Plugin Portal Build Status TeamCity Build Status X Follow Slack

IntelliJ Platform Gradle Plugin IntelliJ Platform Gradle Plugin

The IntelliJ Platform Gradle Plugin is a plugin for the Gradle build system to help configure your environment for building, testing, verifying, and publishing plugins for IntelliJ-based IDEs.

Documentation

The documentation of the IntelliJ Platform Gradle Plugin has moved to the IntelliJ Platform Plugin SDK Documentation: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html

Installation

To install the IntelliJ Platform Gradle Plugin in your project, follow the Usage section of the plugin documentation. There's also a Snapshot Release available built nightly from the main branch containing the always-latest version of the plugin.

Changelog

All releases are available in the Releases section. The latest available version is:

Gradle Plugin Portal

Contributing

Please see CONTRIBUTING on how to submit feedback and contribute to this project.

License

Licensed under the Apache License, Version 2.0 (the "License"), see LICENCE.

gradle-intellij-plugin's People

Contributors

3flex avatar actions-user avatar arostovsky avatar artspb avatar asemy avatar chashnikov avatar da1z avatar dependabot[bot] avatar fornever avatar henryju avatar hsz avatar idegtiarenko avatar izhangzhihao avatar jeppeman avatar karollewandowski avatar martinbonnin avatar matklad avatar mfilippov avatar nizienko avatar novotnyr avatar piotrtomiak avatar raniejade avatar shalupov avatar stephan-gh avatar turansky avatar turbo87 avatar twisterrob avatar vladrassokhin avatar yanncebron avatar zolotov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gradle-intellij-plugin's Issues

IU evaluation period not reset after deleting sandbox

I think I've read somewhere that deleting the sandbox should reset the evaluation period of IntelliJ Ultimate. It seems to partly work as the splash screen is actually showing a new date 30 days in the future, but once the application started it complains that the evaluation period has expired and quits immediately.

This is not a big issue since I have an open source license for IU, but it is certainly annoying having to enter the activation code over and over again after removing the sandbox for other reasons.

"Used by" section for the Readme file

Exclude kotlin-runtime from the dependencies loaded from IDEA lib directory

If a plugin is built with Kotlin, it usually uses its own Kotlin runtime library, specified as a separate dependency in build.gradle. This dependency may conflict with the Kotlin runtime which is bundled with IDEA and shipped in the 'lib' directory, so there should be an option to exclude the bundled Kotlin runtime from the classpath.

NPE while composing UI elements

I have code in constructor of a class that implements JPanel that calls add(topLevelPanel, BorderLayout.CENTER); There is associated IDEA form class too.

It fails with the following error:

[  41285]  ERROR - plication.impl.ApplicationImpl - null
java.lang.NullPointerException
        at java.awt.Container.addImpl(Container.java:1090)
        at java.awt.Container.add(Container.java:966)

IDEA 13.1.6, Java 1.6

The same code worked fine then build using IDE.

Disable automatic update check

Unless you're using a "latest" version it doesn't make much sense to have the IDE tell you about new updates all the time. I'm not sure if and how it could work, but I assume the setting if the IDE should check for updates is saved somewhere in the sandbox so it should be possible for this plugin to disable the update check by default.

Cannot debug the instance started with runIdea

I am starting Gradle with debug parameters and getting Listening for transport dt_socket at address: 5005 message, but I cannot stop at breakpoints inside the IDEA instance started with runIdea

What is the recommended way to debug plugins?

v0.0.34 fails on Java 8

* What went wrong:
A problem occurred configuring root project 'intellij-rust'.
> Could not create task of type 'RunIdeaTask'.

Caused by: java.lang.NoClassDefFoundError: java/util/HashMap$Entry
    at org.jetbrains.intellij.RunIdeaTask$1.$getStaticMetaClass(RunIdeaTask.groovy)
    at org.jetbrains.intellij.RunIdeaTask$1.<init>(RunIdeaTask.groovy)
    at org.jetbrains.intellij.RunIdeaTask.<init>(RunIdeaTask.groovy:11)
    at org.jetbrains.intellij.RunIdeaTask_Decorated.<init>(Unknown Source)
    at org.gradle.api.internal.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:48)

This occured on the intellij-rust project with 0.0.34 of this plugin (see intellij-rust/intellij-rust#179). Using 0.0.33 it seems to work fine. intellij-rust is compiling and running Gradle with Java 8.

I'm using 0.0.34 without any issues on intellij-emberjs but with Java 7 instead.

[Fatal Error] updates.xml:1:1: Premature end of file.

The error is printed during :prepareSandbox

The updates.xml itself looks ok and has the following content:

<application>
  <component name="UpdatesConfigurable">
    <option name="CHECK_NEEDED" value="false"/>
  </component>
</application> 

Nevertheless the build finishes successfully.

Environment:
org.jetbrains.intellij" version "0.0.35"
Java 6
IntelliJ IDE 13

How to make IntelliJ import such Gradle project as PLUGIN_MODULE

I have converted my plugin to use a Gradle build + this plugin. In my company we don't push IDE specific metadata into the SCM so I was trying to clone from scratch.

The problem is when I import such project into IntelliJ it is considered as JAVA_MODULE. What should I do to have it considered as PLUGIN_MODULE?

Is there no way to make IntelliJ "know" this is a plugin project? Maybe we would need a dedicated IntelliJ plugin similar to https://plugins.jetbrains.com/plugin/7127?pr=?

Publish without password in project file

The publish task looks great - thanks! :)
If possible I would like to have my gradle file in vcs but not the password. Is there any way to ask on the command line for the password or to read it from an env variable or a file?
This would be safer :)

List of available version

Is there somewhere a list of all versions that can be used?
I just tried for example version IC-14.0.4 which seems to be not available.

Unable to add a dependency on Maven plugin

Hi have added:

intellij {
    version '14.1.4'
    plugins 'maven'
}

in my build.gradle but when I run ./gradlew buildPlugin I get:

error: package org.jetbrains.idea.maven.project does not exist
16:06:33.370 [ERROR] [system.err] import org.jetbrains.idea.maven.project.MavenProject;

How can I investigate the issue?

XML Serialization related JDK resources missing from test classpath when plugin is included

When I include this plugin I get some unexpected test failures.

I've created a sample project to show the issue:
https://github.com/patflynn/gradle-intellij-plugin-classpath-bug

running gradlew test will cause:
java.lang.ExceptionInInitializerError
at TestRtClasspath.testToXMLStreamOnClassPath(TestRtClasspath.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:86)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:49)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:64)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:360)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: The resource [ com.sun.org.apache.xml.internal.serializer.XMLEntities ] could not load: java.lang.RuntimeException: The resource [ com.sun.org.apache.xml.internal.serializer.XMLEntities ] could not be found.
com.sun.org.apache.xml.internal.serializer.XMLEntities
com.sun.org.apache.xml.internal.serializer.XMLEntities java.lang.RuntimeException: The resource [ com.sun.org.apache.xml.internal.serializer.XMLEntities ] could not be found.
com.sun.org.apache.xml.internal.serializer.XMLEntities
at com.sun.org.apache.xml.internal.serializer.CharInfo.(CharInfo.java:291)
at com.sun.org.apache.xml.internal.serializer.CharInfo.(CharInfo.java:51)
at com.sun.org.apache.xml.internal.serializer.CharInfo$1.run(CharInfo.java:470)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.org.apache.xml.internal.serializer.CharInfo.getCharInfoBasedOnPrivilege(CharInfo.java:467)
at com.sun.org.apache.xml.internal.serializer.CharInfo.getCharInfo(CharInfo.java:529)
at com.sun.org.apache.xml.internal.serializer.ToXMLStream.(ToXMLStream.java:55)
... 44 more

TestRtClasspath > testToXMLStreamOnClassPath FAILED
java.lang.ExceptionInInitializerError at TestRtClasspath.java:10
Caused by: java.lang.RuntimeException at TestRtClasspath.java:10

If you remove the:
plugins {
id "org.jetbrains.intellij" version "0.0.27"
}

declaration then the test passes.

IC sources not attached for IU classes

I'm using this plugin with the IU version because I depend on the Javascript plugin. The IU jar files are included when I open the project in IntelliJ, but the IC source files that get downloaded alongside the IU classes are not attached properly. Whenever I refresh the Gradle model I have to attach the sources manually, which quickly gets annoying. It would be awesome if there was a way in which the plugin would handle this for me.

`runIdea` task no longer runs

I'm getting the following output on v0.0.29:

$ ./gradlew runIdea
:compileKotlin UP-TO-DATE
:compileJava UP-TO-DATE
:processResources
:classes
:patchPluginXml
:prepareSandbox UP-TO-DATE
:runIdea UP-TO-DATE

BUILD SUCCESSFUL

Total time: 1.62 secs

It seems that Gradle always marks the runIdea task as UP-TO-DATE, even if I change some of the source files.

Adjust log levels

It looks like IntelliJ is using log4j internally for logging and it would probably make sense to reuse it for logging in the plugins too. What I haven't been able to figure out though is how to adjust/set the log level for my plugin.

At the moment only warn() and error() actually print something to the console, but during development I would like to enable info() and debug() for my plugin classes too.

Is there a way to do this manually and if so, could you add some sort of option for that in the plugin too?

"idea.classpath.index.enabled" should be false in tests

idea.classpath.index.enabled is set to false in RunIdea task:
https://github.com/JetBrains/gradle-intellij-plugin/blob/master/src/main/groovy/org/jetbrains/intellij/RunIdeaTask.groovy#L45

However, for the test task it is true. The effect is that if I add a new class and run gradlew test, tests fail with NoClassDefFoundError. I can work around it by manually defining the property in the test task, but ideally the gradle plugin should do this automatically, or at least provide a method like setupSystemProperties.

P.S. I am new to gradle so this may be irrelevant, however I do receive NoClassDefFoundError in tests due to classpath.index

Can't create new task based on RunIdeaTask

I'm trying to debug a JPS plugin that's used in an IntelliJ plugin. To do this, I must provide the JVM argument -Dcompiler.process.debug.port=5005 to the IntelliJ process. This causes IntelliJ to wait for a debugger to connect to port 5005. I can do this:

afterEvaluate {
    tasks.getByName('runIdea') {
        jvmArgs += "-Dcompiler.process.debug.port=5005"
    }
}

But I want to do this in a separate task only, so I can still use runIdea without having to connect a debugger. So I tried this instead:

task("debugIdea", type: org.jetbrains.intellij.RunIdeaTask) {
    jvmArgs = ["-Dcompiler.process.debug.port=5005"]
}

But then I get an error about redefining runIdea, even though I'm naming it debugIdea.

Cannot add task ':runIdea' as a task with that name already exists.

How can I keep runIdea as is, but create a new task debugIdea with the JVM arguments I want?

Attach IDEA sources

It would be really nice to navigate to IDEA CE sources from plugin sources.

It's possible it would require some IDEA modifications, so better to investigate it early.

Not clear error about missing plugin.xml

The plugin expects the plugin.xml file to be located in src\main\resources directory and complains if it is not there.
However IntelliJ by default creates the file under root folder of project. I also was unable to find any documentation where the plugin expects to find the plugin.xml file.
I know that it is Gradle methodology to put any resource files under src\main\resources, but IntelliJ does not use it by default and I was not sure if my project will work correctly in IntelliJ if I move the file.

Error:(2, 0) Cannot add extension with name 'idea', as there is an extension already registered with that name.

I could not use your plugin:

Error:(2, 0) Cannot add extension with name 'idea', as there is an extension already registered with that name.

changing constants in org.jetbrains.intellij.IntelliJPlugin to

private static final CONFIGURATION_NAME = "ideaplus"
private static final EXTENSION_NAME = "ideaplus"

solved this problem (or is it just a symptom?)

I'm a bloody beginner to gradle, groovy and java at all. I wan't just to write a simple idea-plugin for PhpStorm and integrate it in travis-CI. Maybe you can provide some help for me?

"Class to bind does not exist" warnings during compileTestJava execution

I am getting the error for all *.form files in my project during compileTestJava execution.
It is apparently comes from com.intellij.ant.Javac2 and looks like the following: [ant:instrumentIdeaExtensions] C:\IntelliJ-plugin\src\main\java\com\foo\Bar.form: Class to bind does not exist: com.foo.Bar

Environment:
org.jetbrains.intellij" version "0.0.35"
Java 6
IntelliJ IDE 13

Support multi-plugin project

There is a workaround for that: use the same sandbox directory in each module and make :prepareSandbox tasks depend on each other. But this way requires a lot of non-obvious configuration. There should be a way to do it easier.

Support running single test

Hi,

Gradle supports running a single test like this:

  • specific class:
./gradlew cleanTest test --tests com.goide.inspections.GoHighlightingTest
  • specific test method:
./gradlew cleanTest test --tests com.goide.inspections.GoHighlightingTest.testSimple

Is there anyway for the plugin to override the test running functionality of the IDE when the project is managed via Gradle so that this functionality can be used? Right now the IDE will try it to run in a classic way and it makes running / debugging a single a bit inconvenient.

And I guess since the IDE doesn't recognize that the project is managed with Gradle it doesn't allow UI interaction such as running / debugging a test from the test UI, no?

Thank you.

Test events were not received

Hi, from time to time the Gradle doesn't seem to want to run the tests. Restarting IDEA seems to do the trick and tests are running again. I've checked the logs and nothing there and I'm not sure if the screenshot will help either (I'm running the Go plugin test suite, to be sure there's no confusion).
snapshot146

Please let me know if I can help out with anything else.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.