Giter VIP home page Giter VIP logo

intellij-pants-plugin's People

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

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

intellij-pants-plugin's Issues

Show per test debug output like junit debug output

When running tests in IntelliJ using it's default JUnit integration, there are some nice UI features. Each test shows in a tree structure, and the tests are colored green when they pass and red when the fail, etc. Also, there's a nice table element showing the time spent per test, etc.

Pants does have a flag --test-junit-per-test-timer perhaps that could be leveraged?

Launching IntelliJ to use plugin from the command line

It would be easy for users if there was a shortcut to get their project(s) configured in the plugin. I'm thinking of an interface where users could easily create a project from the command line.

./pants idea-plugin foo:: bar:: baz::

This is the way 'idea' works today, but we want the features of the plugin. Maybe the idea-plugin task could write out some kind of config to a file somewhere that the plugin could detect when IntelliJ is launched?

Add missing dependencies to BUILD file using "Add Import"

The plugin configures each target as a module with dependencies.
Due to global classpath, a lot of targets are missing dependencies and hence though pants goal compile works, individual targets do not compile.

The idea is to add an option to add missing dependencies to BUILD file.

Request for Changelog

I like that both Pants and the Plugin are undergoing frequent releases.

I have a request for future changelog entries. When a new version of the plugin is released, it would be nice to be able to see which version of Pants it was tested with when it was released. The plugin has been broken for us for at least a few weeks and I'm not sure which version to tell folks to upgrade to.

Cannot import a Pants project - Resolve error

I'm using the Pants plugin version 1.1.1. When I try to import a Pants project by selecting the root directory (with a BUILD file inside) I got a "Resolve error – Failed to update the project!". Below is my Intellij error log.

2015-02-26 11:56:16,121 [97199434]   INFO - .service.project.PantsResolver - WARNING: Specifying 'goal' explicitly is no longer necessary, and deprecated.

Exit code 1 
2015-02-26 11:56:16,464 [97199777]   WARN - nal.AbstractExternalSystemTask - Failed to update the project! 
com.twitter.intellij.pants.PantsExecutionException: Failed to update the project!
    at com.twitter.intellij.pants.service.project.PantsResolver.resolve(PantsResolver.java:511)
    at com.twitter.intellij.pants.service.project.PantsProjectResolver.resolveUsingPantsGoal(PantsProjectResolver.java:116)
    at com.twitter.intellij.pants.service.project.PantsProjectResolver.resolveProjectInfo(PantsProjectResolver.java:70)
    at com.twitter.intellij.pants.service.project.PantsProjectResolver.resolveProjectInfo(PantsProjectResolver.java:34)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
    at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:51)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:137)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:123)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:477)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3$1.run(ExternalSystemUtil.java:545)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:621)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$7.run(ProgressManagerImpl.java:422)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$3.run(ProgressManagerImpl.java:194)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.a(ProgressManagerImpl.java:281)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:233)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:181)
    at com.intellij.openapi.application.impl.ApplicationImpl$10$1.run(ApplicationImpl.java:641)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:406)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    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:695)
    at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)

Add ability to plugin to import another module to project to existing module using the 'Import Module.

Currently this is not working.

As mentioned by @ericzundel in #5.

I just imported the latest plugin built from HEAD and this is not a problem when I import a plain project.

commit ba6fb87
Author: fkorotkov [email protected]
Date: Wed Sep 24 09:20:31 2014 -0700
However, if I use the 'Import Module...' option and try to add a new module to my existing project I get a problem:

screen shot 2014-09-24 at 10 46 26 am

Here are the contents of idea.log

2014-09-24 10:46:13,184: Checking to see if pants.pex version has changed ...
2014-09-24 10:46:13,199: Checking to see if generated BUILD.* files are outdated in /Users/zundel/Development/java ...
2014-09-24 10:46:14,710: Finish checking BUILD.* health in 1.526 seconds.
(using pantsrc expansion: pants goal depmap --depmap-project-info --depmap-project-info-formatted --depmap-output-file=/private/var/folders/42/8krm7t_50x98_6rxp7p0tv1w000205/T/pants_run6525711466990458330.out --exclude-target-regexp=:aux-)

com.intellij.openapi.externalSystem.model.ExternalSystemException: Failed to update the project!

FAILURE: One or more target addresses are required.

FAILURE

2014-09-24 10:46:13,184: Checking to see if pants.pex version has changed ...
2014-09-24 10:46:13,199: Checking to see if generated BUILD.* files are outdated in /Users/zundel/Development/java ...
2014-09-24 10:46:14,710: Finish checking BUILD.* health in 1.526 seconds.
(using pantsrc expansion: pants goal depmap --depmap-project-info --depmap-project-info-formatted --depmap-output-file=/private/var/folders/42/8krm7t_50x98_6rxp7p0tv1w000205/T/pants_run6525711466990458330.out --exclude-target-regexp=:aux-)

at com.twitter.intellij.pants.service.project.PantsResolver.resolve(PantsResolver.java:336)
at com.twitter.intellij.pants.service.project.PantsProjectResolver.resolveUsingNewAPI(PantsProjectResolver.java:52)
at com.twitter.intellij.pants.service.project.PantsProjectResolver.resolveProjectInfo(PantsProjectResolver.java:36)
at com.twitter.intellij.pants.service.project.PantsProjectResolver.resolveProjectInfo(PantsProjectResolver.java:21)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:48)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:137)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:123)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:406)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3$1.run(ExternalSystemUtil.java:474)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:471)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:281)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
at com.intellij.openapi.application.impl.ApplicationImpl$10$1.run(ApplicationImpl.java:645)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:419)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
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:695)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:149)

Import Project from Pants dialog does not refresh if different BUILD file is selected

I am using the 0.7 version of the plugin.

I brought up the Import Project dialog and selected a BUILD file and got the /Import Project from Pants/ dialog. This BUILD file did not contain the targets I wanted, so I typed in a path to a different dialog. The dialog did not refresh the list of targets in the 'Choose targets: ' field.

