Run Automator-generated .app from ant? - ant

I used the Automator tool on my mac to generate a .app file (well a directory, to be more precise). I am trying to execute this .app in an ant build.xml, but it gives me a file/directory not found error. I tried running exec on both the .app folder and on the "Application Stub" file buried inside, but both produced the same error. This should be straightforward, but I'm new to both automator and ant so I don't know the right syntax here.
More specifically, how do I run the task open MyApp.app in a build.xml file?

Maybe the following:
open -a MyApp.app
or
open -a MyApp
both should work.
I have noticed though that my apps created with Automator seem to have "funny" names for awhile. You can see "good names" in the Finder, but when I try to open their AppleScript dictionaries from AppleScript editor, the names are some kind of hex codes or something. (I'd give you a screen-shot but I don't have enough reputation points here yet to post an image.)
You could try opening up some other app from Ant see if that works.

<exec executable="open">
<arg value="MyApp.app" />
</exec>

Related

Convert iOS project to 64 bit using ConvertCocoa64 script

I need to convert my iOS project to 64-bit friendly (to get rid of compiler warnings, as in this question. The solution apparently is to run ConvertCocoa64.
I've managed to locate ConvertCocoa64 (which is no longer included in /Developer/Extras/64BitConversion/ConvertCocoa64) as the Apple docs suggest, but here (search for Auxiliary Tools)
So I've download the script. But my question is, how do I run this on my project? Please assume a total newbie level of knowledge here when it comes to the terminal and running scripts. Do I drop the script inside my project folder and just double click it? Or do I access it from the terminal? The docs say run this command:
/Developer/Extras/64BitConversion/ConvertCocoa64 `find . -name '*.[hm]' | xargs`
But since that folder doesn't exist, where do I run it?. I tried dropping the script in the Developer folder, but when I type ConvertCocoa64 it says command not found.
Find where the command is located now. You'll want to run it in the terminal using the full path to the command, as in your example, just with the real path.
A good way to get the full path is to locate the command in the Finder and drag it to an open terminal window - this also "escapes" any spaces in the path for you. The easiest way to hit all your files as arguments to the command is to cd (change directory) to your project first (in the terminal).
This should get you set up to follow the directions you have.
If I'm not mistaking, to run script, you should place dot . before command. Doesn't really matters, where script is situated as long, as it doesn't rely on it heavily
> cd ~/path/to/script/dir/
> ./ConvertCocoa64 ...

'rake' is not recognized as an internal or external command, operable program or batch file

Minutes ago, I downloaded the oscurrency code from github, and I'm installing oscurrency on heroku. Everything seemed to be going perfectly until this command:
rake heroku:install
on the command line, in the directory where I downloaded the source code. I get the error:
'rake' is not recognized as an internal or external command, operable program or batch file.
I'm following the installation instructions at heroku here:
https://github.com/oscurrency/oscurrency/wiki/Heroku-Deployment-Guide
The command "rake heroku:install" is in the third paragraph from the bottom.
The code I downloaded came in a top-level folder called oscurrency. I downloaded that onto my laptop in C:\me\oscurrency. I was issuing the command in that directory when I got the error. I tried issuing the command in the folder C:\me\oscurrency\oscurrency -- same error.
Maybe the command has changed for some reason. Anybody have an idea what's going wrong?
Your problem is most likely that the command prompt is looking for a file named rake.exe and not able to find it because your PATH environment variable is not set to include that directory. I suspect that the rails command won't work either. You should add the ruby install directory (probably C:\Program Files\Ruby on Rails\bin\ to your PATH environment variable.
To do this, open your Computer Properties by right-clicking My Computer and selecting Properties, then find the "Advanced System Settings" link. Click the "Environment Variables" button at the bottom, and paste the path to that directory into the PATH variable, separating it with a semicolon.

Installing Arc on OS X

When I tried the instructions at https://arclanguage.github.io/, after I entered "racket -f as.scm" I got "-bash: racket: command not found".
I also tried these instructions for downloading Arc on Linux:
https://sites.google.com/site/arclanguagewiki/getting-started/install-arc
I installed racket from download.racket-lang.org, and when I got to "./arc" in the Arc/Nu section, the output from the terminal was "env: racket: No such file or directory".
The Arc Language Wiki (linked to above) indicates that the official installation instructions are out of date, and says little about how to install Arc on OS X. I tried googling for a general solution to "command not found" and "No such file or directory" problems but couldn't find anything that let me fix the problem. I also tried moving my racket and arc downloads to different combinations of places.
Arc runs on top of Racket, which although you've downloaded it, does not appear to be in PATH, the environment variable containing the list of folders that Bash searches for executables.
The immediate fix is to, instead of running Arc as racket -f as.scm, run it as /path/to/racket/bin/racket -f as.scm. (The Racket documentation points out that the Racket executable is in the bin folder of the Racket folder you downloaded).
Assuming that works, the fix is to add the Racket bin folder to your PATH variable. Open up ~/.bashrc in your favorite text editor, and add a line export PATH=/path/to/racket/bin:"$PATH".
Once you do this, you'll have to open a new Terminal before this change will take effect. But once you do, you should be able to just run racket -f as.scm, and it will work.

Ant exec - Run executable from a network drive

I am running the following command from my ant target:
<exec executable="${soa.mypath}\deploy.exe" failonerror="true" vmlauncher="false">
<arg value="-n" />
<arg value="${myfile}" />
</exec>
Where ${soa.mypath} is B:\bin.
This drive B is a network drive that I mapped on a other server.
when I connect remotly to the server where that ant script is running I can totally see and browse the B drive via the Windows explorer and the user I use is the same user that runs tha ant script.
However when I run my target, I got this error:
[exec] The system cannot find the drive specified.
Which is very weird.
Do you know if I am missing some option in the exec command?
Thank you,
Regards
Using ant 1.9.3 under Windows 8.1 I was able to get this to work with no problem with a network-mounted drive, including various combinations of forward and backslashes in the path.
My only suggestion is to replace your property with the hard-coded executable path (B:\bin\deploy.exe) in the exec task and see if that works. Also - use hard-coded path to ${myfile}.
If deploy.exe has a -version command or similar you might also try that, to rule out the problem actually being in the drive/path of ${my file}.
hth

ant copy tag won't keep file kind

I'm trying to build a Mac OS X bundle application automatically.
When copying the file "/System/Library/Frameworks/JavaVM.framework/Versions/A/Resources/MacOS/JavaApplicationStub" of kind "Unix Executable File" with the copy tag:
<copy file="${stub.file}" todir="${dist.dir}/${ant.project.name}.app/Contents/MacOS"/> and getting a file of kind "Document" and the bundle doesn't execute. If I copy it from Finder it works fine.
Is there a way to copy it and keep it's kind with ant?
Thanks in advance!
The file ist copied correctly, but the execute permission ist lost as described in the ant manual:
Unix Note: File permissions are not retained when files are copied; they end up with the default UMASK permissions instead. This
is caused by the lack of any means to query or set file permissions in
the current Java runtimes.
You have to use the cp command or change the permission later with chmod:
<apply executable="chmod">
<arg value="a+rx"/>
<file file="${stub.file}" basedir="${dist.dir}/${ant.project.name}.app/Contents/MacOS"/>
</apply>

Resources