|
1 |
|
2 <project name="com.nokia.s60tools.creator" 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="Creator"/> |
|
9 <property name="project.name" value="com.nokia.carbide.extensions.creator" /> |
|
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="reports.folder" location="reports"/> |
|
22 <property name="reports.emma" location="${reports.folder}/emma"/> |
|
23 <property name="instr.folder" location="instr"/> |
|
24 <property name="binaries.folder" location="${feature.name}.binaries"/> |
|
25 |
|
26 |
|
27 <!-- EMMA configuration --> |
|
28 <path id="emma.lib" > |
|
29 <pathelement location="${ant.home}/lib/emma.jar" /> |
|
30 <pathelement location="${ant.home}/lib/emma_ant.jar" /> |
|
31 </path> |
|
32 |
|
33 <taskdef resource="emma_ant.properties" classpathref="emma.lib" /> |
|
34 |
|
35 <!-- PMD configuration --> |
|
36 <path id="pmd.lib" > |
|
37 <pathelement location="${ant.home}/lib/pmd-4.2.5.jar" /> |
|
38 <pathelement location="${ant.home}/lib/asm-3.1.jar" /> |
|
39 <pathelement location="${ant.home}/lib/jaxen-1.1.1.jar" /> |
|
40 </path> |
|
41 |
|
42 <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpathref="pmd.lib" /> |
|
43 |
|
44 <!-- Folders --> |
|
45 <delete dir="${instr.folder}"/> |
|
46 <mkdir dir="${instr.folder}"/> |
|
47 |
|
48 <delete dir="${reports.folder}"/> |
|
49 <mkdir dir="${reports.folder}"/> |
|
50 |
|
51 <!-- Carbide_classpath --> |
|
52 <path id="carbide_classpath"> |
|
53 <fileset dir="${carbide.int.folder}" includes="**/*.jar" /> |
|
54 </path> |
|
55 |
|
56 <!-- Delete old plugins and features --> |
|
57 <target name="delete"> |
|
58 <delete dir="plugins" failonerror="false"/> |
|
59 <delete dir="features" failonerror="false"/> |
|
60 <delete dir="${ant.project.name}/bin" failonerror="false"/> |
|
61 </target> |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 <!-- Target Plugin --> |
|
67 <target name="build.creator" depends=""> |
|
68 |
|
69 <!-- Copy necessary resources --> |
|
70 <copy todir="${ant.project.name}/bin" failonerror="true" overwrite="false"> |
|
71 <fileset dir="${ant.project.name}/src/" excludes="**/*.java, **/package.htm*" /> |
|
72 </copy> |
|
73 |
|
74 <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}" destDir="${destination.path}" packageAsJar="true"> |
|
75 <javacLibraryCompiler> |
|
76 <compilerSettings debug="true" fork="true"/> |
|
77 </javacLibraryCompiler> |
|
78 </buildPlugin> |
|
79 <buildPlugin workspace="${workspace.path}" targetPlatformLocation="${carbide.folder}" projectname="${ant.project.name}.help" destDir="${destination.path}" packageAsJar="true"> |
|
80 <javacLibraryCompiler> |
|
81 <compilerSettings debug="true" fork="true"/> |
|
82 </javacLibraryCompiler> |
|
83 </buildPlugin> |
|
84 |
|
85 <!-- Build MultiTestRunner feature --> |
|
86 <buildFeature workspace="${workspace.path}" |
|
87 targetPlatformLocation="${carbide.folder}" |
|
88 projectname="${project.name}" |
|
89 buildPluginTarget="build.plugin" |
|
90 destDir="${destination.path}" /> |
|
91 |
|
92 </target> |
|
93 |
|
94 <!-- Empty target to do nothing --> |
|
95 <target name="build.plugin"> |
|
96 </target> |
|
97 |
|
98 |
|
99 |
|
100 <!-- Instrumentation target, depends on build.mtrunner --> |
|
101 <target name="instr" depends="build.creator"> |
|
102 <!-- Instrument the source code --> |
|
103 <emma> |
|
104 <instr instrpath="${ant.project.name}/bin" destdir="${instr.folder}" metadatafile="${reports.emma}/metadata.emma" merge="true"/> |
|
105 </emma> |
|
106 </target> |
|
107 |
|
108 |
|
109 <target name="create.zip"> |
|
110 |
|
111 <delete dir="${binaries.folder}/nightly_builds"/> |
|
112 <mkdir dir="${binaries.folder}/nightly_builds"/> |
|
113 |
|
114 <!-- Zip jars to MultiTestRunner.zip --> |
|
115 <tstamp> |
|
116 <format property="timestamp" pattern="dd-MM-yyyy" /> |
|
117 </tstamp> |
|
118 |
|
119 <zip destfile="${binaries.folder}/nightly_builds/${feature.name}.${timestamp}.zip" |
|
120 basedir="." |
|
121 includes="plugins/*, features/com.nokia.carbide.extensions.*/"/> |
|
122 </target> |
|
123 |
|
124 <!-- Analyze target --> |
|
125 <target name="analyze"> |
|
126 <!-- PMD --> |
|
127 <pmd shortFileNames="true"> |
|
128 <!-- Rules --> |
|
129 <ruleset>basic</ruleset> |
|
130 <ruleset>codesize</ruleset> |
|
131 <ruleset>coupling</ruleset> |
|
132 <ruleset>design</ruleset> |
|
133 <ruleset>strictexception</ruleset> |
|
134 <ruleset>strings</ruleset> |
|
135 <ruleset>sunsecure</ruleset> |
|
136 <ruleset>unusedcode</ruleset> |
|
137 <ruleset>junit</ruleset> |
|
138 |
|
139 <!-- XML output --> |
|
140 <formatter type="xml" toFile="${reports.folder}/report.pmd.xml"/> |
|
141 |
|
142 <!-- Files to analyze --> |
|
143 <fileset dir="com.nokia.s60tools.creator/src/"> |
|
144 <include name="**/*.java"/> |
|
145 </fileset> |
|
146 </pmd> |
|
147 </target> |
|
148 |
|
149 <target name="copy_to_carbide"> |
|
150 <!-- Copy the actual plug-ins to the carbide folders --> |
|
151 <copy todir="${carbide.int.folder}" failonerror="true" overwrite="true"> |
|
152 <fileset dir="plugins"/> |
|
153 </copy> |
|
154 <copy todir="${carbide.dev.folder}" failonerror="true" overwrite="true"> |
|
155 <fileset dir="plugins"/> |
|
156 </copy> |
|
157 </target> |
|
158 |
|
159 <!-- Target Build all --> |
|
160 <target name="build.all" depends="delete, build.creator, instr, create.zip, analyze, copy_to_carbide" /> |
|
161 |
|
162 </project> |