user1525478
user1525478

Reputation: 1

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!

Upvotes: 0

Views: 180

Answers (1)

Arne Burmeister
Arne Burmeister

Reputation: 20594

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>

Upvotes: 1

Related Questions