srcanaapps/depexplorer/com.nokia.carbide.extensions.appdep/build.xml
changeset 0 a02c979e8dfd
equal deleted inserted replaced
-1:000000000000 0:a02c979e8dfd
       
     1   
       
     2 <project name="com.nokia.s60tools.appdep" default="build.all">
       
     3 
       
     4   <!-- declare ant4eclipse -->
       
     5   <taskdef resource="net/sf/ant4eclipse/antlib.xml" />
       
     6 
       
     7   <!-- Name definitions -->
       
     8   <property name="feature.name" value="DependencyExplorer"/>
       
     9   <property name="project.name" value="com.nokia.s60tools.extensions.appdep" />
       
    10   <property name="jar.filename" value="${ant.project.name}.jar"/>
       
    11   
       
    12   <!-- Folder definitions -->
       
    13   <property name="workspace.path" value="." />
       
    14   <property name="java.location" value="C:/APPS/j2sdk_1.5.0_12" />
       
    15   <property name="destination.path" value="." />
       
    16   
       
    17   <property name="carbide.folder" value="C:/Carbide_internal" />
       
    18 	<property name="carbide.int.folder" location="c:/Carbide_internal/plugins"/>
       
    19 	<property name="carbide.dev.folder" location="c:/Carbide_development/plugins"/>
       
    20 	
       
    21 	<property name="test.folder" location="${ant.project.name}.tests"/>
       
    22   <property name="reports.folder" location="reports"/>
       
    23 	<property name="reports.emma" location="${reports.folder}/emma"/>
       
    24 	<property name="instr.folder" location="instr"/>
       
    25 	<property name="binaries.folder" location="${feature.name}.binaries"/>
       
    26 	
       
    27 	
       
    28 	<!-- EMMA configuration -->
       
    29  	<path id="emma.lib" >
       
    30     	<pathelement location="${ant.home}/lib/emma.jar" />
       
    31     	<pathelement location="${ant.home}/lib/emma_ant.jar" />
       
    32   	</path>
       
    33 
       
    34   	<taskdef resource="emma_ant.properties" classpathref="emma.lib" />
       
    35 	
       
    36 	<!-- PMD configuration -->
       
    37 	<path id="pmd.lib" >
       
    38     	<pathelement location="${ant.home}/lib/pmd-4.2.jar" />
       
    39     	<pathelement location="${ant.home}/lib/asm-3.1.jar" />
       
    40     	<pathelement location="${ant.home}/lib/jaxen-1.1.1.jar" />
       
    41   	</path>
       
    42 	
       
    43 	<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.lib" />
       
    44 	
       
    45 	<!-- Folders -->
       
    46 	<delete dir="${instr.folder}"/>
       
    47 	<mkdir dir="${instr.folder}"/>
       
    48 	
       
    49 	<delete dir="${reports.folder}"/>
       
    50 	<mkdir dir="${reports.folder}"/>
       
    51 	
       
    52 	<!-- Carbide_classpath -->
       
    53 	<path id="carbide_classpath">
       
    54 		<fileset dir="${carbide.int.folder}" includes="**/*.jar" />
       
    55 	</path>
       
    56 	
       
    57   <!-- Delete old plugins and features -->
       
    58   <target name="delete">
       
    59 	  <delete dir="plugins" failonerror="false"/>
       
    60 	  <delete dir="features" failonerror="false"/>
       
    61   </target>
       
    62  
       
    63    
       
    64   <!-- Target Plugin -->
       
    65   <target name="build.plugins" depends="">
       
    66   <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}" destDir="${destination.path}" packageAsJar="true">
       
    67   	<javacLibraryCompiler>
       
    68   <compilerSettings debug="true" fork="true"/>
       
    69   </javacLibraryCompiler>
       
    70   </buildPlugin>
       
    71   <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.help" destDir="${destination.path}" packageAsJar="true">
       
    72   	<javacLibraryCompiler>
       
    73   <compilerSettings debug="true" fork="true"/>
       
    74   </javacLibraryCompiler>
       
    75   </buildPlugin>
       
    76                 
       
    77   <!-- Build MultiTestRunner feature -->
       
    78   <buildFeature workspace="${workspace.path}"
       
    79                targetPlatformLocation="${carbide.folder}"
       
    80                projectname="${project.name}"
       
    81                buildPluginTarget="build.plugin"
       
    82                destDir="${destination.path}" />
       
    83                
       
    84   </target>
       
    85   
       
    86   <!-- Empty target to do nothing --> 
       
    87   <target name="build.plugin">
       
    88   </target>	
       
    89   
       
    90   
       
    91   
       
    92   <!-- Instrumentation target, depends on build.mtrunner -->
       
    93 	<target name="instr" depends="build.plugins">
       
    94 		<!-- Instrument the source code -->
       
    95 		<emma>
       
    96 			<instr instrpath="${ant.project.name}/bin" destdir="${instr.folder}" metadatafile="${reports.emma}/metadata.emma" merge="true"/>
       
    97 		</emma>
       
    98 	</target>
       
    99   
       
   100   
       
   101   <target name="create.zip">
       
   102   
       
   103   	<mkdir dir="${binaries.folder}/nightly_builds"/>
       
   104  		 <!-- Zip jars to ActiveObjectAnalyser.zip -->
       
   105  		<tstamp>
       
   106 		   <format property="timestamp" pattern="dd-MM-yyyy" />
       
   107 		</tstamp> 
       
   108  		 
       
   109     <zip destfile="${binaries.folder}/nightly_builds/${feature.name}-${timestamp}.zip"
       
   110        basedir="."
       
   111        includes="plugins/*, features/com.nokia.carbide.extensions.*/"/>
       
   112   </target>
       
   113   
       
   114   <!-- Analyze target -->
       
   115 	<target name="analyze">
       
   116 		<!-- PMD -->
       
   117 		<pmd shortFileNames="true">
       
   118 			<!-- Rules -->
       
   119 			<ruleset>basic</ruleset>
       
   120 			<ruleset>codesize</ruleset>
       
   121 			<ruleset>coupling</ruleset>
       
   122 			<ruleset>design</ruleset>
       
   123 			<ruleset>strictexception</ruleset>
       
   124 			<ruleset>strings</ruleset>
       
   125 			<ruleset>sunsecure</ruleset>
       
   126 			
       
   127 			<!-- XML output -->
       
   128 			<formatter type="xml" toFile="${reports.folder}/report.pmd.xml"/>
       
   129 			
       
   130 			<!-- Files to analyze -->
       
   131 			<!-- Files to analyze -->
       
   132 			<fileset dir="${ant.project.name}/src/">
       
   133 				<include name="**/*.java"/>
       
   134 			</fileset>
       
   135 		</pmd>
       
   136 	</target>
       
   137 	
       
   138 	<!-- Test target, depends on instrumentation and analyze -->
       
   139 	<target name="test" depends="instr, analyze" description="Run unit tests">
       
   140     	<!-- Test classpath -->
       
   141     	<path id="test_classpath">
       
   142 			<!-- Test classes -->
       
   143 			<pathelement location="${test.folder}/src"/>
       
   144 			
       
   145 			<!-- Instrumented class files -->
       
   146 		   	<pathelement location="${instr.folder}"/>
       
   147 		   	
       
   148 		   	<!-- EMMA -->
       
   149 		   	<pathelement path="${ant.home}/lib/emma.jar"/>
       
   150 		   	
       
   151 		   	<path refid="carbide_classpath" />
       
   152 		</path>
       
   153 	
       
   154 		<!-- Compile the tests -->
       
   155      	<javac srcdir="${test.folder}" verbose="${javacVerbose}">
       
   156       		<classpath refid="test_classpath"/>
       
   157 	    </javac>
       
   158 
       
   159 		<!-- Run JUnit -->
       
   160 	    <junit printsummary="yes" fork="yes" haltonfailure="no">
       
   161 	      	<classpath refid="test_classpath" />
       
   162 	      	
       
   163 	      	<!-- Plain format and XML -->
       
   164 	      	<formatter type="plain" />
       
   165 	      	<formatter type="xml" />
       
   166 			
       
   167 			<!-- Instrumentation arguments to JVM -->
       
   168 			<jvmarg value="-Demma.coverage.out.file=${reports.emma}/coverage.emma" />
       
   169 	    <jvmarg value="-Demma.coverage.out.merge=true" />
       
   170 
       
   171 			<!-- Test classes -->
       
   172 	      	<test name="${ant.project.name}.tests.AllPureJUnitTests" todir="${reports.folder}"/>
       
   173 
       
   174 	    </junit>
       
   175 	    
       
   176 	    <!-- Create EMMA report -->
       
   177 	    <emma>
       
   178 	    	<report sourcepath="src/" >
       
   179             	<fileset dir="${reports.emma}" >
       
   180                 	<include name="*.emma" />
       
   181             	</fileset>
       
   182             	<xml outfile="${reports.emma}/coverage.xml" />
       
   183         	</report>
       
   184 	    </emma>
       
   185 	</target>
       
   186   
       
   187   
       
   188   <!-- Target Build all -->
       
   189   <target name="build.all" depends="delete, build.plugins, instr, create.zip, analyze" />
       
   190   
       
   191 </project>