pmd/pmd-netbeans/build.xml
Gunnlaugur Thor Briem 8870b42046 Make NBM signable (task 76460).
Sign it by creating your own key in the default keystore location
with Java's keytool, and then passing -Dstorepass=whatever to ant.
Then publish your certificate signature on the website -- or, even
better, sign your certificate with a chain of trust ending in an
official CA, so that people won't have to furrow their eyebrows
about anything ... but then, that costs money :). Ideally we should
have a CA-signed certificate for PMD with which we would sign the
personal key of whoever makes the build -- but of course the key
of that certificate would have to be "closed-source" :)


git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1969 51baf565-9d33-0410-a72c-fc3788e3496d
2003-06-15 11:39:36 +00:00

91 lines
3.8 KiB
XML

<project basedir="." default="nbm" name="PMD netbeans module">
<property name="pmd.jar" value="pmd-1.05.jar"/>
<property name="keystore" value="${user.home}/.keystore"/>
<property name="storepass" value="?"/>
<target description="Compiles all java files and copies property files to the classes dir" name="compile">
<mkdir dir="build/classes"/>
<javac debug="on" debuglevel="source,lines" deprecation="on" destdir="build/classes" srcdir="src">
<include name="**/*.java"/>
<classpath>
<!-- Copy this one from the netbeans/lib directory -->
<pathelement path="lib/openide.jar"/>
<!-- Copy these three from the netbeans/modules/autoload directory -->
<pathelement path="lib/openide-io.jar"/>
<pathelement path="lib/java-api.jar"/>
<pathelement path="lib/java-src-model.jar"/>
<pathelement path="lib/${pmd.jar}"/>
<pathelement path="lib/jakarta-oro-2.0.jar"/>
</classpath>
</javac>
<copy todir="build/classes">
<fileset dir="src">
<include name="**/*"/>
<exclude name="**/*.java"/>
<exclude name="**/.nbattrs"/>
<exclude name="manifest.mf"/>
</fileset>
</copy>
</target>
<target depends="compile" description="Creates the jar" name="jars">
<mkdir dir="work"/>
<copy file="src/manifest.mf" tofile="work/manifest-filtered.mf">
<filterset>
<filter token="pmd.jar" value="${pmd.jar}"/>
</filterset>
</copy>
<jar compress="false" jarfile="build/pmd.jar" manifest="work/manifest-filtered.mf">
<fileset dir="build/classes">
<include name="**/*"/>
</fileset>
</jar>
<delete dir="work"/>
</target>
<target depends="jars" description="Prepare the module for distribution via Auto Update." name="nbm">
<taskdef classname="org.netbeans.nbbuild.MakeNBM" classpath="lib/nbantext.jar" name="makenbm"/>
<mkdir dir="build/temp_distribution/netbeans/modules/ext"/>
<copy file="build/pmd.jar" tofile="build/temp_distribution/netbeans/modules/pmd.jar"/>
<copy file="lib/${pmd.jar}" tofile="build/temp_distribution/netbeans/modules/ext/${pmd.jar}"/>
<copy file="lib/saxpath-1.0-fcs.jar" tofile="build/temp_distribution/netbeans/modules/ext/saxpath-1.0-fcs.jar"/>
<copy file="lib/jakarta-oro-2.0.jar" tofile="build/temp_distribution/netbeans/modules/ext/jakarta-oro-2.0.jar"/>
<copy file="lib/jaxen-core-1.0-fcs.jar" tofile="build/temp_distribution/netbeans/modules/ext/jaxen-core-1.0-fcs.jar"/>
<makenbm file="build/pmd.nbm" homepage="http://pmd.sourceforge.net/" module="build/pmd.jar" topdir="build/temp_distribution" needsrestart="false">
<license file="LICENSE.txt"/>
<!-- todo: better to include online help (JavaHelp) than put this here: -->
<notification>
<file location="README.txt"/>
<text>CHANGES</text>
<file location="CHANGES.txt"/>
</notification>
<signature keystore="${keystore}" storepass="${storepass}" alias="pmdkey"/>
</makenbm>
</target>
<target depends="clean, nbm" description="Builds the distribution" name="distribution">
<zip compress="true" destfile="build/pmd-netbeans35-src-${VERSION}.zip">
<zipfileset dir=".">
<include name="*.txt"/>
<include name="build.xml"/>
<include name="src/**/*"/>
<include name="lib/pmd*.jar"/>
<include name="lib/nbantext.jar"/>
<include name="lib/saxpath-1.0-fcs.jar"/>
<include name="lib/jaxen-core-1.0-fcs.jar"/>
<include name="lib/jakarta-oro-2.0.jar"/>
<exclude name="**/.nbattrs"/>
</zipfileset>
<zipfileset dir="." fullpath="pmd.nbm" includes="build/pmd.nbm"/>
</zip>
<zip compress="true" destfile="build/pmd-netbeans35-bin-${VERSION}.zip">
<zipfileset dir=".">
<include name="*.txt"/>
</zipfileset>
<zipfileset dir="." fullpath="pmd.nbm" includes="build/pmd.nbm"/>
</zip>
</target>
<target description="Clean all build products." name="clean">
<delete dir="build"/>
</target>
</project>