AS3 Bundle Fight

View: New views
6 Messages — Rating Filter:   Alert me  

AS3 Bundle Fight

by Gaby vanhegan :: Rate this Message:

| View Threaded | Show Only this Message

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.



_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: AS3 Bundle Fight

by Simon Gregory :: Rate this Message:

| View Threaded | Show Only this Message

> 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:

This  <http://macromates.com/svn/Bundles/trunk/Review/Bundles/ActionScript%203.tmbundle/info.plist 
 >  is currently clean.

So I'd say you created all the conflicts when you ran your update  
script as your working copy contained changes that subversion could  
not automatically merge.

> 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.

This script is provided as a template to be customised before being  
used, as a result it's left un-executable, and as you point out the  
command warns you of this.

> [...] Turns out that the default file supplied by Adobe is also in  
> DOS encoding (funny line endings). [...]


I use the Flex SDK versions 2, 3 and 4 and their minor revisions and  
I've not had this problem with any of them (running Leopard).

Cheers,
Simon

_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: AS3 Bundle Fight

by Gaby vanhegan :: Rate this Message:

| View Threaded | Show Only this Message


On 2 Sep 2008, at 16:50, Simon Gregory wrote:

This  <http://macromates.com/svn/Bundles/trunk/Review/Bundles/ActionScript%203.tmbundle/info.plist 
is currently clean.

So I'd say you created all the conflicts when you ran your update  
script as your working copy contained changes that subversion could  
not automatically merge.

So the sensible thing would be to trash my AS3 bundle and download a fresh one.  I don't think any of the modifications I've made are particularly important and if anything breaks I can probably fix it again.

Will report back with results.

[...] Turns out that the default file supplied by Adobe is also in  
DOS encoding (funny line endings). [...]

I use the Flex SDK versions 2, 3 and 4 and their minor revisions and  
I've not had this problem with any of them (running Leopard).

I've tracked this problem down.  I had Flex installed on my PC, so I copied the folder, rather than the downloaded archive onto my mac, causing most of the files to end up with DOS line endings.  Textbook error really... :)

G.

--

Junkets for bunterish lickspittles since 1998!




_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: AS3 Bundle Fight

by Gaby vanhegan :: Rate this Message:

| View Threaded | Show Only this Message


On 2 Sep 2008, at 19:45, Gaby Vanhegan wrote:

> So the sensible thing would be to trash my AS3 bundle and download a  
> fresh one.  I don't think any of the modifications I've made are  
> particularly important and if anything breaks I can probably fix it  
> again.
>
> Will report back with results.


I have downloaded a fresh copy of the Flex 3 SDK, and got a pristine  
copy of the AS3 bundle from the repository.  So far it all works fine,  
crisis averted!

Thanks,

Gaby.

--
Imagine there were no hypothetical situations.
http://playr.co.uk/


_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: AS3 Bundle Fight

by Michael Sheets-2 :: Rate this Message:

| View Threaded | Show Only this Message

On Sep 2, 2008, at 7:19 PM, Gaby Vanhegan wrote:

>> So the sensible thing would be to trash my AS3 bundle and download a
>> fresh one.  I don't think any of the modifications I've made are
>> particularly important and if anything breaks I can probably fix it
>> again.
>>
>> Will report back with results.
>
> I have downloaded a fresh copy of the Flex 3 SDK, and got a pristine
> copy of the AS3 bundle from the repository.  So far it all works fine,
> crisis averted!

In the future always checkout to:

~/Library/Application Support/TextMate/Pristine Copy/Bundles/

Textmate will never write here, it will keep a delta of the changes  
you make in the other directory meaning you can always svn up cleanly.  
The exception to this is if you want to commit changes to the bundle  
or submit patches to the maintainer.

_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate

Re: AS3 Bundle Fight

by Gaby vanhegan :: Rate this Message:

| View Threaded | Show Only this Message


On 9 Sep 2008, at 05:16, Michael Sheets wrote:

In the future always checkout to:

~/Library/Application Support/TextMate/Pristine Copy/Bundles/

Textmate will never write here, it will keep a delta of the changes  
you make in the other directory meaning you can always svn up cleanly.  
The exception to this is if you want to commit changes to the bundle  
or submit patches to the maintainer.

An excellent idea, that seems much more sensible.  Thank you!

G.

--

Junkets for bunterish lickspittles since 1998!




_______________________________________________
textmate mailing list
textmate@...
http://lists.macromates.com/listinfo/textmate