screen shot 2014-08-28 at 11 14 45 amI

I also tried using the '...' button to the right of the BUILD file field and the dialog still did not refresh.

I dropped back to the Import Projects dialog:

screen shot 2014-08-28 at 11 17 28 am

and now the dialog corretly shows the 'lib' target that is defined therein.

screen shot 2014-08-28 at 11 18 01 am

Add a build/CI script

The project really ought to be checked by Travis CI. To do so we need a build script. Dogfooding pants is the obvious thing to do here.

User sees different 'run' options in right hand menu.

I don't know if the Pants plugin has anything to do with this.

Here's the menu when right clicking on main():
screenshot1
It says "Run Test lib" which doesn't make a lot of sense. This isn't in a test folder.

Here's what happens when you click on the source tab:
screenshot2
Being able to launch main is what the user expected.

FYI, there is no jvm_binary() defined in a BUILD file for this main.

No Tests run when trying to run a test in the plugin

This is probably due to a non-standard setup we have in Pants, but I wanted to mention it anyway because I spent a good part of last week trying to move us away from this non-standard setup and encountered a lot of friction (there's a mismatch trying to model test-jar relationships and testing semantics in Maven with pants targets.)

We have an overlap in the sources used for a java_library() target and a junit_test() target

junit_tests(name='test',
  # TODO: Ideally, sources between :test,  and :lib should not intersect, but tests in other
  # projects depend on code in '*Test.java'
  sources = rglobs('*Test.java'),
  cwd = 'panhandler',
  dependencies = [
    ':lib'
  ],
)

java_library(name='lib',
  sources = rglobs('*.java'),
  resources = [
    'panhandler/src/test/resources:resources'
  ],
  dependencies=[
    ...
  ]
)

When I run the tests through the IntelliJ UI and choose the Pants icon option I get:

7:27:34 AM: Executing external task 'test --no-test-junit-suppress-output --test-junit-test=com.squareup.foo.types.NumberTest'...
pants test foo/foo-types/src/test/java:lib --no-test-junit-suppress-output --test-junit-test=com.squareup.foo.types.NumberTest --no-color
...
 <no junit_tests execute>

It's choosing the 'java_library()' target over the 'junit_tests()' target, so no tests are actually run. It seems like the information is making into the export format successfully. It would be awesome if the plugin could prefer the target_type = "TEST" in this case:

        "foo/foo-types/src/test/java:test": {
            "is_code_gen": false,
            "excludes": [],
            "target_type": "TEST",
            "libraries": [],
            "pants_target_type": "java_tests",
            "globs": {
                "globs": [
                    "foo/foo-types/src/test/java/**/*Test.java",
                    "foo/foo-types/src/test/java/*Test.java"
                ]
            },
            "targets": [
                "panhandler/panhandler-types/src/test/java:lib"
            ],
            "roots": [
                {
                    "source_root": "/Users/zundel/Development/java/foo/foo-types/src/test/java/com/squareup/foo/types",
                    "package_prefix": "com.squareup.foo.types"
                }
            ]
        },
        "foo/foo-types/src/test/java:lib": {
            "is_code_gen": false,
            "excludes": [],
            "target_type": "SOURCE",
            "libraries": [
               ...
            ],
            "pants_target_type": "java_library",
            "globs": {
                "globs": [
                    "foo/foo-types/src/test/java/**/*.java",
                    "foo/foo-types/src/test/java/*.java"
                ]
            },
            "targets": [
                ...
            ],
            "roots": [
                {
                    "source_root": "/Users/zundel/Development/java/foo/foo-types/src/test/java/com/squareup/foo/types",
                    "package_prefix": "com.squareup.foo.types"
                }
            ]
        },

Note, I could use the non-pants version of running a test, but that is not working well for us for all projects because of the use of AutoValue. By default, IntelliJ doesn't run annotation processors and thus can't resolve the AutoValue generated source files. I've been trying to find solutions for our devs for this.

The plugin has an inspection that assumes Twitter pants.pex deployment conventions

plugin-version: 1.0.0
intellij-version: 13.1.4
os/platform: Linux 3.13.0-36-generic x86_64

  1. Open a BUILD and see 'Pants library not found' yellow error-stripe in BUILD file editor header.
  2. Click 'Fix it' on RHS of stripe.
    Error: 'Couldn't find pants_version in pants.ini'
  3. Added the following to pants.ini
    [DEFAULT] pants_version: 0.0.24
  4. Click 'Fix it' on RHS of stripe.
    Error: 'Couldn't find a folder with pex files!'

These errors occur in the context of an inspection added by the pants plugin, so I was able to just diable the inspection.

It seems though that this inspection is Twitter-specific. OSS pants users are in no-way required to run from a pex and pants_version is not even a config parameter defined by OSS pants.

Looks like, in particular, this code assumes Twitter pants deployment conventions: https://github.com/pantsbuild/intellij-pants-plugin/blob/master/src/com/twitter/intellij/pants/util/PantsUtil.java#L80

Make 'refresh' action more discoverable

Using the 'Refresh all ...' action is very useful. Is there a way we could make it more discoverable in the menus?

As inspiration, In the maven plugin, when you right click on items in the project view, there's a menu item 'Maven' that exposes a bunch of actions:

screen shot 2015-10-20 at 3 49 37 pm

Update .gitignore with files that should be ignored

So, this dovetails with another question, which is do we want the plugin to be "opened" by new users, or imported by them? It seems like importing is the right flow since it will let them set things like Scala's location etc, whereas opening is more dependent on local setup. But I'm not sure how plugins usually handle this.

Add the ability to filter out 'target' directories from Maven

If you have a repo that is configured for both Maven and Pants, the Maven output in

/target/

gets in the way of development. My users have asked me to exclude the 'target' folders from the view.

The exact algorithm should be that if a file named 'pom.xml' exists in a directory in the repo, the 'target' folder in that same directory should be excluded from IntelliJ's view.

I've proposed a patch for this for pants goal idea, at https://rbcommons.com/s/twitter/r/1017/ but at this point we aren't sure if its going to be accepted.

Scala is assumed to be installed in a twitter-specific location

I just opened the current project, looks like it assumes that scala is at /opt/twitter/Cellar/scala/2.10.3/, which a) assumes 2.10.3 and b) fixes the definition.

