Reputation: 5947
I'm looking for Ant task which will assemble Mac OS X PKG-file from my application files. Googled. No result. Any help?
Upvotes: 1
Views: 644
Reputation: 5947
So, i have found no special ant task. But i learned how to create Mac OS X package with PackageMaker from inside ant. First you have to create PackageMaker project manually. Create a package in PackageMaker then save it as, say, 'testpkg'. Now you need to add following code in your ant script.
<exec executable="/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker">
<arg value="--doc"/>
<arg value="./Installer/testpkg.pmdoc/"/>
<arg value="--out"/>
<arg value="${build.dir}/../test.pkg"/>
</exec>
Of cource you need to change some arguments to your paths.
This method is simple as if you create package manualy and then reassemble it automatically. But there is another side of medal: every time you have changes in files( e.g. new file must be included in package) you have to change your package project manualy.
There are another ways to create pkg( packager tool and variety of command line switches of PackageMaker itself). I choose easy way.
Upvotes: 1
Reputation: 10361
I propose you get inspiration from this old mailing post and use Ant tasks copy
, chmod
, chown
, tar
, gzip
instead of commands from shell... It still remains to call the /usr/bin/package
command with exec
. Maybe this little Perl script packagelint may help too.
Upvotes: 2