0
|
1 |
|
|
2 |
<project name="com.nokia.s60tools.sdk" 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="FrameworkSDK"/>
|
|
9 |
<property name="project.name" value="com.nokia.s60tools.sdk" />
|
|
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_ADT/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.5.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 |
<delete dir="bin" failonerror="false"/>
|
|
62 |
</target>
|
|
63 |
|
|
64 |
|
|
65 |
<!-- Target Plugin -->
|
|
66 |
<target name="build.plugins" depends="">
|
|
67 |
|
|
68 |
<!-- Copy necessary resources -->
|
|
69 |
<copy todir="bin/" failonerror="true" overwrite="false">
|
|
70 |
<fileset dir="src/" excludes="**/*.java, **/package.htm*" />
|
|
71 |
</copy>
|
|
72 |
|
|
73 |
<buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="" destDir="${destination.path}" packageAsJar="true">
|
|
74 |
<javacLibraryCompiler>
|
|
75 |
<compilerSettings debug="true" fork="true"/>
|
|
76 |
</javacLibraryCompiler>
|
|
77 |
</buildPlugin>
|
|
78 |
|
|
79 |
</target>
|
|
80 |
|
|
81 |
<!-- Empty target to do nothing -->
|
|
82 |
<target name="build.plugin">
|
|
83 |
</target>
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 |
<!-- Instrumentation target, depends on build.mtrunner -->
|
|
88 |
<target name="instr" depends="build.plugins">
|
|
89 |
<!-- Instrument the source code -->
|
|
90 |
<emma>
|
|
91 |
<instr instrpath="bin" destdir="${instr.folder}" metadatafile="${reports.emma}/metadata.emma" merge="true"/>
|
|
92 |
</emma>
|
|
93 |
</target>
|
|
94 |
|
|
95 |
|
|
96 |
<target name="create.zip">
|
|
97 |
|
|
98 |
<mkdir dir="${binaries.folder}/nightly_builds"/>
|
|
99 |
<!-- Zip jars to ActiveObjectAnalyser.zip -->
|
|
100 |
<tstamp>
|
|
101 |
<format property="timestamp" pattern="dd-MM-yyyy" />
|
|
102 |
</tstamp>
|
|
103 |
|
|
104 |
<zip destfile="${binaries.folder}/nightly_builds/${feature.name}-${timestamp}.zip"
|
|
105 |
basedir="."
|
|
106 |
includes="plugins/*, features/com.nokia.carbide.extensions.*/"/>
|
|
107 |
</target>
|
|
108 |
|
|
109 |
<!-- Analyze target -->
|
|
110 |
<target name="analyze">
|
|
111 |
<!-- PMD -->
|
|
112 |
<pmd shortFileNames="true">
|
|
113 |
<!-- Rules -->
|
|
114 |
<ruleset>basic</ruleset>
|
|
115 |
<ruleset>codesize</ruleset>
|
|
116 |
<ruleset>coupling</ruleset>
|
|
117 |
<ruleset>design</ruleset>
|
|
118 |
<ruleset>strictexception</ruleset>
|
|
119 |
<ruleset>strings</ruleset>
|
|
120 |
<ruleset>sunsecure</ruleset>
|
|
121 |
<ruleset>unusedcode</ruleset>
|
|
122 |
<ruleset>junit</ruleset>
|
|
123 |
|
|
124 |
<!-- XML output -->
|
|
125 |
<formatter type="xml" toFile="${reports.folder}/report.pmd.xml"/>
|
|
126 |
|
|
127 |
<!-- Files to analyze -->
|
|
128 |
<!-- Files to analyze -->
|
|
129 |
<fileset dir="src/">
|
|
130 |
<include name="**/*.java"/>
|
|
131 |
</fileset>
|
|
132 |
<fileset dir="../${ant.project.name}.tests/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,test" />
|
|
190 |
|
|
191 |
</project> |