[TxMt] AS3 Bundle Fight

Gaby Vanhegan gaby at vanhegan.net
Tue Sep 2 17:59:56 UTC 2008


So,

I've just installed the AS3 bundle from the repository in TextMate and  
thought I'd share the steps I had to go through in order to make it  
work, partially so I have a document explaining what I had to do (if I  
need to do it again) and to help others who might be stuck.

Message for Simon Gregory: This was the bundle I downloaded from the  
repository so it's possible that the svn version is b0rked... :(

I have an up to date version of TM on Leopard, and I used the "Get AS3  
Bundle.sh" script that I downloaded a short while ago.  Unfortunately  
I couldn't find the site where it came from but it just appears to  
grab the latest version from the repository by svn so it can't do that  
much.

First, I got the wonderful error dialog:

> The “ActionScript 3” bundle located in ~/Library/Application Support/ 
> TextMate/Bundles could not be loaded and will be skipped. The  
> contained info.plist appears to be corrupt or missing.


What's going on here?  No idea.  So I looked at the plist file in  
question and found what looked like a half failed diff at the bottom:

<<<<<<< .mine
... some txt
=======
... other text
 >>>>>>> .r10513

This is present in a bunch of files, I have so far found it in  
build_with_fcsh.sh and asd.rb.  Anywho, I took that out of the plist  
file, probably breaking it slightly but at least TM now loads the AS3  
bundle.

Next I created a new, blank AS3 project.  Make a more or less empty  
class and "Build with FCSH".  Nothing, no output, no error, no  
feedback, nothing.  Build with MXMLC, a window pops up telling me  
there's 0 errors and a successful build, but no .swf file was produced  
in the deploy/ folder.  Try the "Build (custom)" option, it tells me  
the script is not executable.  Joy.  So I run the supplied compile.sh  
script manually by opening the script and pressing Apple-R to run it.   
TM alerts me that the script is not executable, so I make it so.  OK,  
so now it runs.

However, still nothing coming out of mxmlc, still 0 errors.  What  
happens when I run mxmlc on it's own?  I get this wonderful error:

-bash: ./mxmlc: /bin/sh^M: bad interpreter: No such file or directory

Joy.  That error is familiar, usually found when running a binary  
built for a different architecture, but that wasn't the problem.   
mxmlc turns out to be a shell script that runs slightly different  
commands for windows and unix.  Turns out that the default file  
supplied by Adobe is also in DOS encoding (funny line endings).  So,  
open the file in vim and type:

# vim ./mxmlc
:set ff=unix
:wq

And the script now runs mxmlc properly.  I also had to chmod a+x in  
Flex/bin/* as well.

OK, so building in mxmlc now works but I know that it's slow and I'd  
rather use fcsh to do my compiles.  So I try building with fcsh and  
get even less reponse, no progress bar, no iTerm window, nada.  OK,  
stay calm...

So I check the encoding of the fcsh script supplied by Flex, it too  
was in DOS format so I converted it back to Unix.  That script now  
fires up the fcsh compiler so that part worked.  Next, why was the  
build command silently failing?  Open up the Bundle Editor and edit  
the "Build (fcsh)" command to show output as HTML.  This revealed a  
syntax error in the build_with_fcsh.sh script.  Find the script, open  
it in vim and I found the same sort of failed diffs as I found in the  
plist file.

This time I just copied the r10513 file over the existing one:

# cd "/Users/gaby/Library/Application Support/TextMate/Bundles/ 
ActionScript 3.tmbundle/Support/bin/"
# cp build_with_fcsh.sh.r10513 build_with_fcsh.sh

Now the script works, fcsh works, mxmlc works and I have finally got  
a .swf file being output into the deploy folder.  Sorry for the length  
of this rant but my hope is that if anybody else is fighting with AS3  
under TextMate, hopefully this might shed some light on problems  
they're having.

Gaby

--
Being drunk is feeling sophisticated without being able to say it.
http://www.playr.co.uk/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20080902/8c67f054/attachment.html>


More information about the textmate mailing list