Okay, I made a commit that seems to get things working in IntelliJ IDEA
again. It looks like MxmlJSC and CompJSC in flex-compiler-oem.jar no longer
need to create the backend manually, and MXMLJSC or COMPJSC can figure out
what to do automatically based on the value of -targets now.

I was able to successfully build some projects in IntelliJ with -targets
set to JSFlex, SWF, and also JS.

- Josh

On Thu, Jul 6, 2017 at 11:21 AM, Josh Tynjala <joshtynj...@gmail.com> wrote:

> The problem looks to be related to this line:
>
> compiler = COMPILER.getDeclaredConstructor(IBackend.class).newInstance(
> backend);
>
> It's looking for a constructor on MXMLJSC (not to be confused with
> MxmlJSC) that takes an IBackend as a parameter. There is no longer a
> constructor like that in 0.8.0. If I understand the dual changes correctly,
> MXMLJSC now automatically creates an IBackend based on the -targets value.
> It looks like this code does indeed still need changes to support dual.
>
> - Josh
>
>
> On Wed, Jul 5, 2017 at 3:09 PM, Josh Tynjala <joshtynj...@gmail.com>
> wrote:
>
>> I'm trying to create a new FlexJS 0.8.0 project in IntelliJ IDEA, and I'm
>> getting the following output when I try to build the project:
>>
>> Information:[HelloIDEA]: Starting Flex compiler:
>> "/Applications/IntelliJ IDEA.app/Contents/jdk/Contents/Home/jre/bin/java"
>> -Dapplication.home=/Users/joshtynjala/Development/Flex/sdks/flexjs-0.8.0
>> -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Duser.language=en
>> -Duser.region=en -Xmx512m -classpath "/Applications/IntelliJ
>> IDEA.app/Contents/plugins/flex/lib/idea-flex-compiler-fix.jar:/Applications/IntelliJ
>> IDEA.app/Contents/plugins/flex/lib/flex-compiler.jar:/Users/
>> joshtynjala/Development/Flex/sdks/flexjs-0.8.0/lib/flex-compiler-oem.jar"
>> com.intellij.flex.compiler.FlexCompiler 54900
>> Information:[HelloIDEA]: mxmlc -load-config=/Users/joshtynjal
>> a/Library/Caches/IntelliJIdea2017.1/compile-server/
>> helloidea_6d5abd99/_temp_/IntelliJ_IDEA/idea-B028A5AE-12E86E20.xml
>> -load-config+=/Users/joshtynjala/Development/Flex/sdks/
>> flexjs-0.8.0/ide/IDEA/intellij-config.xml
>> Information:[HelloIDEA]: unknown error
>> Information:[HelloIDEA]: at java.lang.Class.getConstructor
>> 0(Class.java:3082)
>> Information:[HelloIDEA]: at java.lang.Class.getDeclaredCon
>> structor(Class.java:2178)
>> Information:[HelloIDEA]: at flex2.tools.MxmlJSC.getCompile
>> rInstance(MxmlJSC.java:48)
>> Information:[HelloIDEA]: at flex2.tools.MxmlJSC.execute(MxmlJSC.java:89)
>> Information:[HelloIDEA]: at flex2.tools.Tool.compile(Tool.java:68)
>> Information:[HelloIDEA]: at flex2.tools.Mxmlc.mxmlc(Mxmlc.java:73)
>> Information:[HelloIDEA]: at com.intellij.flex.compiler.fle
>> x4.Flex4Handler.compileSwf(Flex4Handler.java:81)
>> Information:[HelloIDEA]: at com.intellij.flex.compiler.Com
>> pilationThread.run(CompilationThread.java:48)
>> Information:[HelloIDEA]: Compilation failed
>> Information:7/5/17, 2:56 PM - Compilation completed with 1 error and 0
>> warnings in 595ms
>> Error:[HelloIDEA]: java.lang.NoSuchMethodException:
>> org.apache.flex.compiler.clients.MXMLJSC.<init>(org.apache.
>> flex.compiler.driver.IBackend)
>>
>> I followed the steps in these instructions that worked correctly with
>> 0.7.0:
>>
>> https://cwiki.apache.org/confluence/display/FLEX/Using+FlexJ
>> S+with+IntelliJ+IDEA
>>
>> I'm not very familiar with this part of the code, but it looks to me like
>> the call to MxmlJSC.getCompilerInstance() can't find IBackend? Could it be
>> that flex-compiler-oem.jar is missing something in its classpath?
>>
>> - Josh
>>
>
>

Reply via email to