Hi Alex,

> IIRC, the FB compiler calls flex2/tools/oem/Application.java.  You can see
> how this class builds up an OEMReport with messages.

Thanks, I've been able to create and OEMReport based on that.

So, at the moment, using the Mxml entry point they use, plug into the MCMLC and 
sending old report (logs), I can compile and have reports on success, info, 
warnings and errors, I did the same with COMPC but didn't test it yet.

I re-introduce the proccessConfiguration too to make IJ happy, maybe I could 
mock it but I need to determinate first what they do exactly with the 
flex2.compiler.common.Configuration, it seems they get and use the 
CompilerConfiguration class though, so, I would probably need to mock it.

There are some limitations though:

1- They patched the FileConfigurator class and now, there's a UnkownError which 
has an Info level and then doesn't avoid the compilation at all using their 
MXMLX / COMPC compile choice option .

2- The most anoying thing is their build-in compiler option, it seems they 
totally revamped the CompilerAPI, create a process based on the Mxmlc and it 
doesn't work anymore indeed, but the worst is that for some reason I didn't get 
yet, their code path is switching all the time between those 2 compilers 
creating a very bad user experience:

If I choose the Mcmlc, I can compile once, after no changes, it wont try to 
compile again, if there is at least one file changed, it will automatically try 
to compile with the build-in compiler and fail indeed, the user has to manualy 
select their build-in compiler again, try and fail again, switch back to the 
Mxmlc one to make it build.

Thats where I am now.

Frédéric THOMAS

