testdev/ite/build.xml
changeset 1 96906a986c3b
equal deleted inserted replaced
0:f1112f777ce9 1:96906a986c3b
       
     1   
       
     2 <project name="com.nokia.testfw" default="build.all">
       
     3 
       
     4   <!-- declare ant4eclipse -->
       
     5   <taskdef resource="net/sf/ant4eclipse/antlib.xml" />
       
     6 
       
     7   <property environment="env"/>
       
     8   
       
     9 
       
    10   <!-- Name definitions -->
       
    11   <property name="feature.name" value="ITE"/>
       
    12   <property name="project.name" value="com.nokia.testfw" />
       
    13   <property name="jar.filename" value="${ant.project.name}.jar"/>
       
    14   
       
    15   <!-- Folder definitions -->
       
    16   <property name="workspace.path" value="src/" />
       
    17   <property name="testworkspace.path" value="test/" />
       
    18   <property name="java.location" value="${env.JAVA_HOME}" />
       
    19   <property name="destination.path" value="./build" />
       
    20   
       
    21   <!--property name="carbide.folder" value="C:\Apps\carbide_internal" / -->
       
    22   <property name="carbide.folder" value="${env.ECLIPSE_HOME}" />
       
    23   <property name="carbide.int.folder" location="${carbide.folder}/plugins"/>
       
    24 	<!-- property name="carbide.dev.folder" location="c:/Carbide_development/plugins"/ -->
       
    25 	
       
    26 	<property name="core.test.folder" location="test/com.nokia.testfw.core.test"/>
       
    27 	<property name="resultview.test.folder" location="test/com.nokia.testfw.resultview.test"/>
       
    28 	<property name="reports.folder" location="./build/reports"/>
       
    29 	<property name="binaries.folder" location="${destination.path}/${feature.name}.binaries"/>
       
    30 	
       
    31 	
       
    32 	<delete dir="${reports.folder}"/>
       
    33 	<mkdir dir="${reports.folder}"/>
       
    34 	
       
    35 	<!-- Carbide_classpath -->
       
    36 	<path id="carbide_classpath">
       
    37 		<fileset dir="${carbide.int.folder}" includes="**/*.jar" />
       
    38 	</path>
       
    39 
       
    40 	<path id="dest_classpath">
       
    41 		<fileset dir="${destination.path}" includes="**/*.jar" />
       
    42 	</path>
       
    43 	<path id="ant_classpath">
       
    44 		<fileset dir="C:\Apps\ant\lib" includes="**/*.jar" />
       
    45 	</path>
       
    46 	
       
    47   <!-- Delete old plugins and features -->
       
    48   <target name="delete">
       
    49       <delete dir="${destination.path}/eclipse" failonerror="false"/>
       
    50 	  <delete dir="${destination.path}/plugins" failonerror="false"/>
       
    51 	  <delete dir="${destination.path}/features" failonerror="false"/>
       
    52 	  <delete dir="src/${ant.project.name}.core/bin" failonerror="false"/>
       
    53 	  <ant antfile="src/com.nokia.testfw.codegen/build.xml" target="clean" inheritAll="false"/>
       
    54   </target>
       
    55  
       
    56   <!--codegen, cmdtool, testrunner, core, codegen.ui, resultview, launch -->
       
    57 
       
    58   <!-- build the codegen lib jar -->
       
    59   <target name="buildcodegen">
       
    60 	  <ant antfile="src/com.nokia.testfw.codegen/build.xml" inheritAll="false"/>
       
    61   </target>
       
    62    
       
    63   <!-- Target Plugin -->
       
    64   <target name="build.plugins" depends="buildcodegen">
       
    65 
       
    66   
       
    67   <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.core" destDir="${destination.path}" packageAsJar="true">
       
    68   	<javacLibraryCompiler>
       
    69   			<compilerSettings debug="true" fork="true"/>
       
    70   	</javacLibraryCompiler>
       
    71   </buildPlugin>
       
    72 
       
    73   <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.resultview" destDir="${destination.path}" packageAsJar="true">
       
    74   	<javacLibraryCompiler>
       
    75   			<compilerSettings debug="true" fork="true"/>
       
    76   	</javacLibraryCompiler>
       
    77   </buildPlugin>
       
    78 
       
    79   <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.launch" destDir="${destination.path}" packageAsJar="true">
       
    80   	<javacLibraryCompiler>
       
    81   			<compilerSettings debug="true" fork="true"/>
       
    82   	</javacLibraryCompiler>
       
    83   </buildPlugin>
       
    84 
       
    85   <copy todir="${workspace.path}/${ant.project.name}.codegen.ui/lib" failonerror="true" overwrite="true">
       
    86 	<fileset dir="${workspace.path}/${ant.project.name}.codegen/jar"/>
       
    87   </copy>
       
    88 
       
    89   <copy todir="${workspace.path}/${ant.project.name}.codegen.ui/bin" failonerror="true" overwrite="false">
       
    90 	  <fileset dir="${workspace.path}/${ant.project.name}.codegen.ui/src/" excludes="**/*.java, **/package.htm*" />
       
    91 	</copy>
       
    92 
       
    93   <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.codegen.ui" destDir="${destination.path}" packageAsJar="true">
       
    94   	<javacLibraryCompiler>
       
    95   			<compilerSettings debug="true" fork="true"/>
       
    96   	</javacLibraryCompiler>
       
    97   </buildPlugin>
       
    98   <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.stf.help" destDir="${destination.path}" packageAsJar="true">
       
    99   	<javacLibraryCompiler>
       
   100   			<compilerSettings debug="true" fork="true"/>
       
   101   	</javacLibraryCompiler>
       
   102   </buildPlugin>
       
   103   <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.sut.help" destDir="${destination.path}" packageAsJar="true">
       
   104   	<javacLibraryCompiler>
       
   105   			<compilerSettings debug="true" fork="true"/>
       
   106   	</javacLibraryCompiler>
       
   107   </buildPlugin>
       
   108 
       
   109   <copy todir="${workspace.path}/${ant.project.name}.stf.configeditor/bin" failonerror="true" overwrite="false">
       
   110 	  <fileset dir="${workspace.path}/${ant.project.name}.stf.configeditor/src/" excludes="**/*.java, **/package.htm*" />
       
   111 	</copy>
       
   112 
       
   113   <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.stf.configeditor" destDir="${destination.path}" packageAsJar="true">
       
   114   	<javacLibraryCompiler>
       
   115   			<compilerSettings debug="true" fork="true"/>
       
   116   	</javacLibraryCompiler>
       
   117   </buildPlugin>
       
   118 
       
   119   
       
   120   <copy todir="${workspace.path}/${ant.project.name}.stf.scripteditor/bin" failonerror="true" overwrite="false">
       
   121 	  <fileset dir="${workspace.path}/${ant.project.name}.stf.scripteditor/src/" excludes="**/*.java, **/package.htm*" />
       
   122 	</copy>
       
   123 
       
   124   <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.stf.scripteditor" destDir="${destination.path}" packageAsJar="true">
       
   125   	<javacLibraryCompiler>
       
   126   			<compilerSettings debug="true" fork="true"/>
       
   127   	</javacLibraryCompiler>
       
   128   </buildPlugin>
       
   129                 
       
   130   <copy todir="${carbide.folder}" failonerror="true" overwrite="true">
       
   131 	<fileset dir="${destination.path}"/>
       
   132   </copy>
       
   133   <!-- build test plugin -->
       
   134   <buildPlugin workspace="${testworkspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.test" destDir="${destination.path}" packageAsJar="true">
       
   135   	<javacLibraryCompiler>
       
   136   			<compilerSettings debug="true" fork="true"/>
       
   137   	</javacLibraryCompiler>
       
   138   </buildPlugin>
       
   139 
       
   140   <buildPlugin workspace="${testworkspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.resultview.test" destDir="${destination.path}" packageAsJar="true">
       
   141   	<javacLibraryCompiler>
       
   142   			<compilerSettings debug="true" fork="true"/>
       
   143   	</javacLibraryCompiler>
       
   144   </buildPlugin>
       
   145 
       
   146   <!--buildPlugin workspace="${testworkspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.codegen.ui.test" destDir="${destination.path}" packageAsJar="true">
       
   147   	<javacLibraryCompiler>
       
   148   			<compilerSettings debug="true" fork="true"/>
       
   149   	</javacLibraryCompiler>
       
   150   </buildPlugin -->
       
   151 
       
   152   <!-- Build feature -->
       
   153   <buildFeature workspace="${workspace.path}"
       
   154                targetPlatformLocation="${carbide.folder}"
       
   155                projectname="${ant.project.name}.common"
       
   156 	       buildPluginTarget="build.plugin"
       
   157                destDir="${destination.path}" />
       
   158 
       
   159  <copy todir="${carbide.folder}" failonerror="true" overwrite="true">
       
   160 	<fileset dir="${destination.path}"/>
       
   161   </copy>
       
   162 
       
   163   </target>
       
   164 
       
   165   <!-- Empty target to do nothing --> 
       
   166   <target name="build.plugin">
       
   167   </target>
       
   168   
       
   169   <target name="create.zip">
       
   170   
       
   171   	<delete dir="${binaries.folder}/nightly_builds"/>
       
   172   	<mkdir dir="${binaries.folder}/nightly_builds"/>
       
   173   	
       
   174 
       
   175 	<delete dir="${destiation.path}/eclipse" />
       
   176 	<mkdir dir="${destiation.path}/eclipse" />
       
   177 	<copydir dest="${destination.path}/eclipse/plugins" 
       
   178 		src="${destination.path}/plugins"
       
   179 		excludes="com.nokia.testfw.test*/** com.nokia.testfw.resultview.test*/**" 	
       
   180 		/>
       
   181 	<copydir dest="${destination.path}/eclipse/features" 
       
   182 		src="${destination.path}/features" />
       
   183 
       
   184  		<tstamp>
       
   185 		   <format property="timestamp" pattern="dd-MM-yyyy" />
       
   186 		</tstamp> 
       
   187  		 
       
   188     <zip destfile="${binaries.folder}/nightly_builds/${feature.name}-${timestamp}.zip"
       
   189 	    basedir="${destination.path}"
       
   190 	    includes="eclipse/**/*"/>
       
   191 	   
       
   192 	
       
   193   </target>
       
   194   
       
   195 	<!-- Test target, depends on instrumentation and analyze -->
       
   196 	<target name="test" description="Run unit tests">
       
   197     	        <!-- Test classpath -->
       
   198     	        <path id="test_classpath">
       
   199 			<pathelement location="${core.test.folder}/src"/>
       
   200 			<pathelement location="${resultview.test.folder}/src"/>
       
   201 
       
   202 		   	<path refid="dest_classpath" />
       
   203 		   	<path refid="carbide_classpath" />
       
   204 		   	<path refid="ant_classpath" />
       
   205 		</path>
       
   206 
       
   207 		<path id="junit_classpath">
       
   208 			<pathelement location="${core.test.folder}/src"/>
       
   209 			<pathelement location="${resultview.test.folder}/src"/>
       
   210 		   	<path refid="dest_classpath" />
       
   211 		   	<path refid="ant_classpath" />
       
   212 		</path>
       
   213 
       
   214 	
       
   215 		<!-- Compile the tests -->
       
   216      	        <javac srcdir="${core.test.folder}" verbose="false">
       
   217       		<classpath refid="junit_classpath"/>
       
   218 	        </javac>
       
   219 
       
   220 		<!-- Run JUnit -->
       
   221 	    <junit printsummary="yes" fork="yes" haltonfailure="no">
       
   222 	      	<classpath refid="junit_classpath" />
       
   223 	      	<formatter type="plain" />
       
   224 	      	<formatter type="xml" />
       
   225 		<!-- Test classes -->
       
   226 	      	<test name="com.nokia.testfw.core.AllPureJUnitTests" todir="${reports.folder}"/>
       
   227 	    </junit>
       
   228 
       
   229 	    <!-- Run JUnit Plugin tests -->
       
   230 	    <!-- reference to instruction at http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.test/testframework.html?view=co -->
       
   231 	    <!--java -jar C:\Apps\carbide_internal\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar -application org.eclipse.test.uitestapplication -os win32 -ws win32 -arch x86 -dev bin -testpluginname com.nokia.testfw.resultview.test -->
       
   232 	    <!--java jar="${carbide.folde}\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20080819.jar -application org.eclipse.test.uitestapplication -os win32 -ws win32 -arch x86 -dev bin -testpluginname com.nokia.testfw.resultview.test>
       
   233 	     </java -->
       
   234 
       
   235 	    <!-- generate test report -->
       
   236 	    <junitreport todir="${reports.folder}">
       
   237 		    <fileset dir="${reports.folder}">
       
   238                 <include name="TEST-*.xml"/>
       
   239                 </fileset>
       
   240 		<report format="frames" todir="${reports.folder}/html"/>
       
   241             </junitreport>
       
   242 	    
       
   243 	    
       
   244 	</target>
       
   245 
       
   246 
       
   247   
       
   248   <!-- Target Build all -->
       
   249   <target name="build.all" depends="delete, build.plugins, test, create.zip" />
       
   250   
       
   251 </project>