On 10.09.2015 15:26, Frédéric THOMAS wrote:
Now, what is the best setup to be able to debug the
BuiltInFlexCompiler or any other tool?
I added instructions to readme about compiler process debugging.
Your instructions are clear
I'm happy if you find them clear as they are really concise. Only 3
sentences are relevant:
Compiler is started as a separate Java process (see
com.intellij.compiler.server.BuildManager#launchBuildProcess). In its
turn it starts one more Java process for the Flex compiler (see
JpsBuiltInFlexCompilerHandler#startCompilerProcess).
To debug Flex compiler itself you need to setup a project based on the
sources from the corresponding zip files located in
intellij-plugins/flex/lib, configure Remote Debug configuration and
add required VM options to the
JpsBuiltInFlexCompilerHandler.startCompilerProcess() method.
I noticed an error in these instructions as zips do not contain sources
of the flex-compiler.jar. Sources are in
intellij-plugins/flex/tools/BuiltInFlexCompiler and subfolders. I'll fix
readme. There's a project (.idea folder) configured in this folder but
it is not ready to use out-of-the-box. I didn't write any instructions
for it yet, I didn't adapt it for external contributors and didn't
update it for several years. You may try to base on it or configure your
own new project that would contain all sources from this folder.
but I probably missed something else because I can't break into the built-in
compiler, neither in implementation of FlexCompilationTasks->doStart() or
FlexCompilationUtils->buildCommand(), can you help ?
I hope I can.
You have control on the Java process startup
(JpsBuiltInFlexCompilerHandler.startCompilerProcess()), you have source
code (intellij-plugins/flex/tools/BuiltInFlexCompiler), you have an IDE
that can debug and you know how Java debugger establishes connection.
That's all you need to debug. May be I'll find time to preconfigure a
project and to write detailed steps, but I hope you'll be able to set up
without waiting for it.