export-build.xml.svn-base

来自「cqME :java framework for TCK test.」· SVN-BASE 代码 · 共 498 行 · 第 1/2 页

SVN-BASE
498
字号
    <target name="update-jar-size"             depends="init"            description="Upates MIDlet-Jar-Size attribute in the JAD file.">        <!-- Remove old MIDlet-Jar-Size property. Since the JAR has been updated             its value is no longer valid -->        <replaceregexp  file="${dist.dir}/${dist.jad}"                        match="MIDlet-Jar-Size:.*\n"                        replace=""/>        <!-- Generate and write new value of MIDlet-Jar-Size property -->        <length file="${dist.dir}/${dist.jar}" property="new.jar.size"/>        <echo file="${dist.dir}/${dist.jad}" append="true">MIDlet-Jar-Size: ${new.jar.size}</echo>    </target>        <target name="update-jar-url"            description="Upates MIDlet-Jar-URL attribute in the JAD file.">        <!--            Upates MIDlet-Jar-URL attribute in the JAD file.            This target requires 'run.method' property which should be defined            by 'init-impl' target. New JAR URL depends on the value of             'run-method' property:                STANDARD) MIDlet-Jar-URL={name of JAR file}. This URL is                           relative and should be used when running exported                          test in emulator or device supporting relative JAR                          URL. This is the case if you use NetBeand Mobility                          Pack with Sun Wireless Toolkit emulator.                OTA)      MIDlet-Jar-URL={prefix}{name of JAR file}, where                          {prefix} is the answer to 'Jar URL Prefix' question                          of the interview.                OTA-MEFW) MIDlet-Jar-URL=                          http://localhost:{port number}/{name of JAR file}                          where {port number} is defined by                           'provisioning.http.port' property in build.properties                          file. This run mode is used when the exported tests                          are deployed using exported provisioning server.                          To start the server run the 'run' target of this                          build script.        -->        <replaceregexp  file="${dist.dir}/${dist.jad}"                        match="MIDlet-Jar-URL:.*\n"                        replace=""/>        <condition property="new.jar.url" value="${bundle.id}.jar">            <equals arg1="${run.method}" arg2="STANDARD" casesensitive="false"/>        </condition>        <condition property="new.jar.url" value="${dist.jar.url}">            <equals arg1="${run.method}" arg2="OTA" casesensitive="false"/>        </condition>        <condition property="new.jar.url" value="http://localhost:${provisioning.http.port}/${dist.jar}">            <equals arg1="${run.method}" arg2="OTA-MEFW" casesensitive="false"/>        </condition>        <echo file="${dist.dir}/${dist.jad}" append="true">MIDlet-Jar-URL: ${new.jar.url}</echo>    </target>    <target name="do-sign-jar" if="do.sign.jar" depends="init">        <!--            Adds new signature and certificate to the JAD file if 'do.sign.jar'            property is set. This property is set if one of *.properties files            defines 'trusted=true'.        -->        <java   classname="com.sun.cldc.communication.midp.ExportSuiteSigner"                fork="true"                failonerror="true">            <classpath>                <pathelement location="lib/exportSigner.jar"/>            </classpath>            <arg value="-signerClass"/>            <arg value="${signer.class}"/>            <arg value="-signerJar"/>            <arg file="${signer.jar}"/>            <arg line="${signer.args}"/>            <arg file="${dist.dir}/${dist.jar}"/>            <arg file="${dist.dir}/${dist.jad}"/>        </java>    </target>        <target name="sign-jar" depends="remove-certificate-from-jad, do-sign-jar"            description="Adds certificate and signs the JAD file.">        <!--            Invokes other targets in order to replace old signature and            certificate in the JAD file by new ones.            Usually this target is invoked after the JAR or JAD file             was changed."        -->    </target>        <target name="remove-certificate-from-jad" depends="init">        <!--            Remove old RSA-SHA signature and Certificate from the JAD file.            Since the JAR has been updated they are no longer valid.        -->        <replaceregexp  file="${dist.dir}/${dist.jad}"                        match="MIDlet-Certificate.*\n"                        replace=""/>        <replaceregexp  file="${dist.dir}/${dist.jad}"                        match="MIDlet-Jar-RSA-SHA.*\n"                        replace=""/>    </target>        <target name="pre-compile" depends="init">        <!--            Creates build.dir and build.classes.dir directories.            Checks that 'compile.bootclasspath' property is set.        -->        <mkdir dir="${build.dir}"/>        <mkdir dir="${build.classes.dir}"/>        <mkdir dir="${build.preverified.dir}"/>        <fail   unless="compile.bootclasspath"                 message="Please set impl.classes property or IMPL_CLASSES environment variable and restart."/>    </target>    <target name="run" depends="init, dist, check-remote"            description="Starts the test execution.">        <!--            Starts the test execution by launching the remote component of the            test (if needed) and invoking 'run-test' target. In NetBeans IDE            the test will start automatically, but when running from            command line, 'run-test' will only start the provisioning server.            In this case you will need to install and run the test manually.        -->        <parallel>            <antcall target="run-remote"/>            <sequential>                <antcall target="wait-for-remote-startup"/>                <antcall target="run-test"/>            </sequential>        </parallel>    </target>        <target name="wait-for-remote-startup" if="do.run.remote">        <!--            Waits until the remote component starts listening on the specified            port.        -->        <waitfor maxwait="60" maxwaitunit="second" checkevery="1000">            <socket server="localhost" port="${test.server.port}"/>        </waitfor>    </target>        <target name="run-remote"             if="do.run.remote"            description="Starts the remote component of distributed test.">        <!--            Starts the remote component if needed. Remote component is started            in Javatest harness and uses 'wkdir' as work directory. Previous            content of the work directory is deleted. After the test is finished            the test results will be saved in the work directory.        -->        <delete dir="wkdir"/>        <java   jar="${tck.dir}/lib/javatest.jar"                fork="true"                failonerror="true">            <jvmarg value="-Drun.exported.test=${dist.jar}"/>            <arg value="-testsuite"/>            <arg file="${tck.dir}"/>            <arg value="-workdir"/>            <arg value="-create"/>            <arg file="wkdir"/>            <arg value="-config"/>            <arg file="${tck.config}"/>            <arg value="-set"/>            <arg value="${comm.interview.tag}.httpPort"/>            <arg value="${test.server.port}"/>            <arg value="-runtests"/>        </java>    </target>        <target name="check-remote" depends="init">        <!--            Checks that the resources needed for running remote component of            the test are available. Stops the build if some resource is not            found.        -->        <fail unless="tck.dir"              message="Please set tck.dir property and restart"/>        <available property="javatest.available"                   file="${tck.dir}/lib/javatest.jar"/>        <fail unless="javatest.available"              message="Cannot find ${tck.dir}/lib/javatest.jar"/>    </target>        <target name="pre-jar"            depends="init">        <!--            Copies the originally exported JAR and JAD files to the project            directory. This build never creates new JAR or JAD files, but            updates the original ones.        -->        <mkdir dir="${dist.dir}"/>        <copy file="${original.jar}"               tofile="${dist.dir}/${dist.jar}"              overwrite="true"/>        <copy file="${original.jad}"              tofile="${dist.dir}/${dist.jad}"              overwrite="true"/>    </target>        <target name="dist"            depends="jar, update-jad"            description="Main target for rebuilding JAR and JAD files.">    </target>        <target name="check-http-port">        <!--            Stops the build if 'provisioning.http.port' property is not set.            This property is required to start the exported provisioning server.        -->        <fail unless="provisioning.http.port"              message="Please set provisioning.http.port property and restart"/>    </target>        <target name="deploy"            description="Starts the HTTP server for OTA provisioning of exported test.">        <!--            Starts the exported HTTP server for OTA provisioning of exported            test. After the server is started, the test can be intalled OTA            using the link like                 http://localhost:{port number}/{name of JAD file}.            See the output of build script for details.        -->        <java jar="lib/provisioning_server.jar"              dir="${dist.dir}"              fork="true"              failonerror="true">            <arg value="http.port=${provisioning.http.port}"/>        </java>    </target>        <target name="clean" depends="init"            description="Remove all generated files.">        <!--            Deletes compiled class files and updated JAR and JAD files.        -->        <delete dir="${build.classes.dir}"/>        <delete dir="${build.preverified.dir}"/>        <delete dir="${build.dir}"/>        <delete file="${dist.dir}/${dist.jar}"/>        <delete file="${dist.dir}/${dist.jad}"/>    </target>    <target name="rebuild" depends="clean, dist"            description="Cleans and then builds the project.">        <!--            Rebuilds the project. This target is associated with             'clean and build' action in NetBeans IDE        -->    </target></project>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?