Is this just a case of a file accidentally getting checked in, or do we need to change this? Ideally it would use the wizard that Fedor set up.

running a test causes full compile of all loaded modules

If I right click on a directory to run all tests in the directory, it seems to do a full pants compile on all modules currently loaded into the project, instead of only running pants on the selected module. Thus we lose the ability to only build the dependencies of the module requested, before running tests.

Stray output from `pants goal depmap <target> --depmap-project-info` breaks plugin

I am using plugin version 0.7.

When I try to import my target /foo/bar:lib from the import dialog, I get an error dialog with the following message:

Can't parse output
 [ INFO ] Checking to see if pants.pex version has changed ...java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 3
Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 3

Consult IDE log for more details (Help | Show Log)

I think what’s going on here is that the script ‘pants’ in the root of the repo is a wrapper script that we have customized here at square with some extra logic. Your plugin is interpreting some of our additional console output as JSON. My understanding is that ./pants is “supposed” to be customized with logic to determine how to get the latest pex or whatever.

Possible fixes off the top of my head:

  • The plugin should be invoking ./pants.pex,
  • The plugin could pass a special —quiet flag or something to the script to tell it to suppress output
  • pants goal depmap could be enhanced with an additional flag could be passed so that the json could be written to a filename passed on the command line and the data slurped up by the plugin from there.

Of those suggestions, I favor the last idea because you can implement it no matter what customization folks perform to the pants wrapper script. Let me know if you want my assistance adding that to Pants.

The full trace from idea.log:

2014-08-13 14:04:52,191 [  49300]   INFO - indexing.UnindexedFilesUpdater - Indexable files iterated in 4 ms 
2014-08-13 14:04:52,191 [  49300]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 0 files to update 
2014-08-13 14:04:52,191 [  49300]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update done in 0 ms 
2014-08-13 14:04:58,263 [  55372]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/codeStyleSettings.xml file is null 
2014-08-13 14:04:58,264 [  55373]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/projectCodeStyle.xml file is null 
2014-08-13 14:04:58,658 [  55767]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/IntelliLang.xml file is null 
2014-08-13 14:04:58,952 [  56061]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/intentionSettings.xml file is null 
2014-08-13 14:04:59,850 [  56959]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/checker.xml file is null 
2014-08-13 14:05:01,426 [  58535]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $APP_CONFIG$/dataSources.xml file is null 
2014-08-13 14:05:01,428 [  58537]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/dataSources.xml file is null 
2014-08-13 14:05:01,430 [  58539]   INFO - s.impl.stores.FileBasedStorage - Document was not loaded for $PROJECT_CONFIG_DIR$/sqlDataSources.xml file is null 
2014-08-13 14:05:12,710 [  69819]   INFO - indexing.UnindexedFilesUpdater - Indexable files iterated in 522 ms 
2014-08-13 14:05:12,710 [  69819]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 40157 files to update 
2014-08-13 14:05:19,923 [  77032]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update done in 7213 ms 
2014-08-13 14:05:20,233 [  77342]   INFO - indexing.UnindexedFilesUpdater - Indexable files iterated in 310 ms 
2014-08-13 14:05:20,234 [  77343]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update started: 0 files to update 
2014-08-13 14:05:20,234 [  77343]   INFO - indexing.UnindexedFilesUpdater - Unindexed files update done in 0 ms 
2014-08-13 14:06:49,071 [ 166180]   WARN - nal.AbstractExternalSystemTask - Can't parse output
 [ INFO ] Checking to see if pants.pex version has changed ...java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 3
Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 3 
com.intellij.openapi.externalSystem.model.ExternalSystemException: Can't parse output
 [ INFO ] Checking to see if pants.pex version has changed ...java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 3
Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 3
    at com.twitter.intellij.pants.service.project.PantsResolver.parse(PantsResolver.java:71)
    at com.twitter.intellij.pants.service.project.PantsResolverBase.parse(PantsResolverBase.java:60)
    at com.twitter.intellij.pants.service.project.PantsResolverBase.resolve(PantsResolverBase.java:48)
    at com.twitter.intellij.pants.service.project.PantsProjectResolver.resolveUsingNewAPI(PantsProjectResolver.java:48)
    at com.twitter.intellij.pants.service.project.PantsProjectResolver.resolveProjectInfo(PantsProjectResolver.java:32)
    at com.twitter.intellij.pants.service.project.PantsProjectResolver.resolveProjectInfo(PantsProjectResolver.java:20)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
    at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:48)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:137)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:123)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:406)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3$1.run(ExternalSystemUtil.java:474)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:471)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:281)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
    at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
    at com.intellij.openapi.application.impl.ApplicationImpl$10$1.run(ApplicationImpl.java:645)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:419)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    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:695)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:149)
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 3
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176)
    at com.google.gson.Gson.fromJson(Gson.java:803)
    at com.google.gson.Gson.fromJson(Gson.java:768)
    at com.google.gson.Gson.fromJson(Gson.java:717)
    at com.google.gson.Gson.fromJson(Gson.java:689)
    at com.twitter.intellij.pants.service.project.PantsResolver.parseProjectInfoFromJSON(PantsResolver.java:36)
    at com.twitter.intellij.pants.service.project.PantsResolver.parse(PantsResolver.java:68)
    at com.twitter.intellij.pants.service.project.PantsResolverBase.parse(PantsResolverBase.java:60)
    at com.twitter.intellij.pants.service.project.PantsResolverBase.resolve(PantsResolverBase.java:48)
    at com.twitter.intellij.pants.service.project.PantsProjectResolver.resolveUsingNewAPI(PantsProjectResolver.java:48)
    at com.twitter.intellij.pants.service.project.PantsProjectResolver.resolveProjectInfo(PantsProjectResolver.java:32)
    at com.twitter.intellij.pants.service.project.PantsProjectResolver.resolveProjectInfo(PantsProjectResolver.java:20)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
    at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:48)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:137)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:123)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:406)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3$1.run(ExternalSystemUtil.java:474)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:471)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:281)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
    at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
    at com.intellij.openapi.application.impl.ApplicationImpl$10$1.run(ApplicationImpl.java:645)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:419)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    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:695)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:149)
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 3
    at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:374)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:165)
    ... 36 more