> From: aha...@adobe.com
> To: dev@flex.apache.org
> Subject: Re: AW: AW: AW: [FlexJS] IntelliJ Integration
> Date: Fri, 22 May 2015 18:13:15 +0000
> 
> Fred, this is great progress!
> 
> IIRC, the FB compiler calls flex2/tools/oem/Application.java.  You can see
> how this class builds up an OEMReport with messages.  It also does some
> Configuration stuff as well.  Hopefully you can grab pieces of this and
> connect it up with IJ’s entry point.
> 
> -Alex
> 
> On 5/22/15, 10:25 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com> wrote:
> 
> >I forgot to mentioned in my tasks, to do the same with the COMPC.
> >Also, to mention, I've been able to compile a Standard FlexJS project and
> >one build from FlexMojos
> >
> >Frédéric THOMAS
> >
> >> From: webdoubl...@hotmail.com
> >> To: dev@flex.apache.org
> >> Subject: RE: AW: AW: AW: [FlexJS] IntelliJ Integration
> >> Date: Fri, 22 May 2015 18:19:21 +0100
> >> 
> >> So, I've been able to use the flex-compiler-oem instead of the external
> >>tools feature provided by IntelliJ.
> >> 
> >> The all thing is not finished, I still need:
> >> 
> >> 1- Figure out why IntelliJ auto-switch to its internal compiler, that's
> >>really not handy !!
> >> 2- See, if it is FM or IJ which remove the .swf at the end of the
> >>output file
> >> 3- Find a way to plug the IJ logger to the compiler (Alex, any idea ?
> >>ho does it work for FB ?)
> >> 4- Cleanup and commit.
> >> 
> >> Still, that's a big progress :-)
> >> 
> >> Frédéric THOMAS
> >> 
> >> > From: aha...@adobe.com
> >> > To: dev@flex.apache.org
> >> > Subject: Re: AW: AW: AW: [FlexJS] IntelliJ Integration
> >> > Date: Fri, 22 May 2015 15:00:52 +0000
> >> > 
> >> > FWIW, in the FlashBuilder/Falcon integration, I’ve blocked incremental
> >> > compiles, at least for now.  Besides there were plenty of bugs in the
> >> > incremental compilation.
> >> > 
> >> > It looks like (in the flex-sdk repo)
> >> > modules/compiler/src/java/flex2/tools/Mxmlc.java is a command-line
> >>entry
> >> > point for the compiler.  When I was hacking flex-oem-compiler for
> >>Falcon,
> >> > I would take a class like that from the flex-sdk repo, add it to
> >>Falcon’s
> >> > flex-oem-compiler and comment out the bodies of the methods and then
> >>try
> >> > to figure out what FB was really looking for and then make the
> >>required
> >> > calls to Falcon to make it happen.  The problem is that some imports
> >>in
> >> > some of these files bring in a ton of other files that we don’t want
> >>to
> >> > support in Falcon since they do similar things in MXMLC.
> >> > 
> >> > If we’re lucky, IJ just uses an Mxmlc class to call its main() or
> >>mxmlc()
> >> > method with command-line args and you can just pass them to the Falcon
> >> > Mxmlc class.
> >> > 
> >> > Thanks,
> >> > -Alex
> >> > 
> >> > BTW, I finally got a new Windows computer and have plans to install
> >>IJ,
> >> > FlashDevelop and FDT on it, but other things are currently taking
> >>higher
> >> > priority.
> >> > 
> >> > 
> >> > 
> >> > On 5/22/15, 6:39 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com>
> >>wrote:
> >> > 
> >> > >Hi Alex,
> >> > >
> >> > >Well, as per [1], I thought we would have keep the same feature for
> >> > >Falcon.
> >> > >
> >> > >And In IntelliJ, as per their doc, you can select which of the
> >>available
> >> > >Flex compilers should be used:
> >> > >
> >> > >1- Built-in compiler shell. An
> >> > >                    IntelliJ IDEA compiler shell which uses the Flex
> >>SDK
> >> > >                    compiler API.
> >> > >
> >> > >             
> >> > >
> >> > >This compiler shell can perform incremental
> >> > >                      compilations. As a multithreaded shell, it is
> >> > >capable of 
> >> > >                      running a number of compilations
> >>simultaneously, in
> >> > >                      parallel.
> >> > >             
> >> > >
> >> > >2- Mxmlc/compc: Compiler
> >> > >                    available in Flex SDK
> >> > >
> >> > >This compiler cannot compile incrementally. However, it
> >> > >                      can run several independent compilation
> >>processes
> >> > >                      simultaneously which significantly improves the
> >> > >                      compilation performance.
> >> > >             
> >> > >
> >> > >Whichever of the compiler options you use, IntelliJ IDEA
> >> > >                  keeps track of the modules where nothing has
> >>changed
> >> > >since 
> >> > >                  the previous compilation. Consequently, the SWF
> >>and SWC
> >> > >                  files that are up-to-date are not compiled.
> >> > >
> >> > >
> >> > >            
> >> > >          
> >> > >Selecting the 2nd option and trying to build a project, I can see
> >>all the
> >> > >failed calls to the flex-compiler-oem and it uses CompilerAPI, Mxmlc
> >>and
> >> > >I guess Compc for libs.
> >> > >
> >> > >Will try to do my best with the low knowlegde I've got on the
> >>Compiler.
> >> > >
> >> > >Thanks,
> >> > >
> >> > >  
> >> > >
> >> > >Frédéric THOMAS
> >> > >
> >> > >[1] 
> >> > 
> >>>http://help.adobe.com/en_US/Flex/4.0/CompilerAPI/flex_4.0_compilerapi.pd
> >>>f
> >> > >
> >> > >> From: aha...@adobe.com
> >> > >> To: dev@flex.apache.org
> >> > >> Subject: Re: AW: AW: AW: [FlexJS] IntelliJ Integration
> >> > >> Date: Thu, 21 May 2015 17:18:26 +0000
> >> > >> 
> >> > >> 
> >> > >> 
> >> > >> On 5/21/15, 9:58 AM, "Frédéric THOMAS" <webdoubl...@hotmail.com>
> >>wrote:
> >> > >> 
> >> > >> >@Alex,
> >> > >> >
> >> > >> >I've been playing a bit with the flex-compiler-oem that intellij
> >>can
> >> > >>use,
> >> > >> >I started to add the functions it expects but I had to stop and
> >>ask
> >> > >>you,
> >> > >> >why it doesn't contains things like Mxmlc anymore, that IntelliJ
> >>uses ?
> >> > >> 
> >> > >> Well, Falcon is supposed to replace Mxmlc.  My goal with Falcon’s
> >> > >> flex-compiler-oem was to use as few classes from the SDK’s MXMLC as
> >> > >> possible so we don’t have to maintain them going forward in Falcon
> >>and
> >> > >> make the APIs call what was needed in Falcon to get Flash Builder
> >>to
> >> > >>work.
> >> > >> 
> >> > >> It sounds like IntelliJ decided to use other APIs in
> >>flex-compiler-oem.
> >> > >> Hopefully you can implement what it needs by calling Falcon code
> >>without
> >> > >> dragging too much more of the old MXMLC into the Falcon code-base.
> >> > >> 
> >> > >> -Alex
> >> > >>                                         
> >> > >> 
> >> > >                                          
> >> > 
> >>                                      
> >                                       
> 
                                          

Reply via email to