forked from phoedos/pmd
6b99d7c048
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@2336 51baf565-9d33-0410-a72c-fc3788e3496d
129 lines
9.6 KiB
XML
129 lines
9.6 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project name="net.sourceforge.pmd.eclipse" default="build.jars" basedir=".">
|
|
|
|
<property name="bootclasspath" value=""/>
|
|
<property name="ws" value="win32"/>
|
|
<property name="os" value="win32"/>
|
|
<property name="arch" value="x86"/>
|
|
<property name="javacFailOnError" value="false"/>
|
|
<property name="javacDebugInfo" value="on"/>
|
|
<property name="javacVerbose" value="true"/>
|
|
|
|
<target name="init" depends="properties">
|
|
<property name="plugin" value="net.sourceforge.pmd.eclipse"/>
|
|
<property name="version.suffix" value="_1.2.0"/>
|
|
<property name="full.name" value="${plugin}${version.suffix}"/>
|
|
<property name="temp.folder" value="${basedir}/temp.folder"/>
|
|
<property name="plugin.destination" value="${basedir}"/>
|
|
<property name="build.result.folder" value="${basedir}"/>
|
|
</target>
|
|
|
|
<target name="properties" if="eclipse.running">
|
|
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
|
|
</target>
|
|
|
|
<target name="build.update.jar" depends="init" description="Build the plug-in: net.sourceforge.pmd.eclipse for an update site.">
|
|
<delete dir="${temp.folder}"/>
|
|
<mkdir dir="${temp.folder}"/>
|
|
<antcall target="build.jars"/>
|
|
<antcall target="gather.bin.parts">
|
|
<param name="destination.temp.folder" value="${temp.folder}/"/>
|
|
</antcall>
|
|
<zip zipfile="${plugin.destination}/${full.name}.jar" basedir="${temp.folder}/${full.name}" filesonly="false" update="no"/>
|
|
<delete dir="${temp.folder}"/>
|
|
</target>
|
|
|
|
<target name="gather.bin.parts" depends="init" if="destination.temp.folder">
|
|
<mkdir dir="${destination.temp.folder}/${full.name}"/>
|
|
<copy file="${build.result.folder}/pmd-eclipse.jar" todir="${destination.temp.folder}/${full.name}"/>
|
|
<copy todir="${destination.temp.folder}/${full.name}">
|
|
<fileset dir="${basedir}" includes="icons/*,lib/*,nl/**/*.properties,*.txt,doc.zip,log4j.*,message.properties,plugin.properties,plugin.xml,plugin_fr.properties,toc.xml" excludes="src/,CVS/,*.classpath,*.project"/>
|
|
</copy>
|
|
</target>
|
|
|
|
<target name="pmd-eclipse.jar" depends="init" unless="pmd-eclipse.jar" description="Create jar: pmd-eclipse.jar.">
|
|
<property name="destdir" value="${temp.folder}/pmd-eclipse.jar.bin"/>
|
|
<delete dir="${temp.folder}/pmd-eclipse.jar.bin"/>
|
|
<mkdir dir="${temp.folder}/pmd-eclipse.jar.bin"/>
|
|
<!-- compile the source code -->
|
|
<javac destdir="${temp.folder}/pmd-eclipse.jar.bin" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bootclasspath}" classpath="../../../../Program Files/eclipse/plugins/org.eclipse.core.boot_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.core.boot_2.1.0/boot.jar;lib/log4j-1.2.8.jar;lib/commons-logging.jar;lib/pmd-1.3.jar;lib/jaxen-core-1.0-fcs.jar;lib/saxpath-1.0-fcs.jar;../../../../Program Files/eclipse/plugins/org.eclipse.core.runtime_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.core.runtime_2.1.0/runtime.jar;../../../../Program Files/eclipse/plugins/org.apache.xerces_4.0.7/bin;../../../../Program Files/eclipse/plugins/org.apache.xerces_4.0.7/xmlParserAPIs.jar;../../../../Program Files/eclipse/plugins/org.apache.xerces_4.0.7/xercesImpl.jar;../../../../Program Files/eclipse/plugins/org.eclipse.core.resources_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.core.resources_2.1.0/resources.jar;../../../../Program Files/eclipse/plugins/org.eclipse.core.resources.win32_2.1.0/resources.jar;../../../../Program Files/eclipse/plugins/org.eclipse.ui_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.ui_2.1.0/ui.jar;../../../../Program Files/eclipse/plugins/org.eclipse.update.core_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.update.core_2.1.0/updatecore.jar;../../../../Program Files/eclipse/plugins/org.eclipse.update.core.win32_2.1.0/updatecore.jar;../../../../Program Files/eclipse/plugins/org.eclipse.help_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.help_2.1.0/help.jar;../../../../Program Files/eclipse/plugins/org.apache.lucene_1.2.1/bin;../../../../Program Files/eclipse/plugins/org.apache.lucene_1.2.1/parser.jar;../../../../Program Files/eclipse/plugins/org.apache.lucene_1.2.1/lucene-1.2.jar;../../../../Program Files/eclipse/plugins/org.eclipse.help.appserver_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.help.appserver_2.1.0/appserver.jar;../../../../Program Files/eclipse/plugins/org.eclipse.swt_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.swt_2.1.0/ws/${ws}/swt.jar;../../../../Program Files/eclipse/plugins/org.eclipse.swt.win32_2.1.0/ws/${ws}/swt.jar;../../../../Program Files/eclipse/plugins/org.eclipse.text_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.text_2.1.0/text.jar;../../../../Program Files/eclipse/plugins/org.eclipse.jface_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.jface_2.1.0/jface.jar;../../../../Program Files/eclipse/plugins/org.eclipse.jface.text_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.jface.text_2.1.0/jfacetext.jar;../../../../Program Files/eclipse/plugins/org.eclipse.ui.views_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.ui.views_2.1.0/views.jar;../../../../Program Files/eclipse/plugins/org.eclipse.ui.workbench_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.ui.workbench_2.1.0/workbench.jar;../../../../Program Files/eclipse/plugins/org.eclipse.ui.win32_2.1.0/workbench.jar;../../../../Program Files/eclipse/plugins/org.eclipse.ui.win32_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.ui.win32_2.1.0/workbenchwin32.jar;../../../../Program Files/eclipse/plugins/org.eclipse.ui.workbench.texteditor_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.ui.workbench.texteditor_2.1.0/texteditor.jar;../../../../Program Files/eclipse/plugins/org.eclipse.ui.editors_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.ui.editors_2.1.0/editors.jar;../../../../Program Files/eclipse/plugins/org.eclipse.jdt.core_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.jdt.core_2.1.0/jdtcore.jar;../../../../Program Files/eclipse/plugins/org.eclipse.ant.core_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.ant.core_2.1.0/antsupport.jar;../../../../Program Files/eclipse/plugins/org.eclipse.team.core_2.1.0/bin;../../../../Program Files/eclipse/plugins/org.eclipse.team.core_2.1.0/team.jar">
|
|
<src path="src/"/>
|
|
</javac>
|
|
<!-- copy necessary resources -->
|
|
<copy todir="${temp.folder}/pmd-eclipse.jar.bin">
|
|
<fileset dir="src/" excludes="**/*.java"/>
|
|
</copy>
|
|
<mkdir dir="${build.result.folder}"/>
|
|
<jar jarfile="${build.result.folder}/pmd-eclipse.jar" basedir="${temp.folder}/pmd-eclipse.jar.bin"/>
|
|
<delete dir="${temp.folder}/pmd-eclipse.jar.bin"/>
|
|
</target>
|
|
|
|
<target name="pmd-eclipsesrc.zip" depends="init" unless="pmd-eclipse.jar">
|
|
<mkdir dir="${build.result.folder}"/>
|
|
<zip zipfile="${build.result.folder}/pmd-eclipsesrc.zip" filesonly="false" update="no">
|
|
<fileset dir="src/" includes="**/*.java"/>
|
|
</zip>
|
|
</target>
|
|
|
|
<target name="build.jars" depends="init" description="Build all the jars for the plug-in: net.sourceforge.pmd.eclipse.">
|
|
<available property="pmd-eclipse.jar" file="${build.result.folder}/pmd-eclipse.jar"/>
|
|
<antcall target="pmd-eclipse.jar"/>
|
|
</target>
|
|
|
|
<target name="build.sources" depends="init">
|
|
<available property="pmd-eclipsesrc.zip" file="${build.result.folder}/pmd-eclipsesrc.zip"/>
|
|
<antcall target="pmd-eclipsesrc.zip"/>
|
|
</target>
|
|
|
|
<target name="build.zips" depends="init">
|
|
</target>
|
|
|
|
<target name="gather.sources" depends="init" if="destination.temp.folder">
|
|
<mkdir dir="${destination.temp.folder}/${full.name}"/>
|
|
<copy file="${build.result.folder}/pmd-eclipsesrc.zip" todir="${destination.temp.folder}/${full.name}"/>
|
|
<copy todir="${destination.temp.folder}/${full.name}">
|
|
<fileset dir="${basedir}" includes="*" excludes="*.jar"/>
|
|
</copy>
|
|
</target>
|
|
|
|
<target name="gather.logs" depends="init" if="destination.temp.folder">
|
|
<mkdir dir="${destination.temp.folder}/${full.name}"/>
|
|
<copy file="${temp.folder}/pmd-eclipse.jar.bin.log" todir="${destination.temp.folder}/${full.name}"/>
|
|
</target>
|
|
|
|
<target name="clean" depends="init" description="Clean the plug-in: net.sourceforge.pmd.eclipse of all the zips, jars and logs created.">
|
|
<delete file="${build.result.folder}/pmd-eclipse.jar"/>
|
|
<delete file="${build.result.folder}/pmd-eclipsesrc.zip"/>
|
|
<delete file="${plugin.destination}/${full.name}.jar"/>
|
|
<delete file="${plugin.destination}/${full.name}.zip"/>
|
|
<delete dir="${temp.folder}"/>
|
|
</target>
|
|
|
|
<target name="refresh" depends="init" if="eclipse.running">
|
|
<eclipse.convertPath fileSystemPath="c:\documents\JavaDev\PMD\pmd-eclipse\" property="resourcePath"/>
|
|
<eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
|
|
</target>
|
|
|
|
<target name="zip.plugin" depends="init" description="Create a zip containing all the elements for the plug-in: net.sourceforge.pmd.eclipse.">
|
|
<delete dir="${temp.folder}"/>
|
|
<mkdir dir="${temp.folder}"/>
|
|
<antcall target="build.jars"/>
|
|
<antcall target="build.sources"/>
|
|
<antcall target="gather.bin.parts">
|
|
<param name="destination.temp.folder" value="${temp.folder}/"/>
|
|
</antcall>
|
|
<antcall target="gather.sources">
|
|
<param name="destination.temp.folder" value="${temp.folder}/"/>
|
|
</antcall>
|
|
<delete>
|
|
<fileset dir="${temp.folder}" includes="**/*.bin.log"/>
|
|
</delete>
|
|
<antcall target="zip.folder"/>
|
|
<delete dir="${temp.folder}"/>
|
|
</target>
|
|
<target name="zip.folder" depends="init">
|
|
<zip zipfile="${plugin.destination}/${full.name}.zip" basedir="${temp.folder}" filesonly="true" update="no" excludes="**/*.bin.log"/>
|
|
</target>
|
|
|
|
</project>
|