0

We are 99% a Java shop, and we use Jenkins as a CI tool. Recently, there have been some .NET project that we needed to compile and build, and I was able to setup a Jenkins slave to do that.

There's one project that as part of the build process compiles Flash applications. It comes with a build.xml and runs under Ant. There were two targets, one called buildandpost and another called buildandpost_withFlash. It runs this compile task:

<target name="compile" description="compile flash and copy to dist" >

    <exec dir="src/flash" 
        executable="C:/Program Files/Adobe/Adobe Flash CS3/flash.exe"  
        searchpath="true" >
        <arg line="compileProject.jsfl"/>
    </exec>

    <echo message="Flash exited" />
    <fail message="Flash Compile produced errors">
        <condition>
            <isfileselected file="src/flash/compile_log.txt">
                <and>
                    <contains text="Error" casesensitive="no"/>
                    <contains text="Warning" casesensitive="no"/>
                </and>
            </isfileselected>
        </condition>
    </fail>

</target>

When running Jenkins with the buildandpost_withFlash target, I noticed that Jenkins would start the compile task and then sit there without doing anything until I kill the job. Nothing was being printed in the log. Running the buildandpost task which does everything that buildandpost_withFlash does without the compile worked.

I opened the build server, ran the Ant buildandpost_withFlash target and to my surprise, a GUI opened up while the compile was taking place. I didn't have to do anything. The GUI closed after the compile, and Ant continued, but I now realize that Jenkins was not able to run the compile task because there's no terminal associated with its tasks.

Is there a way to run this compile without opening up the GUI? I can compile VisualStudio projects without opening VisualStudio. Can I do this with Flash? This is CS3. Otherwise, I won't be able to do builds with Jenkins.

David W.
  • 105,218
  • 39
  • 216
  • 337

1 Answers1

0

Compile what to what? AS3? FLA? SWF? SWC?

There are mxmlc and compc. Both have ANT tasks, as well as command line and .jar.

In my flash projects, we are compiling, AS3 code to SWF using mxmlc. There is no GUI involved.
For publishing FLAs though, requires Flash Builder GUI to run, however it runs fine without any problems, as long as there is no input required from user (such as when an error or warning message pops up)

You mentioned buildandpost actually succeeds and does everything that buildandpost_withFlash does, so if there a problem using buildandpost then?

Edit:
Here is the documentation on using the mxmlc ant task http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf678b2-7ffc.html

However, if you are not familiar with Flash, you will not be able to translate that .jsfl file into the mxmlc steps

Basically you have a blackbox (the .jsfl) and you don't know what happening underneath, therefore you cannot translate it into another script. If you would have said that it compiles .as3 to .swf, we could have tried something, but you are saying it also spits out other files... so there is quite a bit of logic in that .jsfl, something that cannot be achieved by just mxmlc. If you cannot translate the blackbox into a script that Jenkins can easily handle, your other option is run the blackbox as is, that is run that .exe file.

I can only suggest the following:
Open Excel on Jenkins CI
Never mind the excel.exe part, replace that with your flash.exe and compileProject.jsfl followed as an argument, but you got to provide full paths.

Community
  • 1
  • 1
Slav
  • 27,057
  • 11
  • 80
  • 104
  • The command being executed is `C:/Program Files/Adobe/Adobe Flash CS3/flash.exe compileProject.jsfl`. The output of the compile is several `*.swf` files, `*.js` and `*.html`. I'll see if we have `mxmlc` installed. – David W. Mar 28 '14 at 16:54
  • Just searched the entire Adobe folder for any and all `*.exe` files. No `mxmlc` file of any sort. I am not a flash developer and haven't worked with flash. I'm going to see if I can give Jenkins control over the console when it runs. This way, it will be able to open up the GUI. – David W. Mar 28 '14 at 16:59
  • [There is mxmlc.exe](http://www.senocular.com/flash/tutorials/as3withmxmlc/), but I was not suggesting to use that. The best way is to use the jar directly. – Slav Mar 28 '14 at 17:19