Background compilation in 5.0? "Ctrl+F9" after "Ctrl+S" every time isn't cool ...

Hello all,

any how I can background compilation in v.5.0 as it works in Eclipse?
Where, by saving java class it triggers MAKE and even any added builders to it and then compiles JSP.

Pressing "CtrlF9" after "CtrlS" every time isn't cool - IMO.

What I'm missing?

thanks.

11 comments
Comment actions Permalink

Michael Kor wrote:

Hello all,

any how I can background compilation in v.5.0 as it works in Eclipse?
Where, by saving java class it triggers MAKE and even any added builders to it and then compiles JSP.

Pressing "CtrlF9" after "CtrlS" every time isn't cool - IMO.

What I'm missing?

thanks.


You don't need to CtrlF9 or CtrlS. Build is performed automatically before you
Run or Debug, and save is done automatically all the time. Ctrl+S is mostly
there to make you feel good about yourself, I think.

0
Comment actions Permalink

thanks for reply.
it doesn't work for me :(

I have j2ee appl that includes above 2000 classes

build sar, war, ear takes 5 - 10 min
then deploy another min

I don't want wait for so long to get compilation error ...

0
Comment actions Permalink

Michael Kor wrote:

thanks for reply.
it doesn't work for me :(

I have j2ee appl that includes above 2000 classes

build sar, war, ear takes 5 - 10 min
then deploy another min

I don't want wait for so long to get compilation error ...


Maybe IDEA won't work for this project, if you want to deploy frequently. It
sounds like background compilation would simply be working around a design
problem in your development environment, deployment system, and dependencies,
but maybe not.

0
Comment actions Permalink

Michael Kor wrote:

thanks for reply.
it doesn't work for me :(

I have j2ee appl that includes above 2000 classes

build sar, war, ear takes 5 - 10 min
then deploy another min

I don't want wait for so long to get compilation error ...


It shouldn't take that long to get a compilation error. If you change a
single class (with no inward dependencies), it will only compile that
one class. Are you doing Rebuild Project, or Make Project?

You should be able to organize your project to minimize excessive
dependencies, and thus get incremental compilation down to seconds. Try
using Dependency Inversion (with Extract Interface) if your dependencies
are too tangled.

--
Rob Harwood
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

thank you for reply.

I can't make architecture changes :( , so telling me about "bad" design will not help me any how for that project

I have what I got and have to deal with it.

I like IDEA JSP and XML and HTML editors and "Analyze" very much - nothing comes any closer to IDEA ;)

However, missing background compilation that Eclipse has makes some unpleasant IDEA usage.

I think you know how it works in Eclipse 3.1 (it will recompile all dependand classes and JSP and shows "red" for "failed" project right after Ctrl+S). Compiling a single file doesn't make much sense for me.

Any how I can eliminate extra Ctrl+F9 to validate a change I made?

Thanks.

0
Comment actions Permalink

Michael Kor wrote:

thank you for reply.

I can't make architecture changes :( , so telling me about "bad" design will not help me any how for that project


None at all? You can't add new interfaces?

Any how I can eliminate extra Ctrl+F9 to validate a change I made?


Make a macro (see attachment) and then go to Settings > Keymap, copy the
default keymap, remove the shortcut to Save All (in the File menu) and
add a shortcut to the new macro (Ctrl-S).

--
Rob Harwood
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"



Attachment(s):
save-compile.png
0
Comment actions Permalink

Rob Harwood (JetBrains) wrote:

Make a macro (see attachment) and then go to Settings > Keymap, copy the
default keymap, remove the shortcut to Save All (in the File menu) and
add a shortcut to the new macro (Ctrl-S).


Oh, I forgot to mention that you should also go to Settings > Compiler
and check Compile in Background.

--
Rob Harwood
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

wow, thanks a lot
I knew something has to be there already ;)
will try it first at the morning

Will that trigger JSP compilation too? Just for JSP that include the changed java class?

thanks again

0
Comment actions Permalink

Michael Kor wrote:

wow, thanks a lot
I knew something has to be there already ;)
will try it first at the morning

Will that trigger JSP compilation too? Just for JSP that include the changed java class?

thanks again


No, I'm not aware of any feature which will do JSP compilation. You can
write an Ant task to do the compilation and then right-click it in the
Ant Build window and select Execute On > After Compilation.

--
Rob Harwood
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

thank you - it works

however,
1. it's slow as runs make - slower then in Eclipse
2. it runs make even no files were changes - as it's triggered by Ctrl+S without checking for "changed" state of my project.

Any how I can add validation for "changed" status of file before run make?

Does IDEA's Make validate JSPs?

Thanks.

0
Comment actions Permalink

Michael Kor wrote:

thank you - it works

however,
1. it's slow as runs make - slower then in Eclipse


It is slower because we don't have a truly incremental custom compiler.
We use javac by default. You can try Jikes to possibly get faster
performance. This macro is an 80% solution, not 100%.

2. it runs make even no files were changes - as it's triggered by Ctrl+S without checking for "changed" state of my project.


Again, this is due to lack of custom compiler. Adding this will require
a lot of work. However, with Compile in Background enabled, you can
continue to work without waiting for the compiler to finish. Also, IDEA
only compiles those files that have been changed (plus their
dependents), so if no files changed, it will not compile anything.
However, it must scan files first, so that work will be done every time.
Maxim Shafirov is aware of the requests for full incremental
compilation, and the IDEA team will consider the possibilities. If it is
decided to implement it, it will be a major feature in an upcoming
release (i.e. not 5.0.x).

Any how I can add validation for "changed" status of file before run make?


Probably not with a simple macro. It may be possible as a plugin, but
I'm not sure about that. It would probably still require IDEA to scan
for changes.

Does IDEA's Make validate JSPs?


It will if you select 'Run Jasper validator for JSP files' in Settings >
Modules > (your web module) > J2EE Build Settings.

[In fact, I just realized something. There's no need to write such a
macro at all. You can just press Ctrl-F9 and IDEA will save files before
compiling (this is default behaviour). If you want, you can remap Make
to Ctrl-S instead of Ctrl-F9.]

--
Rob Harwood
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop with pleasure!"

0

Please sign in to leave a comment.