Is there post-build event in IntelliJ IDEA? - intellij-idea

Is there post-build event in IntelliJ IDEA (11 in my case) ? Oddly I couldn't find it via googling.
I want to perform binary enhancement for my OpenJPA entities before it builds output artifact.

Couldn't get enough votes to close :(
It works via Ant. Right click on the target in the Ant Panel and specify the condition (After Compilation).

Related

How to view all errors in the project

I would like to see all compilation/syntax errors in a single list, so it would be easier to understand what should be fixed. I would describe it like something similar to vim`s quickfix window.
Currently I'm using Analyze -> Inspect Code..., but it lists all inspections, which could be sometimes too much. I can probably configure different profiles for inspections and switch between them, but probably there is some other approach which I miss?
When you run Build | Build Project, the Messages toolwindow will display the list of all compilation errors.
The question is unclear so I'll answer the two possible questions.
For IntelliJ IDEA you can use Build | Build Project.
For Go functionality / GoLand, you cannot use this, it's not supported. Follow https://youtrack.jetbrains.com/issue/GO-4618 for updates there.

IntelliJ's IdeaVim plugin disables converting Java to Kotlin

I would like to use IntelliJ's feature, which converts Java code to Kotlin by simply copy-pasting from Java file to Kotlin file. It is working fine, but when I turn on IdeaVim plugin, it refuses to work anymore. I know Vim decently and I that's not the problem with my misunderstanding Vim edit modes. I am aware of How can I convert a part of Java source file to Kotlin? and answer by #yole saying that there is no other tool to do that.
But that answer was made over 3 months ago, and maybe some other tool appeared. So, my question is if someone found workaround to make IdeaVim plugin cooperate with Java to Kotlin conversion. I've already made a ticket on YouTrack: https://youtrack.jetbrains.com/issue/VIM-1103 but frankly, I am not so sure if it will be resolved.
Ok, guy from JetBrains answered my issue. The obvious workaround (which I didn't figure out) is to copy and paste from context menu. Then conversion question shows up. IMO it seems unlikely that IdeaVim plugin will support this feature by yanking and putting (Vim's copying and pasting), as from:
Running IDE actions on copy and paste might be a good idea, but we're not sure it wouldn't disrupt the workflow of the current users.
The vim plugin takes over the clipboard and past functions. When you type :actionlist you get a list of idea actions you can use in your .ideavimrc file to map keymaps to idea actions. Use :action COMMAND to execute the command.
I.e.:
norepmap <C-w>q :action VimWindowClose<cr>
closes the current window.
Furthermore, you can search for a particular action with :actionlist Past.
This lists
EditorPast <C-V> <S-ins>
among other things.
If you want to check if EditorPast ist the right command you can test it using :action EditorPaste.
Another way to make this work is to let idea handle the <C-v> shortcut. This can be archieved with the Settings -> Other Setting -> Vim Emulation settings. The handler (vim or idea) can be defined with that setting.

How to make intellij detect the errors proactively?

When I develop with intellij (in java fyi), if I update for instance the return type of a method, I'm expecting intellij to mark all the files that are now not compiling without me doing a right-click compile.
I'm looking for such an option but I don't know where this is.
Thanks
There is no such option 'out of the box'. IntelliJ just works different than, for example, Eclipse when it comes to compiling. Eclipse recompiles all files that are affected by a change as soon as you save your changes. In IntelliJ there are two ways of checking the effect of your changes:
Trigger the compilation explicitly with Make Project or the compile action CTRL-SHIFT-F9.
Open one of the affected classes: only then will IDEA's Inspections mechanism start checking it for errors.
The advantage is that you have less file system load while you are coding.
But as described in this answer, there is a plugin to achieve what you want (even though it seems to have some performance pitfalls): https://stackoverflow.com/a/12744431/5788215

Run codenarc inspection in realtime in intellij

Is there any way to run inspections in real time in intellij, rather than just having to select Analyze > Inspect Code. In particular, I'd like to do real time codenarc analysis (similar to how Eclipse does with checkstyle) so when I save a file it tells me if there are violations. I downloaded the codenarc plugin, but it doesn't seem to support that explicitly.
If you go to settings -> inspections, you will see there is a bunch of CodeNarc entries that you can tick.
I recommend creating a separate inspection profile if you use CodeNarc in a Continuous Integration tool, so you can focus on violations that would break the build.
Now it is true that you have to analyze the code explicitly the first time, but then it happens on the fly, and by right clicking you can also disable a given inspection or re-run it on other parts of your code.

Where is the error list in Intellij IDEA?

I used to develop a habit in Eclipse to use Error List to check errors and warnings. Is there something like that in IntelliJ IDEA? I don't see it.
Eclipse incrementally builds the whole project all the time and finds all compilation errors even in classes you haven't touched/opened at all.
IntelliJ is not building your whole code base upon every change so there is no such view. The closest you can get is Messages view (available under Alt + 0) but it only shows compilation errors discovered when a file with errors was physically opened (or when the whole project was built).
UPDATE
IntelliJ IDEA 12 will most likely have incremental compilation feature:
Currently supported: incremental compilation of Java, Groovy, resource copying, UI Designer forms, Artifacts, Android, annotation processing, not-null instrumentation
It's also possible to look at tiny red stripes on the scrollbar to find where the errors in a file are located (they couldn't make it less convenient to use :/)