Files
jpexs-decompiler/build_common.xml
2014-05-10 20:50:57 +02:00

401 lines
18 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<project name="common build script" default="all" basedir=".">
<description>Builds project</description>
<property name="DISTLIBRARIESFULLDIR" value="${DISTRIBUTIONDIR}/${DISTLIBRARIESDIRNAME}"/>
<patternset id="compiler.resources">
<include name="**/?*.properties"/>
<include name="**/?*.bin"/>
<include name="**/?*.xml"/>
<include name="**/?*.txt"/>
<include name="**/?*.gif"/>
<include name="**/?*.png"/>
<include name="**/?*.jpeg"/>
<include name="**/?*.jpg"/>
<include name="**/?*.html"/>
<include name="**/?*.dtd"/>
<include name="**/?*.tld"/>
<include name="**/?*.mid"/>
<include name="**/?*.wav"/>
<include name="**/?*.js"/>
</patternset>
<path id="emma.lib">
<pathelement location="${TESTLIBDIR}/emma.jar"/>
<pathelement location="${TESTLIBDIR}/emma_ant.jar"/>
</path>
<taskdef resource="emma_ant.properties" classpathref="emma.lib"/>
<target name="coverage.instrumentation">
<mkdir dir="${INSTRDIR}"/>
<mkdir dir="${COVERAGEDIR}"/>
<emma>
<instr instrpath="${COMPILEDIR}" destdir="${INSTRDIR}" metadatafile="${COVERAGEDIR}/metadata.emma"
mode="copy">
</instr>
</emma>
<copy todir="${INSTRDIR}">
<fileset dir="${SOURCEDIR}">
<patternset refid="compiler.resources" />
<type type="file" />
</fileset>
</copy>
</target>
<target name="compile">
<!--<delete dir="${COMPILEDIR}"/>-->
<mkdir dir="${COMPILEDIR}"/>
<javac srcdir="${SOURCEDIR}" destdir="${COMPILEDIR}" includes="**/*.java" target="${TARGETJAVA}" source="${TARGETJAVA}" debug="true"
debuglevel="lines,vars,source" includeantruntime="false" encoding="utf-8">
<compilerarg line="-Xlint:unchecked"/> <!-- For Java 8: -Xdiags:verbose -->
<classpath>
<fileset dir="${LIBRARIESDIR}" includes="**/*.jar"/>
</classpath>
</javac>
<copy todir="${COMPILEDIR}">
<fileset dir="${SOURCEDIR}">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
<target name="compile-tests">
<delete dir="${COMPILETESTSDIR}"/>
<mkdir dir="${COMPILETESTSDIR}"/>
<javac srcdir="${TESTDIR}" destdir="${COMPILETESTSDIR}" includes="**/*.java" target="${TARGETJAVA}" source="${TARGETJAVA}" debug="true" includeantruntime="false" encoding="utf-8">
<classpath>
<pathelement path="${COMPILEDIR}"/>
<fileset dir="${LIBRARIESDIR}" includes="**/*.jar"/>
<fileset dir="${TESTLIBDIR}" includes="**/*.jar"/>
</classpath>
</javac>
</target>
<target name="test" depends="compile,compile-tests">
<delete dir="${TESTRESULTSDIR}"/>
<mkdir dir="${TESTRESULTSDIR}"/>
<mkdir dir="${TESTRESULTSDIR}/raw/"/>
<antcall target="coverage.instrumentation"/>
<taskdef classname="org.testng.TestNGAntTask" classpath="${TESTLIBDIR}/testng-6.8.jar" name="testng" />
<testng
outputDir="${TESTRESULTSDIR}"
haltOnFailure="false" verbose="2" workingDir="${basedir}" >
<classpath>
<pathelement path="${COMPILETESTSDIR}"/>
<pathelement path="${INSTRDIR}"/>
<pathelement path="${COMPILEDIR}"/>
<fileset dir="${LIBRARIESDIR}" includes="**/*.jar"/>
<fileset dir="${TESTLIBDIR}" includes="**/*.jar"/>
</classpath>
<jvmarg value="-noverify" />
<jvmarg value="-Demma.coverage.out.file=${COVERAGEDIR}/coverage.emma"/>
<jvmarg value="-Demma.coverage.out.merge=true"/>
<classfileset dir="${COMPILETESTSDIR}" includes="**/*.class" />
</testng>
<!-- Coverage report -->
<mkdir dir="${COVERAGERESULTSDIR}"/>
<emma>
<report sourcepath="${SOURCEDIR}" depth="method">
<fileset dir="${COVERAGEDIR}">
<include name="*.emma"/>
</fileset>
<html outfile="${COVERAGERESULTSDIR}/index.html" />
</report>
</emma>
</target>
<condition property="is_windows">
<os family="windows"/>
</condition>
<target name="installer" depends="dist" if="is_windows">
<echo message="#define MyAppVersion &quot;${VERSION}${VERSIONSUFFIX}&quot;" file="${INSTALLERCONFIG}" />
<exec dir="${basedir}" executable="${INNOSETUPPATH}\iscc.exe">
<arg file="${INSTALLERPROJECT}" />
</exec>
</target>
<target name="archive" depends="dist">
<mkdir dir="${RELEASESDIR}"/>
<zip destfile="${RELEASESDIR}/${PREFIXFILENAME}_${VERSION}${VERSIONSUFFIX}.zip" basedir="${DISTRIBUTIONDIR}" />
</target>
<target name="-exe-config">
<echoxml file="${EXECONFIG}">
<launch4jConfig>
<dontWrapJar>true</dontWrapJar>
<headerType>gui</headerType>
<jar>${JARFILENAME}.jar</jar>
<outfile>${DISTRIBUTIONDIR}/${EXEFILENAME}.exe</outfile>
<errTitle></errTitle>
<cmdLine></cmdLine>
<chdir></chdir>
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl></supportUrl>
<customProcName>false</customProcName>
<stayAlive>false</stayAlive>
<manifest></manifest>
<icon>${EXEICON}</icon>
<jre>
<path></path>
<minVersion>${MINJAVAVERSION}</minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
<maxHeapSize>${MAXHEAPSIZE}</maxHeapSize>
</jre>
<versionInfo>
<fileVersion>${VERSIONNUMBER}</fileVersion>
<txtFileVersion>${VERSION}${VERSIONSUFFIX}</txtFileVersion>
<fileDescription>${PRODUCTNAME}</fileDescription>
<copyright>${VENDOR}</copyright>
<productVersion>${VERSIONNUMBER}</productVersion>
<txtProductVersion>${VERSION}${VERSIONSUFFIX}</txtProductVersion>
<productName>${PRODUCTNAME}</productName>
<companyName></companyName>
<internalName>${INTERNALNAME}</internalName>
<originalFilename>${EXEFILENAME}.exe</originalFilename>
</versionInfo>
</launch4jConfig>
</echoxml>
</target>
<target name="-exe64-config">
<echoxml file="${EXE64CONFIG}">
<launch4jConfig>
<dontWrapJar>true</dontWrapJar>
<headerType>gui</headerType>
<jar>${JARFILENAME}.jar</jar>
<outfile>${DISTRIBUTIONDIR}/${EXE64FILENAME}.exe</outfile>
<errTitle></errTitle>
<cmdLine></cmdLine>
<chdir></chdir>
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl></supportUrl>
<customProcName>false</customProcName>
<stayAlive>false</stayAlive>
<manifest></manifest>
<icon>${EXEICON}</icon>
<jre>
<path></path>
<minVersion>${MINJAVAVERSION}</minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
<maxHeapSize>${MAXHEAPSIZE64}</maxHeapSize>
</jre>
<versionInfo>
<fileVersion>${VERSIONNUMBER}</fileVersion>
<txtFileVersion>${VERSION}${VERSIONSUFFIX}</txtFileVersion>
<fileDescription>${PRODUCTNAME}</fileDescription>
<copyright>${VENDOR}</copyright>
<productVersion>${VERSIONNUMBER}</productVersion>
<txtProductVersion>${VERSION}${VERSIONSUFFIX}</txtProductVersion>
<productName>${PRODUCTNAME}</productName>
<companyName></companyName>
<internalName>${INTERNALNAME}</internalName>
<originalFilename>${EXE64FILENAME}.exe</originalFilename>
</versionInfo>
</launch4jConfig>
</echoxml>
</target>
<target name="-exe-linux" unless="is_windows" depends="-exe-config">
<exec dir="${LAUNCH4JPATH}" executable="${LAUNCH4JPATH}/launch4j">
<arg file="${EXECONFIG}" />
</exec>
</target>
<target name="-exe-windows" if="is_windows" depends="-exe-config">
<exec dir="${LAUNCH4JPATH}" executable="${LAUNCH4JPATH}\launch4jc.exe">
<arg file="${EXECONFIG}" />
</exec>
</target>
<target name="-exe64-windows" if="is_windows" depends="-exe64-config">
<exec dir="${LAUNCH4JPATH}" executable="${LAUNCH4JPATH}\launch4jc.exe">
<arg file="${EXE64CONFIG}" />
</exec>
</target>
<target name="exe" depends="-exe-linux,-exe-windows,-exe64-windows">
</target>
<target name="release" depends="archive,installer,locales">
</target>
<target name="all" depends="clean,test,javadoc,release">
</target>
<target name="nightly">
<property name="NIGHTLY" value="true" />
<antcall target="all" />
</target>
<target name="dist" depends="build,exe">
<copy todir="${DISTRIBUTIONDIR}">
<fileset dir="${RESOURCESDIR}" includes="**/*.*"/>
</copy>
</target>
<target name="locales">
<delete dir="${LOCALESTARGETDIR}"/>
<mkdir dir="${LOCALESTARGETDIR}/${PROJECTNAME}"/>
<copy todir="${LOCALESTARGETDIR}/${PROJECTNAME}">
<fileset dir="${LOCALESDIR}" includes="**/*.*"/>
</copy>
<mkdir dir="${LOCALESTARGETDIR}/jsyntaxpane/bundle/"/>
<copy todir="${LOCALESTARGETDIR}/jsyntaxpane/bundle/">
<fileset dir="libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/jsyntaxpane" includes="**/*.*"/>
</copy>
<mkdir dir="${LOCALESTARGETDIR}/jsyntaxpane/defaultsyntaxkit"/>
<copy todir="${LOCALESTARGETDIR}/jsyntaxpane/defaultsyntaxkit">
<fileset dir="libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/defaultsyntaxkit" includes="**/*.*"/>
</copy>
<mkdir dir="${LOCALESTARGETDIR}/jsyntaxpane/syntaxkits/flasmsyntaxkit"/>
<copy todir="${LOCALESTARGETDIR}/jsyntaxpane/syntaxkits/flasmsyntaxkit">
<fileset dir="libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasmsyntaxkit" includes="**/config*.properties"/>
</copy>
<mkdir dir="${LOCALESTARGETDIR}/jsyntaxpane/syntaxkits/flasm3syntaxkit"/>
<copy todir="${LOCALESTARGETDIR}/jsyntaxpane/syntaxkits/flasm3syntaxkit">
<fileset dir="libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3syntaxkit" includes="**/config*.properties"/>
</copy>
<mkdir dir="${LOCALESTARGETDIR}/jsyntaxpane/syntaxkits/flasm3methodinfosyntaxkit"/>
<copy todir="${LOCALESTARGETDIR}/jsyntaxpane/syntaxkits/flasm3methodinfosyntaxkit">
<fileset dir="libsrc/jsyntaxpane/jsyntaxpane/src/main/resources/META-INF/services/jsyntaxpane/syntaxkits/flasm3methodinfosyntaxkit" includes="**/config*.properties"/>
</copy>
<echo file="${LOCALESTARGETDIR}/readme.txt">${PROJECTNAME} ${VERSION}${VERSIONSUFFIX} localization pack
-------------------------------------------------------------------
Please follow instructions on http://www.free-decompiler.com/flash/translations.html
</echo>
<zip destfile="${RELEASESDIR}/${PREFIXFILENAME}_${VERSION}${VERSIONSUFFIX}_lang.zip" basedir="${LOCALESTARGETDIR}"/>
</target>
<target name="-nightly-suffix" if="NIGHTLY">
<property name="VERSIONSUFFIX" value="_${MERCURIALTAG}"/>
</target>
<target name="-nonightly-suffix" unless="NIGHTLY">
<property name="VERSIONSUFFIX" value=""/>
</target>
<target name="-timestamp">
<tstamp>
<format property="BUILTAT" pattern="MM/dd/yyyy hh:mm aa" timezone="CET"/>
<format property="VERDATE" pattern="yyyyddMM_hhmm" timezone="CET"/>
</tstamp>
<exec executable="hg" outputproperty="MERCURIALTAG">
<arg value="id"/>
<arg value="-i"/>
</exec>
<echo message="Mercurial tag:${MERCURIALTAG}"/>
<echo message="Version: ${VERSION}"/>
</target>
<target name="build" depends="-timestamp,-nightly-suffix,-nonightly-suffix,compile">
<mkdir dir="${DISTRIBUTIONDIR}"/>
<!-- <delete dir="${DISTLIBRARIESFULLDIR}"/> -->
<mkdir dir="${DISTLIBRARIESFULLDIR}"/>
<copy todir="${DISTLIBRARIESFULLDIR}">
<fileset dir="${LIBRARIESDIR}" includes="**/*.jar"/>
<fileset dir="${LIBRARIESDIR}" includes="**/*.exe"/>
<fileset dir="${LIBRARIESDIR}" includes="**/*.txt"/>
</copy>
<propertyfile file="${COMPILEDIR}/${PROPERTIESNAME}"
comment="This file is automatically generated - DO NOT EDIT">
<entry key="buildtime" value="${BUILTAT}"/>
<entry key="build" value="${MERCURIALTAG}"/>
<entry key="builder" value="${BUILDER}"/>
<entry key="version" value="${VERSION}"/>
<entry key="nightly" value="${NIGHTLY}"/>
</propertyfile>
<pathconvert pathsep=" " property="manifestClassPath">
<fileset dir="${DISTRIBUTIONDIR}" includes="${DISTLIBRARIESDIRNAME}/**/*.*"/>
<chainedmapper>
<flattenmapper/>
<globmapper from="*" to="${DISTLIBRARIESDIRNAME}/*"/>
</chainedmapper>
</pathconvert>
<jar destfile="${DISTRIBUTIONDIR}/${JARFILENAME}.jar" basedir="${COMPILEDIR}">
<manifest>
<attribute name="Main-Class" value="${MAINCLASS}"/>
<attribute name="Class-Path" value="${manifestClassPath}"/>
</manifest>
</jar>
</target>
<target name="run" depends="build">
<java jar="${DISTRIBUTIONDIR}/${JARFILENAME}.jar" fork="true">
<jvmarg value="-Xmx${MAXHEAPSIZE}m"/>
<jvmarg value="-XX:MinHeapFreeRatio=0"/>
<jvmarg value="-XX:MaxHeapFreeRatio=0"/>
<arg line="${RUNPARAMS}" />
</java>
</target>
<target name="javadoc">
<mkdir dir="${JAVADOCDIR}"/>
<javadoc sourcepath="${SOURCEDIR}" destdir="${JAVADOCDIR}" windowtitle="${PROJECTNAME}"
useexternalfile="yes">
<fileset dir="${SOURCEDIR}" includes="**/*.java"/>
<classpath>
<fileset dir="${LIBRARIESDIR}" includes="**/*.jar"/>
</classpath>
</javadoc>
</target>
<target name="clean">
<delete dir="${DISTRIBUTIONDIR}"/>
<delete dir="${COMPILETESTSDIR}"/>
<delete dir="${COMPILEDIR}"/>
<delete dir="${COVERAGEDIR}"/>
<delete dir="${TESTRESULTSDIR}"/>
<delete dir="${LOCALESTARGETDIR}"/>
</target>
<!-- Debug one test method (Netbeans IDE) -->
<target name="debug-test-method" depends="compile-tests">
<fail unless="test.class">Must select one file in the IDE or set test.class</fail>
<fail unless="test.method">Must select some method in the IDE or set test.method</fail>
<delete dir="${TESTRESULTSDIR}"/>
<mkdir dir="${TESTRESULTSDIR}"/>
<mkdir dir="${TESTRESULTSDIR}/raw/"/>
<nbjpdastart addressproperty="jpda.address" name="ffdec" transport="dt_socket">
<classpath>
<pathelement path="${COMPILEDIR}"/>
<fileset dir="${LIBRARIESDIR}" includes="**/*.jar"/>
<fileset dir="${TESTLIBDIR}" includes="**/*.jar"/>
</classpath>
</nbjpdastart>
<taskdef classname="org.testng.TestNGAntTask" classpath="${TESTLIBDIR}/testng-6.8.jar" name="testng" />
<testng
outputDir="${TESTRESULTSDIR}"
haltOnFailure="false" verbose="2" workingDir="${basedir}" methods="${test.class}.${test.method}">
<classpath>
<pathelement path="${COMPILETESTSDIR}"/>
<pathelement path="${INSTRDIR}"/>
<pathelement path="${COMPILEDIR}"/>
<fileset dir="${LIBRARIESDIR}" includes="**/*.jar"/>
<fileset dir="${TESTLIBDIR}" includes="**/*.jar"/>
</classpath>
<jvmarg value="-noverify" />
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
<classfileset dir="${COMPILETESTSDIR}" includes="**/*.class" />
</testng>
</target>
</project>