2014-08-13 14:06:49,073 [ 166182]   WARN - ctExternalProjectImportBuilder - com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 3
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176)
    at com.google.gson.Gson.fromJson(Gson.java:803)
    at com.google.gson.Gson.fromJson(Gson.java:768)
    at com.google.gson.Gson.fromJson(Gson.java:717)
    at com.google.gson.Gson.fromJson(Gson.java:689)
    at com.twitter.intellij.pants.service.project.PantsResolver.parseProjectInfoFromJSON(PantsResolver.java:36)
    at com.twitter.intellij.pants.service.project.PantsResolver.parse(PantsResolver.java:68)
    at com.twitter.intellij.pants.service.project.PantsResolverBase.parse(PantsResolverBase.java:60)
    at com.twitter.intellij.pants.service.project.PantsResolverBase.resolve(PantsResolverBase.java:48)
    at com.twitter.intellij.pants.service.project.PantsProjectResolver.resolveUsingNewAPI(PantsProjectResolver.java:48)
    at com.twitter.intellij.pants.service.project.PantsProjectResolver.resolveProjectInfo(PantsProjectResolver.java:32)
    at com.twitter.intellij.pants.service.project.PantsProjectResolver.resolveProjectInfo(PantsProjectResolver.java:20)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
    at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49)
    at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:48)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:137)
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:123)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$2.execute(ExternalSystemUtil.java:406)
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3$1.run(ExternalSystemUtil.java:474)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$TaskRunnable.run(ProgressManagerImpl.java:471)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$6.run(ProgressManagerImpl.java:281)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:178)
    at com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress(ProgressManager.java:209)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:212)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:171)
    at com.intellij.openapi.application.impl.ApplicationImpl$10$1.run(ApplicationImpl.java:645)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:419)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    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:695)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:149)
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 3
    at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:374)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:165)
    ... 36 more
