imakerplugin/com.nokia.s60tools.imaker.tests/build.xml
changeset 0 61163b28edca
equal deleted inserted replaced
-1:000000000000 0:61163b28edca
       
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <project name="com.nokia.s60tools.imaker.tests" default="build.jars" basedir=".">
       
     3 	<property file="../common.properties"/>
       
     4 
       
     5 	<property name="basews" value="${ws}"/>
       
     6 	<property name="baseos" value="${os}"/>
       
     7 	<property name="basearch" value="${arch}"/>
       
     8 	<property name="basenl" value="${nl}"/>
       
     9 	<property name="bundleId" value="com.nokia.s60tools.imaker.tests"/>
       
    10 
       
    11 	<!-- Compiler settings. -->
       
    12 	<property name="javacFailOnError" value="true"/>
       
    13 	<property name="logExtension" value=".log"/>
       
    14 	<property name="compilerArg" value=""/>
       
    15 
       
    16 	<target name="init" depends="properties">
       
    17 		<property name="pluginTemp" value="${basedir}"/>
       
    18 		<property name="build.result.folder" value="${basedir}"/>
       
    19 		<property name="temp.folder" value="${basedir}/temp.folder"/>
       
    20 		<property name="plugin.destination" value="${basedir}"/>
       
    21 	</target>
       
    22 
       
    23 	<target name="properties" if="eclipse.running">
       
    24 		<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
       
    25 
       
    26 	</target>
       
    27 
       
    28 	<target name="build.update.jar" depends="init" description="Build the plug-in: com.nokia.s60tools.imaker.tests for an update site.">
       
    29 		<delete dir="${temp.folder}"/>
       
    30 		<mkdir dir="${temp.folder}"/>
       
    31 		<antcall target="build.jars"/>
       
    32 		<antcall target="gather.bin.parts">
       
    33 			<param name="destination.temp.folder" value="${temp.folder}/"/>
       
    34 		</antcall>
       
    35 		<jar destfile="${plugin.destination}/com.nokia.s60tools.imaker.tests_${plugin.version}.jar" basedir="${temp.folder}/com.nokia.s60tools.imaker.tests_${plugin.version}" filesetmanifest="merge"/>
       
    36 		<copy todir="../${plugin.lib}" file="${plugin.destination}/com.nokia.s60tools.imaker.tests_${plugin.version}.jar" failonerror="true" overwrite="true" />
       
    37 		<delete dir="${temp.folder}"/>
       
    38 	</target>
       
    39 
       
    40 	<target name="@dot" depends="init" unless="@dot" description="Create jar: com.nokia.s60tools.imaker.tests @dot.">
       
    41 		<delete dir="${temp.folder}/@dot.bin"/>
       
    42 		<mkdir dir="${temp.folder}/@dot.bin"/>
       
    43 		<path id="@dot.classpath">
       
    44 			<fileset dir="${eclipse.home}/plugins">
       
    45 		    	<include name="**/*.jar"/>
       
    46 				<exclude name="com.nokia.s60tools.imaker*"/>
       
    47 		   	</fileset>
       
    48 		      <fileset dir="../com.nokia.s60tools.imaker">
       
    49 		        <include name="**/*.jar"/>
       
    50 		      </fileset>
       
    51 		</path>
       
    52 		<!-- compile the source code -->
       
    53 		<javac destdir="${temp.folder}/@dot.bin" failonerror="${javacFailOnError}" source="${common.javac-source}" target="${common.javac-target}">
       
    54 		<!--
       
    55 			<compilerarg line="${compilerArg}" compiler="${build.compiler}"/>
       
    56 			<compilerarg value="@${basedir}/javaCompiler...args" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
       
    57 			<compilerarg line="-log '${temp.folder}/@dot.bin${logExtension}'" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
       
    58 		-->
       
    59 			<classpath refid="@dot.classpath" />
       
    60 			<src path="src/"			/>
       
    61 		</javac>
       
    62 		<!-- Copy necessary resources -->
       
    63 		<copy todir="${temp.folder}/@dot.bin" failonerror="true" overwrite="false">
       
    64 			<fileset dir="src/">
       
    65 				<exclude name="**/*.java"/>
       
    66 				<exclude name="**/package.htm*"/>
       
    67 			</fileset>
       
    68 		</copy>
       
    69 		<mkdir dir="${build.result.folder}"/>
       
    70 		<copy todir="${build.result.folder}/@dot" failonerror="true" overwrite="false">
       
    71 			<fileset dir="${temp.folder}/@dot.bin">
       
    72 			</fileset>
       
    73 		</copy>
       
    74 		<delete dir="${temp.folder}/@dot.bin"/>
       
    75 	</target>
       
    76 
       
    77 	<target name="src.zip" depends="init" unless="src.zip">
       
    78 		<mkdir dir="${build.result.folder}"/>
       
    79 		<zip destfile="${build.result.folder}/src.zip" filesonly="false" whenempty="skip" update="false">
       
    80 			<fileset dir="src/">
       
    81 				<include name="**/*.java"/>
       
    82 			</fileset>
       
    83 		</zip>
       
    84 	</target>
       
    85 
       
    86 	<target name="build.jars" depends="init" description="Compile classes and build nested jars for the plug-in: com.nokia.s60tools.imaker.tests.">
       
    87 		<available property="@dot" file="${build.result.folder}/@dot"/>
       
    88 		<antcall target="@dot"/>
       
    89 	</target>
       
    90 
       
    91 	<target name="build.sources" depends="init">
       
    92 		<available property="src.zip" file="${build.result.folder}/src.zip"/>
       
    93 		<antcall target="src.zip"/>
       
    94 	</target>
       
    95 
       
    96 	<target name="gather.bin.parts" depends="init" if="destination.temp.folder">
       
    97 		<mkdir dir="${destination.temp.folder}/com.nokia.s60tools.imaker.tests_${plugin.version}"/>
       
    98 		<copy todir="${destination.temp.folder}/com.nokia.s60tools.imaker.tests_${plugin.version}" failonerror="true" overwrite="false">
       
    99 			<fileset dir="${build.result.folder}/@dot">
       
   100 				<include name="**"/>
       
   101 			</fileset>
       
   102 		</copy>
       
   103 		<copy todir="${destination.temp.folder}/com.nokia.s60tools.imaker.tests_${plugin.version}" failonerror="true" overwrite="false">
       
   104 			<fileset dir="${basedir}">
       
   105 				<include name="META-INF/"/>
       
   106 				<include name="tools/"/>
       
   107 			</fileset>
       
   108 		</copy>
       
   109 	</target>
       
   110 
       
   111 	<target name="build.zips" depends="init">
       
   112 	</target>
       
   113 
       
   114 	<target name="gather.sources" depends="init" if="destination.temp.folder">
       
   115 		<mkdir dir="${destination.temp.folder}/com.nokia.s60tools.imaker.tests_${plugin.version}"/>
       
   116 		<copy file="${build.result.folder}/src.zip" todir="${destination.temp.folder}/com.nokia.s60tools.imaker.tests_${plugin.version}" failonerror="false" overwrite="false"/>
       
   117 	</target>
       
   118 
       
   119 	<target name="gather.logs" depends="init" if="destination.temp.folder">
       
   120 		<mkdir dir="${destination.temp.folder}/com.nokia.s60tools.imaker.tests_${plugin.version}"/>
       
   121 		<copy todir="${destination.temp.folder}/com.nokia.s60tools.imaker.tests_${plugin.version}" failonerror="false" overwrite="false">
       
   122 			<fileset dir="${temp.folder}">
       
   123 				<include name="@dot.bin${logExtension}"/>
       
   124 			</fileset>
       
   125 		</copy>
       
   126 	</target>
       
   127 
       
   128 	<target name="clean" depends="init" description="Clean the plug-in: com.nokia.s60tools.imaker.tests of all the zips, jars and logs created.">
       
   129 		<delete dir="${build.result.folder}/@dot"/>
       
   130 		<delete file="${build.result.folder}/src.zip"/>
       
   131 		<delete file="${plugin.destination}/com.nokia.s60tools.imaker.tests_${plugin.version}.jar"/>
       
   132 		<delete file="${plugin.destination}/com.nokia.s60tools.imaker.tests_${plugin.version}.zip"/>
       
   133 		<delete dir="${temp.folder}"/>
       
   134 	</target>
       
   135 
       
   136 	<target name="refresh" depends="init" if="eclipse.running" description="Refresh this folder.">
       
   137 		<eclipse.convertPath fileSystemPath="C:/dev/workspaces/eclipse-3.3.2/com.nokia.s60tools.imaker.tests" property="resourcePath"/>
       
   138 		<eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
       
   139 	</target>
       
   140 
       
   141 	<target name="zip.plugin" depends="init" description="Create a zip containing all the elements for the plug-in: com.nokia.s60tools.imaker.tests.">
       
   142 		<delete dir="${temp.folder}"/>
       
   143 		<mkdir dir="${temp.folder}"/>
       
   144 		<antcall target="build.jars"/>
       
   145 		<antcall target="build.sources"/>
       
   146 		<antcall target="gather.bin.parts">
       
   147 			<param name="destination.temp.folder" value="${temp.folder}/"/>
       
   148 		</antcall>
       
   149 		<antcall target="gather.sources">
       
   150 			<param name="destination.temp.folder" value="${temp.folder}/"/>
       
   151 		</antcall>
       
   152 		<delete>
       
   153 			<fileset dir="${temp.folder}">
       
   154 				<include name="**/*.bin${logExtension}"/>
       
   155 			</fileset>
       
   156 		</delete>
       
   157 		<zip destfile="${plugin.destination}/com.nokia.s60tools.imaker.tests_${plugin.version}.zip" basedir="${temp.folder}" filesonly="true" whenempty="skip" update="false"/>
       
   158 		<delete dir="${temp.folder}"/>
       
   159 	</target>
       
   160 
       
   161 </project>