476 lines
20 KiB
XML
Executable File
476 lines
20 KiB
XML
Executable File
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- You may freely edit this file. See commented blocks below for -->
|
|
<!-- some examples of how to customize the build. -->
|
|
<!-- (If you delete it and reopen the project it will be recreated.) -->
|
|
<project name="webclient" default="default" basedir=".">
|
|
<description>Builds, tests, and runs the project webclient.</description>
|
|
<import file="nbproject/build-impl.xml"/>
|
|
|
|
<!--
|
|
|
|
There exist several targets which are by default empty and which can be
|
|
used for execution of your tasks. These targets are usually executed
|
|
before and after some main targets. They are:
|
|
|
|
-pre-init: called before initialization of project properties
|
|
-post-init: called after initialization of project properties
|
|
-pre-compile: called before javac compilation
|
|
-post-compile: called after javac compilation
|
|
-pre-compile-single: called before javac compilation of single file
|
|
-post-compile-single: called after javac compilation of single file
|
|
-pre-compile-test: called before javac compilation of JUnit tests
|
|
-post-compile-test: called after javac compilation of JUnit tests
|
|
-pre-compile-test-single: called before javac compilation of single JUnit test
|
|
-post-compile-test-single: called after javac compilation of single JUunit test
|
|
-pre-jar: called before JAR building
|
|
-post-jar: called after JAR building
|
|
-post-clean: called after cleaning build products
|
|
|
|
(Targets beginning with '-' are not intended to be called on their own.)
|
|
|
|
Example of inserting an obfuscator after compilation could look like this:
|
|
|
|
<target name="-post-compile">
|
|
<obfuscate>
|
|
<fileset dir="${build.classes.dir}"/>
|
|
</obfuscate>
|
|
</target>
|
|
|
|
For list of available properties check the imported
|
|
nbproject/build-impl.xml file.
|
|
|
|
|
|
Another way to customize the build is by overriding existing main targets.
|
|
The targets of interest are:
|
|
|
|
-init-macrodef-javac: defines macro for javac compilation
|
|
-init-macrodef-junit: defines macro for junit execution
|
|
-init-macrodef-debug: defines macro for class debugging
|
|
-init-macrodef-java: defines macro for class execution
|
|
-do-jar-with-manifest: JAR building (if you are using a manifest)
|
|
-do-jar-without-manifest: JAR building (if you are not using a manifest)
|
|
run: execution of project
|
|
-javadoc-build: Javadoc generation
|
|
test-report: JUnit report generation
|
|
|
|
An example of overriding the target for project execution could look like this:
|
|
|
|
<target name="run" depends="webclient-impl.jar">
|
|
<exec dir="bin" executable="launcher.exe">
|
|
<arg file="${dist.jar}"/>
|
|
</exec>
|
|
</target>
|
|
|
|
Notice that the overridden target depends on the jar target and not only on
|
|
the compile target as the regular run target does. Again, for a list of available
|
|
properties which you can use, check the target you are overriding in the
|
|
nbproject/build-impl.xml file.
|
|
|
|
-->
|
|
|
|
<target name="-pre-init">
|
|
|
|
<condition property="so.prefix" value="">
|
|
<and>
|
|
<os family="windows" />
|
|
</and>
|
|
</condition>
|
|
|
|
<condition property="so.prefix" value="lib">
|
|
<and>
|
|
<os family="unix" />
|
|
</and>
|
|
</condition>
|
|
|
|
<condition property="so.extension" value="dll">
|
|
<and>
|
|
<os family="windows" />
|
|
</and>
|
|
</condition>
|
|
|
|
<condition property="so.extension" value="dylib">
|
|
<and>
|
|
<os name="Mac OS X" />
|
|
</and>
|
|
</condition>
|
|
|
|
<condition property="so.extension" value="so">
|
|
<and>
|
|
<os family="unix" />
|
|
</and>
|
|
</condition>
|
|
|
|
<condition property="platform" value="win32">
|
|
<and>
|
|
<os family="windows" />
|
|
</and>
|
|
</condition>
|
|
|
|
<condition property="platform" value="macosx">
|
|
<and>
|
|
<os name="Mac OS X" />
|
|
</and>
|
|
</condition>
|
|
|
|
<condition property="platform" value="unix">
|
|
<and>
|
|
<os family="unix" />
|
|
</and>
|
|
</condition>
|
|
|
|
<condition property="build.unix.classes">
|
|
<and>
|
|
<isset property="platform" />
|
|
<equals arg1="${platform}" arg2="unix" />
|
|
</and>
|
|
</condition>
|
|
|
|
<condition property="build.win32.classes">
|
|
<and>
|
|
<isset property="platform" />
|
|
<equals arg1="${platform}" arg2="win32" />
|
|
</and>
|
|
</condition>
|
|
|
|
<condition property="build.mac.classes">
|
|
<and>
|
|
<isset property="platform" />
|
|
<equals arg1="${platform}" arg2="macosx" />
|
|
</and>
|
|
</condition>
|
|
|
|
<condition property="PATH_SEP" value=";">
|
|
<and>
|
|
<os family="windows" />
|
|
</and>
|
|
</condition>
|
|
|
|
<condition property="PATH_SEP" value=":">
|
|
<and>
|
|
<os family="unix" />
|
|
</and>
|
|
</condition>
|
|
|
|
<condition property="FILE_PATH_SEP" value="\">
|
|
<and>
|
|
<os family="windows" />
|
|
</and>
|
|
</condition>
|
|
|
|
<condition property="FILE_PATH_SEP" value="/">
|
|
<and>
|
|
<os family="unix" />
|
|
</and>
|
|
</condition>
|
|
|
|
<property file="webclient.properties" />
|
|
|
|
<path id="javaxpcom.path">
|
|
<pathelement path="${javaxpcom.jar}:${MozillaInterfaces.jar}" />
|
|
</path>
|
|
|
|
<condition property="preconditions.met">
|
|
<and>
|
|
<or>
|
|
<available file="${browser.bin.dir}/${so.prefix}xul.${so.extension}" />
|
|
<available file="${browser.bin.dir}/${so.prefix}xpcom.${so.extension}" />
|
|
</or>
|
|
<available file="${javaxpcom.jar}" />
|
|
<available file="${MozillaInterfaces.jar}" />
|
|
</and>
|
|
</condition>
|
|
|
|
<uptodate property="do.copy.binaries">
|
|
<srcfiles dir="${basedir}/../bin/${platform}/bin" includes="**/*.*" />
|
|
<mapper type="identity" to="${browser.bin.dir}/**/*.*" />
|
|
</uptodate>
|
|
|
|
<fail unless="preconditions.met">
|
|
|
|
Conditions for compilation have not been met.
|
|
Have you verified that the property browser.bin.dir has been set
|
|
to the binary directory of the host browser in the webclient.properties
|
|
file? The current value of this property is:
|
|
${browser.bin.dir} and this directory must contain the file
|
|
${so.prefix}xul.${so.extension}.
|
|
|
|
Also, you must make sure the properties javaxpcom.jar and
|
|
MozillaInterfaces.jar are valid.
|
|
javaxpcom.jar is currently ${javaxpcom.jar}
|
|
MozillaInterfaces.jar is currently ${MozillaInterfaces.jar}
|
|
</fail>
|
|
|
|
</target>
|
|
|
|
<target name="-post-init">
|
|
<antcall target="copy.binaries" />
|
|
<antcall target="copy.test.data" />
|
|
</target>
|
|
|
|
<target name="-post-clean">
|
|
<delete>
|
|
<fileset dir="${browser.bin.dir}"
|
|
includes="${bin.artifacts.pattern}"/>
|
|
</delete>
|
|
</target>
|
|
|
|
<target name="copy.binaries" if="do.copy.binaries">
|
|
<copy todir="${browser.bin.dir}">
|
|
<fileset dir="${basedir}/../bin/${platform}/bin" />
|
|
</copy>
|
|
</target>
|
|
|
|
<target name="copy.test.data">
|
|
<copy todir="${build.test.results.dir}">
|
|
<fileset dir="${basedir}/../test/automated/src/main/resources" />
|
|
</copy>
|
|
</target>
|
|
|
|
<target name="run" depends="-init-check">
|
|
|
|
<property name="debug.jvm.args" value="" />
|
|
<property name="http.proxyHost" value="" />
|
|
<property name="http.proxyPort" value="" />
|
|
<property name="http.nonProxyHosts" value="" />
|
|
<property name="test.browser.url"
|
|
value="${basedir}/../2_0_alpha_9.html" />
|
|
|
|
<java classname="org.mozilla.webclient.test.TestBrowser" fork="true">
|
|
<jvmarg value="-DNSPR_LOG_MODULES=javadom:4,webclient:4,webclientstub:4,pluglets:4"/>
|
|
<env key="NSPR_LOG_MODULES" value="${nspr.log.modules}" />
|
|
<jvmarg value="-DNSPR_LOG_FILE=${basedir}${FILE_PATH_SEP}${build.dir}${FILE_PATH_SEP}webclient.log"/>
|
|
<env key="NSPR_LOG_FILE" file="${basedir}/${build.dir}/${nspr.log.filename}" />
|
|
<jvmarg value="-Dbuild.test.results.dir=${basedir}${FILE_PATH_SEP}${build.test.results.dir}" />
|
|
<jvmarg value="-DBROWSER_BIN_DIR=${browser.bin.dir}"/>
|
|
<jvmarg value="-Dhttp.proxyHost=${http.proxyHost}" />
|
|
<jvmarg value="-Dhttp.proxyPort=${http.proxyPort}" />
|
|
<jvmarg value="-Dhttp.nonProxyHosts=${http.nonProxyHosts}" />
|
|
<jvmarg line="${debug.jvm.args}"/>
|
|
<jvmarg line="-Djava.util.logging.config.file=${basedir}${FILE_PATH_SEP}logging.properties"/>
|
|
<jvmarg line="-Djava.library.path=${browser.bin.dir}" />
|
|
<arg value="${test.browser.url}" />
|
|
|
|
|
|
<classpath>
|
|
<path path="${run.test.classpath}"/>
|
|
<path refid="javaxpcom.path" />
|
|
</classpath>
|
|
|
|
</java>
|
|
</target>
|
|
|
|
<target name="-init-macrodef-javac">
|
|
<macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
|
|
<attribute name="srcdir" default="${src.dir}"/>
|
|
<attribute name="destdir" default="${build.classes.dir}"/>
|
|
<attribute name="classpath" default="${javac.classpath}"/>
|
|
<attribute name="debug" default="${javac.debug}"/>
|
|
<element name="customize" optional="true"/>
|
|
<sequential>
|
|
<javac srcdir="@{srcdir}" destdir="@{destdir}" debug="@{debug}" deprecation="${javac.deprecation}" source="${javac.source}" target="${javac.target}" includeantruntime="false">
|
|
<classpath>
|
|
<path path="@{classpath}"/>
|
|
<path refid="javaxpcom.path" />
|
|
</classpath>
|
|
<compilerarg line="${javac.compilerargs}"/>
|
|
<customize/>
|
|
|
|
<patternset>
|
|
<exclude name="**/*Gtk*.java" if="build.mac.classes"/>
|
|
<exclude name="**/*Win32*.java" if="build.mac.classes"/>
|
|
</patternset>
|
|
|
|
<patternset>
|
|
<exclude name="**/*Win32*.java" if="build.unix.classes"/>
|
|
<exclude name="**/*Cocoa*.java" if="build.unix.classes"/>
|
|
</patternset>
|
|
|
|
<patternset>
|
|
<exclude name="**/*Gtk*.java" if="build.win32.classes"/>
|
|
<exclude name="**/*Cocoa*.java" if="build.win32.classes"/>
|
|
</patternset>
|
|
|
|
</javac>
|
|
</sequential>
|
|
</macrodef>
|
|
</target>
|
|
|
|
<target name="-init-macrodef-junit">
|
|
<property name="debug.jvm.args" value="" />
|
|
<property name="http.proxyHost" value="" />
|
|
<property name="http.proxyPort" value="" />
|
|
<property name="http.nonProxyHosts" value="" />
|
|
|
|
<macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
|
|
<attribute name="includes" default="**/*Test.java"/>
|
|
<sequential>
|
|
<echo message="overridden JUnit" />
|
|
<junit showoutput="true" fork="true" dir="${basedir}" failureproperty="tests.failed" errorproperty="tests.failed">
|
|
<jvmarg value="-DNSPR_LOG_MODULES=${nspr.log.modules}"/>
|
|
<env key="NSPR_LOG_MODULES" value="${nspr.log.modules}" />
|
|
<jvmarg value="-DNSPR_LOG_FILE=${basedir}${FILE_PATH_SEP}${build.dir}${FILE_PATH_SEP}${nspr.log.filename}"/>
|
|
<env key="NSPR_LOG_FILE" file="${basedir}/${build.dir}/${nspr.log.filename}" />
|
|
<jvmarg value="-Dbuild.test.results.dir=${basedir}${FILE_PATH_SEP}${build.test.results.dir}" />
|
|
<jvmarg value="-DBROWSER_BIN_DIR=${browser.bin.dir}"/>
|
|
<jvmarg value="-Dhttp.proxyHost=${http.proxyHost}" />
|
|
<jvmarg value="-Dhttp.proxyPort=${http.proxyPort}" />
|
|
<jvmarg value="-Dhttp.nonProxyHosts=${http.nonProxyHosts}" />
|
|
<jvmarg line="${debug.jvm.args}"/>
|
|
<jvmarg line="-Djava.util.logging.config.file=${basedir}${FILE_PATH_SEP}logging.properties"/>
|
|
<jvmarg line="-Djava.library.path=${browser.bin.dir}" />
|
|
|
|
<batchtest todir="${build.test.results.dir}">
|
|
<fileset dir="${test.src.dir}" includes="@{includes}"
|
|
excludes="${test.excludes}"/>
|
|
</batchtest>
|
|
<classpath>
|
|
<path path="${run.test.classpath}"/>
|
|
<path refid="javaxpcom.path" />
|
|
</classpath>
|
|
<syspropertyset>
|
|
<propertyref prefix="test-sys-prop."/>
|
|
<mapper type="glob" from="test-sys-prop.*" to="*"/>
|
|
</syspropertyset>
|
|
<formatter type="brief" usefile="false"/>
|
|
<formatter type="xml"/>
|
|
<jvmarg line="${run.jvmargs}"/>
|
|
</junit>
|
|
</sequential>
|
|
</macrodef>
|
|
</target>
|
|
|
|
<target name="-init-macrodef-debug">
|
|
<property name="http.proxyHost" value="" />
|
|
<property name="http.proxyPort" value="" />
|
|
<property name="http.nonProxyHosts" value="" />
|
|
|
|
<macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
|
|
<attribute name="classname" default="${main.class}"/>
|
|
<attribute name="classpath" default="${debug.classpath}"/>
|
|
<element name="customize" optional="true"/>
|
|
<sequential>
|
|
<echo message="overridden Debug" />
|
|
<java fork="true" classname="@{classname}" dir="${work.dir}">
|
|
<jvmarg value="-Xdebug"/>
|
|
<jvmarg value="-Xnoagent"/>
|
|
<jvmarg value="-Djava.compiler=none"/>
|
|
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
|
|
<jvmarg value="-DNSPR_LOG_MODULES=javadom:4,webclient:4,webclientstub:4,pluglets:4"/>
|
|
<env key="NSPR_LOG_MODULES" value="${nspr.log.modules}" />
|
|
<jvmarg value="-DNSPR_LOG_FILE=${basedir}${FILE_PATH_SEP}${build.dir}${FILE_PATH_SEP}webclient.log"/>
|
|
<env key="NSPR_LOG_FILE" file="${basedir}/${build.dir}/${nspr.log.filename}" />
|
|
<jvmarg value="-Dbuild.test.results.dir=${basedir}${FILE_PATH_SEP}${build.test.results.dir}" />
|
|
<jvmarg value="-DBROWSER_BIN_DIR=${browser.bin.dir}"/>
|
|
<jvmarg value="-Dhttp.proxyHost=${http.proxyHost}" />
|
|
<jvmarg value="-Dhttp.proxyPort=${http.proxyPort}" />
|
|
<jvmarg value="-Dhttp.nonProxyHosts=${http.nonProxyHosts}" />
|
|
<jvmarg line="-Djava.util.logging.config.file=${basedir}${FILE_PATH_SEP}logging.properties"/>
|
|
<jvmarg line="-Djava.library.path=${browser.bin.dir}" />
|
|
<jvmarg line="${run.jvmargs}"/>
|
|
<arg value="${test.browser.url}" />
|
|
<classpath>
|
|
<path path="@{classpath}"/>
|
|
<path refid="javaxpcom.path" />
|
|
</classpath>
|
|
<syspropertyset>
|
|
<propertyref prefix="run-sys-prop."/>
|
|
<mapper type="glob" from="run-sys-prop.*" to="*"/>
|
|
</syspropertyset>
|
|
<customize/>
|
|
</java>
|
|
</sequential>
|
|
</macrodef>
|
|
</target>
|
|
|
|
<target name="compile.core.src" depends="-init-check">
|
|
<antcall target="compile">
|
|
<param name="src.dir" value="${basedir}/../src/main/java" />
|
|
</antcall>
|
|
<!-- set up the interface to implementation mapings -->
|
|
<mkdir dir="${build.classes.dir}/META-INF/services"/>
|
|
<echo file="${build.classes.dir}/META-INF/services/org.mozilla.webclient.WebclientFactory">org.mozilla.webclient.impl.WebclientFactoryImpl</echo>
|
|
<echo file="${build.classes.dir}/META-INF/services/org.mozilla.webclient.impl.WrapperFactory">org.mozilla.webclient.impl.wrapper_native.WrapperFactoryImpl</echo>
|
|
|
|
<move failonerror="false" file="${file.reference.webclient-2_0_a9.jar}"
|
|
tofile="${basedir}/../lib/outofdate-webclient_jar" />
|
|
|
|
</target>
|
|
|
|
<target name="copy.core.src.to.mozilla.cvs.workarea" depends="-init-check">
|
|
|
|
<!-- copy test browser files -->
|
|
<copy todir="${mozilla.cvs.workarea}/webclient/test/manual/src/classes">
|
|
<fileset dir="${basedir}/../test/manual/src/main/java">
|
|
<exclude name="cardemo/**/*.*" />
|
|
<exclude name="immosearch/**/*.*" />
|
|
<exclude name="jsf_jmaki/**/*.*" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<copy todir="${mozilla.cvs.workarea}/webclient/classes_spec">
|
|
<fileset dir="${basedir}/../src/main/java">
|
|
<include name="org/mozilla/mcp/**/*.*" />
|
|
<include name="org/mozilla/webclient/**/*.*" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<!-- copy dom sources -->
|
|
<copy todir="${mozilla.cvs.workarea}/dom/classes">
|
|
<fileset dir="${basedir}/../src/main/java">
|
|
<include name="org/mozilla/dom/**/*.*" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<!-- copy util soucres -->
|
|
<copy todir="${mozilla.cvs.workarea}/util/classes">
|
|
<fileset dir="${basedir}/../src/main/java">
|
|
<include name="org/mozilla/util/**/*.*" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<!-- copy JUnit tests -->
|
|
<copy todir="${mozilla.cvs.workarea}/webclient/test/automated/src/classes">
|
|
<fileset dir="${basedir}/../test/automated/src/main/java">
|
|
<include name="org/**/*.*" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<!-- copy MCP tests -->
|
|
<copy todir="${mozilla.cvs.workarea}/dist/mcp-test/src/test/java">
|
|
<fileset dir="${basedir}/../test/automated/src/main/java">
|
|
<include name="cardemo/**/*.*" />
|
|
<include name="immosearch/**/*.*" />
|
|
<include name="jsf_jmaki/**/*.*" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<!-- copy stub main files -->
|
|
<copy todir="${mozilla.cvs.workarea}/dist/mcp-test/src/main/java">
|
|
<fileset dir="${basedir}/../test/manual/src/main/java">
|
|
<include name="cardemo/**/*.*" />
|
|
<include name="immosearch/**/*.*" />
|
|
<include name="jsf_jmaki/**/*.*" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
<!-- copy build files -->
|
|
<copy todir="${mozilla.cvs.workarea}/dist/netbeans">
|
|
<fileset dir="${basedir}">
|
|
<include name="build.xml" />
|
|
<include name="webclient.properties" />
|
|
<include name="logging.properties" />
|
|
<include name="nbproject/build-impl.xml" />
|
|
<include name="nbproject/project.properties" />
|
|
<include name="nbproject/project.xml" />
|
|
</fileset>
|
|
</copy>
|
|
|
|
|
|
|
|
|
|
</target>
|
|
|
|
|
|
|
|
</project>
|