​```

Can not get to work plugin in idea 13.1 ultimate (and CE)

After installing plugin, my pants targets in BUILD files are not getting resolved.
Platform: Mac OS X Mavericks
IDE: Intellij IDEA 13.1 Ultimete (and CE)
Followed https://www.youtube.com/watch?v=mIr9BAi-1s4 steps to configure.

Exact steps to reproduce.

  1. git clone https://github.com/pantsbuild/pants.git
  2. cp /some/dir/pants/pants.ini to src/my/java/files
  3. Copy other fires to the point I can work fine with pants from command line.
  4. ./pants goal idea src/my/files:target
  5. In Idea, installing Pants Support 0.7 ( I tried 0.1 too)
  6. After restart I get the message "Pants library not found". Clicked "Fix it"

Expected result: It gets resolved automatically
Actual result: "Error: pants version not found in pants.ini"

  1. Manually specifying version (the latest is 0.0.23 that is different from the one in video)
  2. Click "Fix it"

Expected result: It gets resolved automatically
Actual result: "Error: Couldn't find a folder with pex files!"

  1. Adding pants.pex manually to class path (as library)

Expected result: Pants Support configures project.Targets in BUILD files get resolved
Actual result: No further support messages. Targets are not getting resolved.

I can see inconsistencies, e.g. in video there is 0.0.83 version of pants and I get the 0.0.23 as latest.
But just want to confirm that this is the source of trouble (meaning "Pants Support" plugin itself is ahead of the open sourced pants), otherwise I would appreciate the direction I could dig to get everything to work.

Thank you in advance.

Tests fails after opening project in IDEA

I got actual version of this plugin. At first time command ./scripts/run-tests-ci.sh worked fine, but after opening plugin sources in IDEA, tests fails. There are 2 errors:

testMissingDepsWhiteList(com.twitter.intellij.pants.highlighting.PantsUnresolvedJavaReferenceQuickFixProviderTest)
java.lang.AssertionError: null
at com.intellij.testFramework.LoggedErrorProcessor.processError(LoggedErrorProcessor.java:56)
at com.intellij.testFramework.TestLogger.error(TestLogger.java:67)

  1. testMissingDepsWhiteList(com.twitter.intellij.pants.highlighting.PantsUnresolvedScalaReferenceQuickFixProviderTest)
    java.lang.AssertionError: null
    at com.intellij.testFramework.LoggedErrorProcessor.processError(LoggedErrorProcessor.java:56)
    at com.intellij.testFramework.TestLogger.error(TestLogger.java:67)
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:134)

I reset ("git reset --hard") sources, closed IDEA, reboot my OS, but that errors remains. How to resolve this issue? I can't test my changes for this plugin.

Some of my targets in the JSON output are not loaded in to the plugin

This may be hard to reproduce.

I am using a version of pants from HEAD as of October 6 and the 1.0.0 Pants Support plugin from the public repository.

I'm encountering an issue where I import a project by using the Plugin and my test targets are not getting loaded into the IDE.

I imported the project by selecting the 'instruments' directory entry.

I ran the command ./pants goal depmap instruments/:: --depmap-project-info --depmap-output-file=/tmp/instruments.json

In the output I see the test target and source roots listed:

... <snip> ...
 "instruments/src/test/java:test": {
            "libraries": [],
            "is_code_gen": false,
            "targets": [
                "instruments/src/test/java:lib"
            ],
            "roots": [
                {
                    "source_root": "/Users/zundel/Development/java/instruments/src/test/java/com/squareup/instruments/persistence/jooq",
                    "package_prefix": "com.squareup.instruments.persistence.jooq"
                },
                {
                    "source_root": "/Users/zundel/Development/java/instruments/src/test/java/com/squareup/instruments/testing",
                    "package_prefix": "com.squareup.instruments.testing"
                },
                {
                    "source_root": "/Users/zundel/Development/java/instruments/src/test/java/com/squareup/instruments/domain",
                    "package_prefix": "com.squareup.instruments.domain"
                },
                {
                    "source_root": "/Users/zundel/Development/java/instruments/src/test/java/com/squareup/instruments",
                    "package_prefix": "com.squareup.instruments"
                },
                {
                    "source_root": "/Users/zundel/Development/java/instruments/src/test/java/com/squareup/instruments/feeds",
                    "package_prefix": "com.squareup.instruments.feeds"
                },
                {
                    "source_root": "/Users/zundel/Development/java/instruments/src/test/java/com/squareup/instruments/actions/common",
                    "package_prefix": "com.squareup.instruments.actions.common"
                },
                {
                    "source_root": "/Users/zundel/Development/java/instruments/src/test/java/com/squareup/instruments/actions",
                    "package_prefix": "com.squareup.instruments.actions"
                }
            ],
            "target_type": "TEST"
        },
... <snip> ...

but those folders aren't showing up as test or source roots in the IDE Project View.

screen shot 2014-10-08 at 11 07 06 am

Preconfigure JDK

We shouldn't ask a user to configure an SDK we already have this information.

Stopping a running app in debugger, doesn't kill the app

I set up a run config in IntelliJ, which runs a pants target correctly, within the debugger. It's a long-running server (not a unit test). Normally, to stop running such an app in the debugger, I can hit the red square Stop icon. However, in this case, it only seems to disconnect the debugger from the window, but doesn't actually stop the app, nor the underlying python processes that call 'pants run'. So, the next time I try to run the app in the debugger, I get a 'port address already in use', since the previous invocation is actually still running.

Better testing of PantsOutputMessage

Right now we have just a few tests for parsing in PantsFilterTest.

First of all we should rename PantsFilterTest to PantsOutputMessageTest and add more tests. Ideally we should write an integration test in case Pants output will be changed. But just reading an output from a file line by line and asserting some output messages should be good enough.

Also we need to investigate which types of messages Pants provides during compilation of both java and scala targets. Is there a difference? Is the format of messages the same for warnings and errors? etc.

Enhance the plugin to respect jvm-platform settings for each target

At square we have targets that set the platform= value on different java_library targets. We would like to see the different IJ modules respect the respective settings for Java target and source levels.

I updated the export format to include the jvm_platform information in the json output in this change to pants:

commit 86603cd99d557e57c3d8798264d88e4217d3e26a
Author: Eric Ayers <[email protected]>
Date:   Tue Sep 8 16:48:48 2015 -0400

    Add distributions and platforms into the export format.  Bumps the export version to 1.0.3

    Also:
    - Converts a few instances of set() to  OrderedSet() in order to maintain consistent results in the list of libraries in the export format (for testing purposes.)
    - Refactors jvm_platform a bit so that the string "by default" doesn't creep into the exported data.

    Testing Done:
    Updated unit test and integration test for export
    CI passed at https://travis-ci.org/pantsbuild/pants/builds/79298776

    Manual inspection of `./pants export examples/src/java/org/pantsbuild/example/hello/simple` and targets in the Square repo.

    Documentation changes can be previewed at http://pantsbuild.github.io/staging/zundel/export.html

    Bugs closed: 2153

    Reviewed at https://rbcommons.com/s/twitter/r/2784/

Provide Scala info from the goal

We should add an additional field to all infos about Scala related targets with the scala info.

See org.jetbrains.plugins.scala.config.ScalaFacet to figure what the plugin needs to configure a Scala facet.

BUILD files with a suffix are not considered by the import dialog

Using the 0.7 version of the plugin:

In our repo here at Square, we use BUILD files with suffixes in their name:

BUILD
BUILD.gen
BUILD.aux

The import dialog does not consider targets in names with a suffix.

For background, we use the suffix of the BUILD file name to indicate that it is automatically generated. Files named 'BUILD' are hand maintained, the latter two are generated by a script that uses maven pom.xml files as the source for dependencies. Right now, there are only about 35 build files out of over 2000 that we have to maintain by hand.

The pattern we match is here: https://github.com/pantsbuild/pants/blob/master/src/python/pants/base/build_file.py#L27
Basically BUILD or BUILD.*

Error from plugin: Invalid file

When importing a new project, (I'm importing by selecting a directory, not a BUILD file) I'm getting the following error:

Invalid file: file:///Users/zundel/Development/java/.git/MERGE_RR
java.lang.Throwable
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:113)
    at com.intellij.psi.impl.file.impl.FileManagerImpl.findFile(FileManagerImpl.java:323)
    at com.intellij.psi.impl.PsiManagerImpl.findFile(PsiManagerImpl.java:188)
    at com.twitter.intellij.pants.projectview.VirtualFileTreeNode.update(VirtualFileTreeNode.java:60)
    at com.intellij.ide.util.treeView.PresentableNodeDescriptor.getUpdatedPresentation(PresentableNodeDescriptor.java:88)
    at com.intellij.ide.util.treeView.PresentableNodeDescriptor.update(PresentableNodeDescriptor.java:41)
    at com.intellij.ide.util.treeView.AbstractTreeBuilder.updateNodeDescriptor(AbstractTreeBuilder.java:594)
    at com.intellij.ide.util.treeView.AbstractTreeUi$21.run(AbstractTreeUi.java:940)
    at com.intellij.ide.util.treeView.AbstractTreeUi.execute(AbstractTreeUi.java:1826)
    at com.intellij.ide.util.treeView.AbstractTreeUi.update(AbstractTreeUi.java:936)
    at com.intellij.ide.util.treeView.AbstractTreeUi.update(AbstractTreeUi.java:888)
    at com.intellij.ide.util.treeView.AbstractTreeUi.processExistingNode(AbstractTreeUi.java:3008)
    at com.intellij.ide.util.treeView.AbstractTreeUi.access$4900(AbstractTreeUi.java:61)
    at com.intellij.ide.util.treeView.AbstractTreeUi$32$1.run(AbstractTreeUi.java:1724)
    at com.intellij.ide.util.treeView.AbstractTreeUi$34.run(AbstractTreeUi.java:1814)
    at com.intellij.ide.util.treeView.AbstractTreeUi.execute(AbstractTreeUi.java:1826)
    at com.intellij.ide.util.treeView.AbstractTreeUi.execute(AbstractTreeUi.java:1811)
    at com.intellij.ide.util.treeView.AbstractTreeUi.access$5200(AbstractTreeUi.java:61)
    at com.intellij.ide.util.treeView.AbstractTreeUi$33.run(AbstractTreeUi.java:1779)
    at com.intellij.ide.util.treeView.AbstractTreeUi.executeYieldingRequest(AbstractTreeUi.java:2087)
    at com.intellij.ide.util.treeView.AbstractTreeUi.access$5800(AbstractTreeUi.java:61)
    at com.intellij.ide.util.treeView.AbstractTreeUi$37$1.run(AbstractTreeUi.java:1979)
    at com.intellij.ide.util.treeView.AbstractTreeBuilder.runOnYeildingDone(AbstractTreeBuilder.java:439)
    at com.intellij.ide.util.treeView.AbstractTreeUi.runOnYieldingDone(AbstractTreeUi.java:2182)
    at com.intellij.ide.util.treeView.AbstractTreeUi$37.run(AbstractTreeUi.java:1974)
    at com.intellij.ide.util.treeView.AbstractTreeBuilder$1.process(AbstractTreeBuilder.java:53)
    at com.intellij.ide.util.treeView.AbstractTreeBuilder$1.process(AbstractTreeBuilder.java:50)
    at com.intellij.util.containers.TransferToEDTQueue.processNext(TransferToEDTQueue.java:96)
    at com.intellij.util.containers.TransferToEDTQueue.access$300(TransferToEDTQueue.java:34)
    at com.intellij.util.containers.TransferToEDTQueue$1.run(TransferToEDTQueue.java:55)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
    at java.awt.EventQueue.access$400(EventQueue.java:82)
    at java.awt.EventQueue$2.run(EventQueue.java:676)
    at java.awt.EventQueue$2.run(EventQueue.java:674)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
    at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:697)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

otherwise, the plugin seems to be working OK from what I can tell.

Errors are displayed as information in the Messages window

I'm using version 1.1.1 distributed through IntelliJ (not a local build)

I see that IntelliJ now delegates to pants for compilation, hooray!

However, errors are now marked as "Information:" in the messages windows. I've lost the ability to click and navigate to the source code on errors.

Here's a screen shot:

screen shot 2015-02-19 at 2 34 51 pm

Here's a snippet of text copied and pasted.

Information:pants: Invalidated 2 targets containing 2 payload files.
Information:pants: Compiling a partition containing 13 sources in 2 targets (partition 1 of 1).
Information:pants: 14:34:38 00:06         [compile]
Information:pants: 14:34:38 00:06           [jmake]
Information:pants: Jmake version 1.3.8-9
Information:pants: [31m/Users/zundel/Development/java/.pants.d/gen/protoc/gen-java/com/squareup/protos/geocoding/Service.java:2705: error: package com.squareup.protos.common.location.Location does not exist
Information:pants: private com.squareup.protos.common.location.Location.Coordinates coordinates_;
Information:pants: ^
Information:pants: [m�[31m/Users/zundel/Development/java/.pants.d/gen/protoc/gen-java/com/squareup/protos/geocoding/Service.java:2723: error: package com.squareup.protos.common.location.Location does not exist
Information:pants: public com.squareup.protos.common.location.Location.Coordinates getCoordinates() {
Information:pants: [m�[31m/Users/zundel/Development/java/.pants.d/gen/protoc/gen-java/com/squareup/protos/geocoding/Service.java:2733: error: package com.squareup.protos.common.location.Location does not exist
Information:pants: public com.squareup.protos.common.location.Location.CoordinatesOrBuilder getCoordinatesOrBuilder() {
Information:pants: [m�[31m/Users/zundel/Development/java/.pants.d/gen/protoc/gen-java/com/squareup/protos/geocoding/Service.java:3145: error: package com.squareup.protos.common.location.Location does not exist

Cannot import anything from /Users/zundel/Development/java/foo/server/BUILD

I am using the 0.7 version of the Pants Support IntelliJ plugin

I have the following BUILD file under foo/server/BUILD.

jvm_binary(name='server',
  main = 'com.squareup.foo.FooApp',
  basename= 'foo-server',
  #source = 'src/main/java/com/squareup/foo/FooServerApp.java',
  dependencies = [
    ':lib'
  ],
)

target(name='lib',
  dependencies = [
    'foo/server/src/main/java:lib'
  ],
)

target(name='test',
  dependencies = [
    'foo/server/src/test/java:test'
  ],
)

This repo uses maven layout, so the actual sources are under foo/server/src/main/java/.... foo/server/BUILD delegates to other targets in BUILD files under foo/server/... I routinely use the 'server' target to compile and bundle as follows:

./pants goal bundle foo/server

But when I point the IntelliJ import dialog at this BUILD file it cannot find any targets to import:

screen shot 2014-08-28 at 11 11 26 am

My guess is that the plugin needs to consider 'JarDependency' type of targets with aliases 'target' or 'dependencies'

IntelliJ locking up when importing a new project

I'm seeing IntelliJ 14.1.3 with the Plugin version 1.3.4 on my MacBook pro running MacOS 10.0 lock up and take 100% cpu when using the Plugin for IntelliJ. This is right after importing a new project using Pants to import a directory. I've seen this a few times now, so I sat down to do some diagnosis.

At this point I don't think its 100% locked up, but running very slowly.
screen shot 2015-08-29 at 11 35 03 am

The reason I say its running slowly is that it did finally finish the opening dialogs and now shows the project tree

Top shows the idea process eating CPU

screen shot 2015-08-29 at 11 34 50 am

screen shot 2015-08-29 at 11 45 25 am

When running 'jstack' I see this stacktrace running (I took 4 dumps over a period of about 10 minutes and it was always there)

"ApplicationImpl pooled thread 10" #57 prio=4 os_prio=31 tid=0x0000000102e69000 nid=0x7a13 runnable [0x0000000135a9a000]
   java.lang.Thread.State: RUNNABLE
        at java.util.HashMap.resize(HashMap.java:734)
        at java.util.HashMap.putVal(HashMap.java:662)
        at java.util.HashMap.put(HashMap.java:611)
        at java.util.HashSet.add(HashSet.java:219)
        at java.util.AbstractCollection.addAll(AbstractCollection.java:344)
        at com.intellij.openapi.roots.impl.RootIndex.a(RootIndex.java:233)
        at com.intellij.openapi.roots.impl.RootIndex.a(RootIndex.java:214)
        at com.intellij.openapi.roots.impl.RootIndex.getOrderEntries(RootIndex.java:618)
        at com.intellij.openapi.roots.impl.DirectoryIndexImpl.getOrderEntries(DirectoryIndexImpl.java:192)
        at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getOrderEntriesForFile(ProjectFileIndexImpl.java:112)
        at com.jetbrains.python.psi.impl.PythonLanguageLevelPusher.findSdk(PythonLanguageLevelPusher.java:129)
        at com.jetbrains.python.psi.impl.PythonLanguageLevelPusher.getFileSdk(PythonLanguageLevelPusher.java:123)
        at com.jetbrains.python.psi.impl.PythonLanguageLevelPusher.getFileLanguageLevel(PythonLanguageLevelPusher.java:110)
        at com.jetbrains.python.psi.impl.PythonLanguageLevelPusher.getImmediateValue(PythonLanguageLevelPusher.java:102)
        at com.jetbrains.python.psi.impl.PythonLanguageLevelPusher.getImmediateValue(PythonLanguageLevelPusher.java:65)
        at com.intellij.openapi.roots.impl.PushedFilePropertiesUpdaterImpl.a(PushedFilePropertiesUpdaterImpl.java:218)
        at com.intellij.openapi.roots.impl.PushedFilePropertiesUpdaterImpl.findAndUpdateValue(PushedFilePropertiesUpdaterImpl.java:318)
        at com.intellij.openapi.roots.impl.PushedFilePropertiesUpdaterImpl.b(PushedFilePropertiesUpdaterImpl.java:307)
        at com.intellij.openapi.roots.impl.PushedFilePropertiesUpdaterImpl.access$1000(PushedFilePropertiesUpdaterImpl.java:63)
        at com.intellij.openapi.roots.impl.PushedFilePropertiesUpdaterImpl$11.run(PushedFilePropertiesUpdaterImpl.java:293)
        at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:872)
        at com.intellij.openapi.roots.impl.PushedFilePropertiesUpdaterImpl.a(PushedFilePropertiesUpdaterImpl.java:288)
        at com.intellij.openapi.roots.impl.PushedFilePropertiesUpdaterImpl.access$700(PushedFilePropertiesUpdaterImpl.java:63)
        at com.intellij.openapi.roots.impl.PushedFilePropertiesUpdaterImpl$10$1$1.processFile(PushedFilePropertiesUpdaterImpl.java:275)
        at com.intellij.openapi.vfs.VfsUtilCore$1.visitFileEx(VfsUtilCore.java:252)
        at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:267)
        at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:299)
        at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:299)
        at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:299)
        at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:299)
        at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:299)
        at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:299)
        at com.intellij.openapi.vfs.VfsUtilCore.visitChildrenRecursively(VfsUtilCore.java:299)
        at com.intellij.openapi.vfs.VfsUtilCore.iterateChildrenRecursively(VfsUtilCore.java:247)
        at com.intellij.openapi.roots.impl.ModuleFileIndexImpl.iterateContent(ModuleFileIndexImpl.java:56)
        at com.intellij.openapi.roots.impl.PushedFilePropertiesUpdaterImpl$10$1.run(PushedFilePropertiesUpdaterImpl.java:272)
        at com.intellij.openapi.roots.impl.PushedFilePropertiesUpdaterImpl.a(PushedFilePropertiesUpdaterImpl.java:283)
        at com.intellij.openapi.roots.impl.PushedFilePropertiesUpdaterImpl.pushAllPropertiesNow(PushedFilePropertiesUpdaterImpl.java:153)
        at com.intellij.util.indexing.UnindexedFilesUpdater.a(UnindexedFilesUpdater.java:64)
        at com.intellij.util.indexing.UnindexedFilesUpdater.performInDumbMode(UnindexedFilesUpdater.java:114)
        at com.intellij.openapi.project.DumbServiceImpl$8.run(DumbServiceImpl.java:416)
        at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:152)
        at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:452)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
  at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
        at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:137)
        at com.intellij.openapi.project.DumbServiceImpl.a(DumbServiceImpl.java:407)
        at com.intellij.openapi.project.DumbServiceImpl.access$1100(DumbServiceImpl.java:52)
        at com.intellij.openapi.project.DumbServiceImpl$7.run(DumbServiceImpl.java:389)
        at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
        at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:152)
        at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:452)
        at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:402)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
        at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:137)
        at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:126)
        at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:400)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
        at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:56)

The heap seems OK to me (lots of free space)

cat /tmp/heap-26389.out 
Attaching to process ID 26389, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.45-b02

using parallel threads in the new generation.
using thread-local object allocation.
Concurrent Mark-Sweep GC

Heap Configuration:
   MinHeapFreeRatio         = 40
   MaxHeapFreeRatio         = 70
   MaxHeapSize              = 4294967296 (4096.0MB)
   NewSize                  = 697892864 (665.5625MB)
   MaxNewSize               = 697892864 (665.5625MB)
   OldSize                  = 1449590784 (1382.4375MB)
   NewRatio                 = 2
   SurvivorRatio            = 8
   MetaspaceSize            = 21807104 (20.796875MB)
   CompressedClassSpaceSize = 1073741824 (1024.0MB)
   MaxMetaspaceSize         = 17592186044415 MB
   G1HeapRegionSize         = 0 (0.0MB)

Heap Usage:
New Generation (Eden + 1 Survivor Space):
   capacity = 628162560 (599.0625MB)
   used     = 87528152 (83.47335052490234MB)
   free     = 540634408 (515.5891494750977MB)
   13.933996957730177% used
Eden Space:
   capacity = 558432256 (532.5625MB)
   used     = 53194504 (50.73023223876953MB)
   free     = 505237752 (481.83226776123047MB)
   9.525686138015638% used
From Space:
   capacity = 69730304 (66.5MB)
   used     = 34333648 (32.74311828613281MB)
   free     = 35396656 (33.75688171386719MB)
   49.23777185884634% used
To Space:
   capacity = 69730304 (66.5MB)
   used     = 0 (0.0MB)
   free     = 69730304 (66.5MB)
   0.0% used
concurrent mark-sweep generation:
   capacity = 1449590784 (1382.4375MB)
   used     = 7714773562038266448 (7.3573814030058545E12MB)
   free     = 10234804642792 MB
   5.32203546489867E11% used

74479 interned Strings occupying 8069856 bytes.

I eventually killed the idea process and restarted intelliJ. It came back up and now I can see the project.

Add or Handle java->scala dependency cycle in plugin.

Idea does not deal well with cyclic dependency. We added some checks to plugin code to make sure, while determining common source roots, we do not introduce any cyclic dependency.

However, some scala targets which own java sources have cyclic dependencies in build file.

At twitter,
util/util-core/src/main/scala has util/util-core/src/main/java as java_sources.
util/util-core/src/main/java has a dependency on util/util-core/src/main/scala.

During testing, i saw,
https://rbcommons.com/s/twitter/r/1111/ avoids cyclic dependencies between modules however in this case module util/util-core/src/main/java cannot be compiled due to missing dependency.
Due to this fix, the required cyclic dependency chain is broken.

Maven output gets in the way when loading project in Pants

We have the ability to compile both in Maven and in Pants in our repo. When I user compiles with Maven, it leaves output in .../target/... directories all over the repo. These directories contain stale class output and generated sources. In this screen shot, you can see multiple versions of LoggedInUsers.java. The one from 'target' is stale.

screen shot 2015-04-28 at 8 36 39 am

When we create a project using the idea goal, we are using a feature that will filter out these files:

  --[no-]idea-exclude-maven-target
  --[no-]exclude-maven-target
                          Exclude 'target' directories for directories
                          containing pom.xml files. These directories contain
                          generated code and copies of files staged for
                          deployment. (default: True)

I'm wondering if there is a way to get this functionality in the plugin.

After adding a module, new sub-directories don't get incorporated

If I add a module using the pants plugin in IntelliJ, all the java sources are included in the source path for the project. The files are syntax highlighted, the parent directories have colored icons indicating if they are sources or test packages, and the folder names that contain files have bolded sub module names in square brackets, etc.....

However, if I now want to add a new package sub-directory, containing sources, I can't get IntelliJ to view it as part of the project, and have it be viewed as java sources with syntax highlighting, etc.

Cancelling a failing import doesn't seem to do anything

Plugin version: 1.1.2
IntelliJ version: 14.0.3
Pants version: square-20150331-02 https://github.com/square/pants/releases/tag/square-20150331-02

I was trying to reproduce an issue from a developer. I tried importing a new project then went away from my laptop during the 'resolve' phase. After 10 minutes it seemed stuck, so I hit the 'cancel' button. Nothing changed on the UI and the process still seems to be running.

./pants compile multipass::
2015-04-28 07:22:23,011: Regenerated BUILD files in 4.232 seconds.
Running Pants version square-20150331-02
INFO] Detected git repository at /Users/zundel/Development/java on branch master

07:22:24 00:00 [main]
               (To run a reporting server: ./pants server)
07:22:24 00:00   [bootstrap]
07:22:25 00:01   [setup]
07:22:25 00:01     [parse]
               Executing tasks in goals: bootstrap -> imports -> unpack-jars -> deferred-sources -> gen -> resolve -> compile
Waiting on pants process 29260 (/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python /Users/zundel/.cache/pants/bin/pants/pants-square-20150331-02.pex goal resolve BUILD:) to complete

screen shot 2015-04-28 at 7 19 45 am

From the command line,

$ kill -TERM 29260

Make the process running on behalf of IntelliJ exit.

Make extensions of generated files configurable

Currently we auto refresh the project on changes in Thrift, Antlr or Protobuf files. We should make it configurable or provide this info from the goal.

see com.twitter.intellij.pants.util.PantsUtil#isGeneratableFile

Run tests for a directory

In IntelliJ, the junit test runner allows running all tests within a directory or a package (you can do this by right clicking in the file tree view at some point in the directory structure). However, with the pants plugin, it seems I can only run a test this way if I right click over a particular file. I am using version 1.3.5 of the plugin (in IntelliJ 14.1.4).

Auto Import support

We need to suggest to refresh the project once BUILD or Thrift files were changed.

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.