Saturday, July 12, 2008

Netbeans RCP shell scripts permissions

Sometimes when you are building an RCP application, You need to include some shell scripts. What i have found that if you are using Linux, the build zip command drops the executable permission off the scripts. Here is a simple way to fix that. In the Suites build.xml file override the build-zip command with this.

<target name="build-zip" depends="build,build-launchers" description="Builds a ZIP distribution of the suite, launchers, and selected modules from the platform.">
<mkdir dir="${dist.dir}"/>
<zip destfile="${dist.dir}/${app.name}.zip">
<zipfileset dir="${build.launcher.dir}/bin/" filemode="755" prefix="${app.name}/bin"/>
<zipfileset dir="${build.launcher.dir}/etc/" prefix="${app.name}/etc"/>
<zipfileset dir="${netbeans.dest.dir}" filemode="755" prefix="${app.name}">
<include name="**/lib/nbexec*"/>
</zipfileset>
<zipfileset dir="${netbeans.dest.dir}" prefix="${app.name}">
<and>
<not>
<filename name="**/lib/nbexec*"/>
</not>
<selector refid="zip.platform.included.files"/>
</and>
</zipfileset>
<!-- Yes, the doubled app.name is a bit ugly, but better than the alternative; cf. #66441: -->
<!-- added filemode to add executable permissions in the zip file -->
<zipfileset dir="${cluster}" prefix="${app.name}/${app.name}" filemode="755">
<exclude name="config/Modules/*.xml_hidden"/>
</zipfileset>
</zip>
</target>

1 comment:

branajam said...

Hi,
My name is James Branam and I'm the NetBeans Community Docs Manager. Your blog entry would make a fantastic Tips & Tricks entry for our Community Docs wiki (http://wiki.netbeans.org//CommunityDocs). Would you be willing to contribute it? If you need any help or have any questions, please contact me at james.branam@sun.com. I look forward to hearing from you.