common-tasks.xml.svn-base
来自「cqME :java framework for TCK test.」· SVN-BASE 代码 · 共 244 行
SVN-BASE
244 行
<!-- $Id$ Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 for more details (a copy is included at /legal/license.txt). You should have received a copy of the GNU General Public License version 2 along with this work; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, CA 95054 or visit www.sun.com if you need additional information or have any questions.--><project name="common-tasks"> <!-- ######## Smart Unjar Task ######## --> <macrodef name="smart_unjar"> <attribute name="jarFile"/> <attribute name="pattern"/> <attribute name="dest"/> <!-- ATTN: Any _UNIQUE_ string identifying particular unjar operation can be used here. But do make sure that it's unique, or else! --> <attribute name="uniqName"/> <sequential> <!-- create destination dir, if it doesn't exist --> <mkdir dir="@{dest}"/> <!-- Pretty straightforward approach here. After successful unjarring we create an "OK" file. This is a special control file that helps determining whether this particular unjar operation has already been done earlier. --> <if> <!-- Was this jar extracted previously? --> <and> <available file="${build}/unjar_@{uniqName}_ok"/> <!-- to be extra paranoid, let's also check that jar file has not been changed since last unjar --> <uptodate srcfile="@{jarFile}" targetfile="${build}/unjar_@{uniqName}_ok"/> </and> <then> <echo message="Unjarring of @{jarFile} is not needed :)"/> </then> <else> <unjar src="@{jarFile}" dest="@{dest}" overwrite="no"> <patternset includes="@{pattern}"/> </unjar> <touch file="${build}/unjar_@{uniqName}_ok"/> </else> </if> </sequential> </macrodef><!-- ######## Macro to create JAR files for CDC and up ######## --> <macrodef name="create_cdc_jar"> <attribute name="jarName"/> <attribute name="jarClassPath"/> <attribute name="javaTarget" default="1.2"/> <attribute name="javaSource" default="1.2"/> <attribute name="excludes" default=""/> <attribute name="manifest" default=""/> <sequential> <create_j2se_jar jarName="@{jarName}" bootClassPath="@{jarClassPath}" javaTarget="@{javaTarget}" javaSource="@{javaSource}" includeAntRuntime="no" includeJavaRuntime="no" excludes="@{excludes}" manifest="@{manifest}"/> </sequential> </macrodef><!-- ######## J2SE Compilation / Jar Creation Task Definitions ######## --> <macrodef name="create_j2se_jar"> <attribute name="jarName"/> <attribute name="jarClassPath" default=""/> <attribute name="bootClassPath" default=""/> <attribute name="javaTarget" default="1.5"/> <attribute name="javaSource" default="1.5"/> <attribute name="includeAntRuntime" default="no"/> <attribute name="includeJavaRuntime" default="no"/> <attribute name="excludes" default=""/> <attribute name="manifest" default=""/> <sequential> <mkdir dir="${build}/@{jarName}"/> <mkdir dir="${build}/@{jarName}-src"/> <!-- Copy sources so that they will be complied in isolation --> <copy todir="${build}/@{jarName}-src"> <fileset dir="${src}/share/classes" includes="${JAVAFILES.@{jarName}}"/> </copy> <javac srcdir="${build}/@{jarName}-src" destdir="${build}/@{jarName}" includes="${JAVAFILES.@{jarName}}" excludes="@{excludes}" includeJavaRuntime="@{includeJavaRuntime}" includeAntRuntime="@{includeAntRuntime}" debug="yes" deprecation="yes" source="@{javaSource}" target="@{javaTarget}"> <classpath path="@{jarClassPath}"/> <bootclasspath path="@{bootClassPath}"/> </javac> <copy todir="${build}/@{jarName}" includeEmptyDirs="no"> <fileset dir="${src}/share/classes" includes="${RESOURCES.@{jarName}}"/> </copy> <!-- Some resources should go to the root of jar file --> <copy todir="${build}/@{jarName}" includeEmptyDirs="no" flatten="yes"> <fileset dir="${src}/share/classes" includes="${ROOT_RESOURCES.@{jarName}}"/> </copy> <copy todir="${build}/@{jarName}" includeEmptyDirs="no"> <fileset dir="${src}/share/classes" includes="${PROPERTIES.@{jarName}}"/> <filterset> <filter token="FRAMEWORK.NAME" value="${PRODUCT_LONG}"/> <filter token="FRAMEWORK.VERSION" value="${VERSION_LONG}"/> <filter token="FRAMEWORK.BUILD_ID" value="${BUILD_ID}"/> <filter token="FRAMEWORK.BUILD_DATE" value="${BUILD_DATE}"/> </filterset> </copy> <jar_with_optional_manifest jarName="@{jarName}" manifest="@{manifest}"/> </sequential> </macrodef><!-- J2ME Compilation / Preverification / Jar Creation Tasks Definitions --> <macrodef name="create_j2me_jar"> <attribute name="jarName"/> <attribute name="jarClassPath"/> <attribute name="manifest" default=""/> <sequential> <mkdir dir="${build}/@{jarName}"/> <mkdir dir="${build}/@{jarName}-src-j2me"/> <mkdir dir="${build}/@{jarName}-nonpreverified"/> <!-- Copy sources so that they will be complied in isolation --> <copy todir="${build}/@{jarName}-src-j2me"> <fileset dir="${src}/share/classes" includes="${JAVAFILES.@{jarName}}"/> </copy> <javac srcdir="${build}/@{jarName}-src-j2me" destdir="${build}/@{jarName}-nonpreverified" includes="${JAVAFILES.@{jarName}}" includeJavaRuntime="no" includeAntRuntime="no" debug="yes" target="1.1" source="1.2"> <bootclasspath path="@{jarClassPath}"/> </javac> <if> <!-- Preverified? --> <uptodate> <srcfiles dir="${build}/@{jarName}-nonpreverified" includes="**/*.class"/> <mapper type="glob" from="*.class" to="${build}/@{jarName}/*.class"/> </uptodate> <then> <echo message="Already preverified"/> </then> <else> <exec executable="${preverifier}" dir="${build}/@{jarName}" failonerror="yes"> <env key="LANG" value="C"/> <arg line="-classpath"/> <arg path="@{jarClassPath}:${PREVERIFIER_EXTRA_PATH}"/> <arg line="-d ${build}/@{jarName}"/> <arg line="${build}/@{jarName}-nonpreverified"/> </exec> </else> </if> <copy todir="${build}/@{jarName}" includeEmptyDirs="no"> <fileset dir="${src}/share/classes" includes="${RESOURCES.@{jarName}}"/> </copy> <jar_with_optional_manifest jarName="@{jarName}" manifest="@{manifest}"/> </sequential> </macrodef> <macrodef name="jar_with_optional_manifest"> <attribute name="jarName"/> <attribute name="manifest" default=""/> <sequential> <if> <!-- No custom manifest? --> <equals arg1="@{manifest}" arg2=""/> <then> <jar jarfile="${tcklib}/@{jarName}.jar" basedir="${build}/@{jarName}"/> </then> <else> <echo message="Custom manifest provided: @{manifest}"/> <jar jarfile="${tcklib}/@{jarName}.jar" basedir="${build}/@{jarName}" manifest="${antbuild}/@{manifest}"/> </else> </if> </sequential> </macrodef> </project>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?