[66] | 1 | <?xml version="1.0"?> |
---|
| 2 | <!-- |
---|
| 3 | Licensed to the Apache Software Foundation (ASF) under one or more |
---|
| 4 | contributor license agreements. See the NOTICE file distributed with |
---|
| 5 | this work for additional information regarding copyright ownership. |
---|
| 6 | The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
| 7 | (the "License"); you may not use this file except in compliance with |
---|
| 8 | the License. You may obtain a copy of the License at |
---|
| 9 | |
---|
| 10 | http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 11 | |
---|
| 12 | Unless required by applicable law or agreed to in writing, software |
---|
| 13 | distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 15 | See the License for the specific language governing permissions and |
---|
[67] | 16 | limitations under this License. |
---|
[66] | 17 | --> |
---|
| 18 | <project name="Nutch" default="job"> |
---|
| 19 | |
---|
| 20 | <!-- Load all the default properties, and any the user wants --> |
---|
| 21 | <!-- to contribute (without having to type -D or edit this file --> |
---|
| 22 | <property file="${user.home}/build.properties" /> |
---|
| 23 | <property file="${basedir}/build.properties" /> |
---|
| 24 | <property file="${basedir}/default.properties" /> |
---|
| 25 | <property name="test.junit.output.format" value="plain"/> |
---|
| 26 | |
---|
| 27 | <!-- the normal classpath --> |
---|
| 28 | <path id="classpath"> |
---|
| 29 | <pathelement location="${build.classes}"/> |
---|
| 30 | <fileset dir="${lib.dir}"> |
---|
| 31 | <include name="*.jar" /> |
---|
| 32 | </fileset> |
---|
| 33 | </path> |
---|
| 34 | |
---|
| 35 | <!-- the unit test classpath --> |
---|
| 36 | <dirname property="plugins.classpath.dir" file="${build.plugins}"/> |
---|
| 37 | <path id="test.classpath"> |
---|
| 38 | <pathelement location="${test.build.classes}" /> |
---|
| 39 | <pathelement location="${conf.dir}"/> |
---|
| 40 | <pathelement location="${test.src.dir}"/> |
---|
| 41 | <pathelement location="${plugins.classpath.dir}"/> |
---|
| 42 | <path refid="classpath"/> |
---|
| 43 | <pathelement location="${build.dir}/${final.name}.job" /> |
---|
| 44 | </path> |
---|
| 45 | |
---|
| 46 | <!-- xmlcatalog definition for xslt task --> |
---|
| 47 | <xmlcatalog id="docDTDs"> |
---|
| 48 | <dtd publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
| 49 | location="${xmlcatalog.dir}/xhtml1-transitional.dtd"/> |
---|
| 50 | </xmlcatalog> |
---|
| 51 | |
---|
| 52 | <!-- ====================================================== --> |
---|
| 53 | <!-- Stuff needed by all targets --> |
---|
| 54 | <!-- ====================================================== --> |
---|
| 55 | <target name="init"> |
---|
| 56 | <mkdir dir="${build.dir}"/> |
---|
| 57 | <mkdir dir="${build.classes}"/> |
---|
| 58 | |
---|
| 59 | <mkdir dir="${test.build.dir}"/> |
---|
| 60 | <mkdir dir="${test.build.classes}"/> |
---|
| 61 | |
---|
| 62 | <touch datetime="01/25/1971 2:00 pm"> |
---|
| 63 | <fileset dir="${conf.dir}" includes="**/*.template"/> |
---|
| 64 | </touch> |
---|
| 65 | |
---|
| 66 | <copy todir="${conf.dir}" verbose="true"> |
---|
| 67 | <fileset dir="${conf.dir}" includes="**/*.template"/> |
---|
| 68 | <mapper type="glob" from="*.template" to="*"/> |
---|
| 69 | </copy> |
---|
| 70 | |
---|
| 71 | <!-- unpack hadoop scripts from hadoop jar into bin directory --> |
---|
| 72 | <mkdir dir="${build.dir}/hadoop"/> |
---|
| 73 | <unjar dest="${build.dir}/hadoop"> |
---|
| 74 | <fileset dir="${lib.dir}" includes="hadoop*.jar"/> |
---|
| 75 | <patternset includes="bin.tgz"/> |
---|
| 76 | </unjar> |
---|
| 77 | |
---|
| 78 | <untar src="${build.dir}/hadoop/bin.tgz" dest="bin" compression="gzip"/> |
---|
| 79 | <!-- fix broken library paths with spaces --> |
---|
| 80 | <replace file="bin/hadoop" token="PlatformName" value="PlatformName | sed -e 's/ /_/g'"/> |
---|
| 81 | <chmod dir="bin" perm="ugo+rx" includes="*.sh,hadoop"/> |
---|
| 82 | |
---|
| 83 | <!-- unpack hadoop webapp from hadoop jar into build directory --> |
---|
| 84 | <mkdir dir="${build.dir}/webapps"/> |
---|
| 85 | <unjar dest="${build.dir}"> |
---|
| 86 | <fileset dir="${lib.dir}" includes="hadoop*.jar"/> |
---|
| 87 | <patternset includes="webapps/**"/> |
---|
| 88 | </unjar> |
---|
| 89 | |
---|
| 90 | </target> |
---|
| 91 | |
---|
| 92 | <!-- ====================================================== --> |
---|
| 93 | <!-- Compile the Java files --> |
---|
| 94 | <!-- ====================================================== --> |
---|
| 95 | <target name="compile" depends="compile-core, compile-plugins"/> |
---|
| 96 | |
---|
| 97 | <target name="compile-core" depends="init"> |
---|
| 98 | <javac |
---|
| 99 | encoding="${build.encoding}" |
---|
| 100 | srcdir="${src.dir}" |
---|
| 101 | includes="org/apache/nutch/**/*.java" |
---|
| 102 | destdir="${build.classes}" |
---|
| 103 | debug="${javac.debug}" |
---|
| 104 | optimize="${javac.optimize}" |
---|
| 105 | target="${javac.version}" |
---|
| 106 | source="${javac.version}" |
---|
| 107 | deprecation="${javac.deprecation}"> |
---|
| 108 | <classpath refid="classpath"/> |
---|
| 109 | </javac> |
---|
| 110 | </target> |
---|
| 111 | |
---|
| 112 | <target name="compile-plugins"> |
---|
| 113 | <ant dir="src/plugin" target="deploy" inheritAll="false"/> |
---|
| 114 | </target> |
---|
| 115 | |
---|
| 116 | <target name="generate-src" depends="init"> |
---|
| 117 | <javacc target="${src.dir}/org/apache/nutch/analysis/NutchAnalysis.jj" |
---|
| 118 | javacchome="${javacc.home}"> |
---|
| 119 | </javacc> |
---|
| 120 | |
---|
| 121 | <fixcrlf srcdir="${src.dir}" eol="lf" includes="**/*.java"/> |
---|
| 122 | |
---|
| 123 | </target> |
---|
| 124 | |
---|
| 125 | <target name="dynamic" depends="generate-src, compile"> |
---|
| 126 | </target> |
---|
| 127 | |
---|
| 128 | <!-- ================================================================== --> |
---|
| 129 | <!-- Make nutch.jar --> |
---|
| 130 | <!-- ================================================================== --> |
---|
| 131 | <!-- --> |
---|
| 132 | <!-- ================================================================== --> |
---|
| 133 | <target name="jar" depends="compile-core"> |
---|
| 134 | <copy file="${conf.dir}/nutch-default.xml" |
---|
| 135 | todir="${build.classes}"/> |
---|
| 136 | <copy file="${conf.dir}/nutch-site.xml" |
---|
| 137 | todir="${build.classes}"/> |
---|
| 138 | <jar jarfile="${build.dir}/${final.name}.jar" |
---|
| 139 | basedir="${build.classes}"> |
---|
| 140 | <manifest> |
---|
| 141 | </manifest> |
---|
| 142 | </jar> |
---|
| 143 | </target> |
---|
| 144 | |
---|
| 145 | <!-- ================================================================== --> |
---|
| 146 | <!-- Make job jar --> |
---|
| 147 | <!-- ================================================================== --> |
---|
| 148 | <!-- --> |
---|
| 149 | <!-- ================================================================== --> |
---|
| 150 | <target name="job" depends="compile"> |
---|
| 151 | <jar jarfile="${build.dir}/${final.name}.job"> |
---|
| 152 | <zipfileset dir="${build.classes}"/> |
---|
| 153 | <zipfileset dir="${conf.dir}" excludes="*.template,hadoop*.*"/> |
---|
| 154 | <zipfileset dir="${lib.dir}" prefix="lib" |
---|
| 155 | includes="**/*.jar" excludes="hadoop-*.jar"/> |
---|
| 156 | <zipfileset dir="${build.plugins}" prefix="plugins"/> |
---|
| 157 | </jar> |
---|
| 158 | </target> |
---|
| 159 | |
---|
| 160 | <!-- ================================================================== --> |
---|
| 161 | <!-- Make nutch.war --> |
---|
| 162 | <!-- ================================================================== --> |
---|
| 163 | <!-- --> |
---|
| 164 | <!-- ================================================================== --> |
---|
| 165 | <target name="war" depends="jar,compile,generate-docs"> |
---|
| 166 | |
---|
| 167 | <!-- generate the nutch.xml (servlet context) file --> |
---|
| 168 | <xslt in="${basedir}/conf/nutch-default.xml" |
---|
| 169 | out="${build.dir}/nutch.xml" |
---|
| 170 | style="${basedir}/conf/context.xsl"> |
---|
| 171 | <xmlcatalog refid="docDTDs"/> |
---|
| 172 | <outputproperty name="indent" value="yes"/> |
---|
| 173 | </xslt> |
---|
| 174 | <war destfile="${build.dir}/${final.name}.war" |
---|
| 175 | webxml="${web.src.dir}/web.xml"> |
---|
| 176 | <fileset dir="${web.src.dir}/jsp"/> |
---|
| 177 | <zipfileset dir="${docs.src}" includes="include/*.html"/> |
---|
| 178 | <zipfileset dir="${build.docs}" includes="*/include/*.html"/> |
---|
| 179 | <fileset dir="${docs.dir}"/> |
---|
| 180 | <lib dir="${lib.dir}"> |
---|
| 181 | <include name="lucene*.jar"/> |
---|
| 182 | <include name="taglibs-*.jar"/> |
---|
| 183 | <include name="hadoop-*.jar"/> |
---|
| 184 | <include name="dom4j-*.jar"/> |
---|
| 185 | <include name="xerces-*.jar"/> |
---|
| 186 | <include name="tika-*.jar"/> |
---|
| 187 | <include name="apache-solr-*.jar"/> |
---|
| 188 | <include name="commons-httpclient-*.jar"/> |
---|
| 189 | <include name="commons-codec-*.jar"/> |
---|
| 190 | <include name="commons-collections-*.jar"/> |
---|
| 191 | <include name="commons-beanutils-*.jar"/> |
---|
| 192 | <include name="commons-cli-*.jar"/> |
---|
| 193 | <include name="commons-lang-*.jar"/> |
---|
| 194 | <include name="commons-logging-*.jar"/> |
---|
| 195 | <include name="log4j-*.jar"/> |
---|
| 196 | </lib> |
---|
| 197 | <lib dir="${build.dir}"> |
---|
| 198 | <include name="${final.name}.jar"/> |
---|
| 199 | </lib> |
---|
| 200 | <classes dir="${conf.dir}" excludes="**/*.template"/> |
---|
| 201 | <classes dir="${web.src.dir}/locale"/> |
---|
| 202 | <classes file="${web.src.dir}/log4j.properties"/> |
---|
| 203 | <zipfileset prefix="WEB-INF/classes/plugins" dir="${build.plugins}"/> |
---|
| 204 | <webinf dir="${lib.dir}"> |
---|
| 205 | <include name="taglibs-*.tld"/> |
---|
| 206 | </webinf> |
---|
| 207 | </war> |
---|
| 208 | </target> |
---|
| 209 | |
---|
| 210 | |
---|
| 211 | <!-- ================================================================== --> |
---|
| 212 | <!-- Compile test code --> |
---|
| 213 | <!-- ================================================================== --> |
---|
| 214 | <target name="compile-core-test" depends="compile-core"> |
---|
| 215 | <javac |
---|
| 216 | encoding="${build.encoding}" |
---|
| 217 | srcdir="${test.src.dir}" |
---|
| 218 | includes="org/apache/nutch/**/*.java" |
---|
| 219 | destdir="${test.build.classes}" |
---|
| 220 | debug="${javac.debug}" |
---|
| 221 | optimize="${javac.optimize}" |
---|
| 222 | target="${javac.version}" |
---|
| 223 | source="${javac.version}" |
---|
| 224 | deprecation="${javac.deprecation}"> |
---|
| 225 | <classpath refid="test.classpath"/> |
---|
| 226 | </javac> |
---|
| 227 | </target> |
---|
| 228 | |
---|
| 229 | <!-- ================================================================== --> |
---|
| 230 | <!-- Run code checks (PMD) --> |
---|
| 231 | <!-- ================================================================== --> |
---|
| 232 | <target name="pmd" depends="compile"> |
---|
| 233 | <property name="pmd.report" location="${build.dir}/pmd-report.html" /> |
---|
| 234 | <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask"> |
---|
| 235 | <classpath> |
---|
| 236 | <fileset dir="${lib.dir}"> |
---|
| 237 | <include name="pmd-ext/*.jar" /> |
---|
| 238 | <include name="xerces*.jar" /> |
---|
| 239 | </fileset> |
---|
| 240 | </classpath> |
---|
| 241 | </taskdef> |
---|
| 242 | <pmd shortFilenames="true" failonerror="true" failOnRuleViolation="false" |
---|
| 243 | encoding="${build.encoding}" failuresPropertyName="pmd.failures"> |
---|
| 244 | <ruleset>unusedcode</ruleset> |
---|
| 245 | <!--ruleset>basic</ruleset--> |
---|
| 246 | <!--ruleset>optimizations</ruleset--> |
---|
| 247 | <formatter type="html" toFile="${pmd.report}" /> |
---|
| 248 | <!-- <formatter type="xml" toFile="${tempbuild}/$report_pmd.xml"/> --> |
---|
| 249 | <fileset dir="${basedir}/src"> |
---|
| 250 | <include name="java/**/*.java"/> |
---|
| 251 | <include name="plugin/**/*.java"/> |
---|
| 252 | <!-- Exclude generated sources --> |
---|
| 253 | <exclude name="**/NutchAnalysis.java" /> |
---|
| 254 | <exclude name="**/NutchAnalysisTokenManager.java" /> |
---|
| 255 | </fileset> |
---|
| 256 | </pmd> |
---|
| 257 | <condition property="pmd.stop" value="true"> |
---|
| 258 | <and> |
---|
| 259 | <isset property="pmd.failures" /> |
---|
| 260 | <not> |
---|
| 261 | <equals arg1="0" arg2="${pmd.failures}" trim="true" /> |
---|
| 262 | </not> |
---|
| 263 | </and> |
---|
| 264 | </condition> |
---|
| 265 | <fail if="pmd.stop">FAILURE: PMD shows ${pmd.failures} rule violations. See ${pmd.report} for details.</fail> |
---|
| 266 | </target> |
---|
| 267 | |
---|
| 268 | <!-- ================================================================== --> |
---|
| 269 | <!-- Run unit tests --> |
---|
| 270 | <!-- ================================================================== --> |
---|
| 271 | <target name="test" depends="test-core, test-plugins"/> |
---|
| 272 | |
---|
| 273 | <target name="test-core" depends="job, compile-core-test"> |
---|
| 274 | |
---|
| 275 | <delete dir="${test.build.data}"/> |
---|
| 276 | <mkdir dir="${test.build.data}"/> |
---|
| 277 | <!-- |
---|
| 278 | copy resources needed in junit tests |
---|
| 279 | --> |
---|
| 280 | <copy todir="${test.build.data}"> |
---|
| 281 | <fileset dir="src/testresources" includes="**/*"/> |
---|
| 282 | </copy> |
---|
| 283 | <copy file="${test.src.dir}/nutch-site.xml" |
---|
| 284 | todir="${test.build.classes}"/> |
---|
| 285 | |
---|
| 286 | <copy file="${test.src.dir}/log4j.properties" |
---|
| 287 | todir="${test.build.classes}"/> |
---|
| 288 | |
---|
| 289 | <junit printsummary="yes" haltonfailure="no" fork="yes" dir="${basedir}" |
---|
| 290 | errorProperty="tests.failed" failureProperty="tests.failed" maxmemory="1000m"> |
---|
| 291 | <sysproperty key="test.build.data" value="${test.build.data}"/> |
---|
| 292 | <sysproperty key="test.src.dir" value="${test.src.dir}"/> |
---|
| 293 | <classpath refid="test.classpath"/> |
---|
| 294 | <formatter type="${test.junit.output.format}" /> |
---|
| 295 | <batchtest todir="${test.build.dir}" unless="testcase"> |
---|
| 296 | <fileset dir="${test.src.dir}" |
---|
| 297 | includes="**/Test*.java" excludes="**/${test.exclude}.java" /> |
---|
| 298 | </batchtest> |
---|
| 299 | <batchtest todir="${test.build.dir}" if="testcase"> |
---|
| 300 | <fileset dir="${test.src.dir}" includes="**/${testcase}.java"/> |
---|
| 301 | </batchtest> |
---|
| 302 | </junit> |
---|
| 303 | |
---|
| 304 | <fail if="tests.failed">Tests failed!</fail> |
---|
| 305 | |
---|
| 306 | </target> |
---|
| 307 | |
---|
| 308 | <target name="test-plugins" depends="compile"> |
---|
| 309 | <ant dir="src/plugin" target="test" inheritAll="false"/> |
---|
| 310 | </target> |
---|
| 311 | |
---|
| 312 | <target name="nightly" depends="test, tar"> |
---|
| 313 | </target> |
---|
| 314 | |
---|
| 315 | <!-- ================================================================== --> |
---|
| 316 | <!-- Documentation --> |
---|
| 317 | <!-- ================================================================== --> |
---|
| 318 | <target name="javadoc" depends="compile"> |
---|
| 319 | <mkdir dir="${build.javadoc}"/> |
---|
| 320 | <javadoc |
---|
| 321 | overview="${src.dir}/overview.html" |
---|
| 322 | destdir="${build.javadoc}" |
---|
| 323 | author="true" |
---|
| 324 | version="true" |
---|
| 325 | use="true" |
---|
| 326 | windowtitle="${Name} ${version} API" |
---|
| 327 | doctitle="${Name} ${version} API" |
---|
| 328 | bottom="Copyright &copy; ${year} The Apache Software Foundation" |
---|
| 329 | > |
---|
| 330 | <arg value="${javadoc.proxy.host}"/> |
---|
| 331 | <arg value="${javadoc.proxy.port}"/> |
---|
| 332 | |
---|
| 333 | <packageset dir="${src.dir}"/> |
---|
| 334 | <packageset dir="${plugins.dir}/lib-http/src/java"/> |
---|
| 335 | <packageset dir="${plugins.dir}/lib-parsems/src/java"/> |
---|
| 336 | <packageset dir="${plugins.dir}/lib-regex-filter/src/java"/> |
---|
| 337 | <packageset dir="${plugins.dir}/microformats-reltag/src/java"/> |
---|
| 338 | <packageset dir="${plugins.dir}/ontology/src/java"/> |
---|
| 339 | <packageset dir="${plugins.dir}/protocol-file/src/java"/> |
---|
| 340 | <packageset dir="${plugins.dir}/protocol-ftp/src/java"/> |
---|
| 341 | <packageset dir="${plugins.dir}/protocol-http/src/java"/> |
---|
| 342 | <packageset dir="${plugins.dir}/protocol-httpclient/src/java"/> |
---|
| 343 | <packageset dir="${plugins.dir}/parse-ext/src/java"/> |
---|
| 344 | <packageset dir="${plugins.dir}/parse-html/src/java"/> |
---|
| 345 | <packageset dir="${plugins.dir}/parse-js/src/java"/> |
---|
| 346 | <packageset dir="${plugins.dir}/parse-text/src/java"/> |
---|
| 347 | <packageset dir="${plugins.dir}/parse-pdf/src/java"/> |
---|
| 348 | <!-- <packageset dir="${plugins.dir}/parse-rtf/src/java"/> plugin excluded from build due to licensing issues--> |
---|
| 349 | <!-- <packageset dir="${plugins.dir}/parse-mp3/src/java"/> plugin excluded from build due to licensing issues--> |
---|
| 350 | <packageset dir="${plugins.dir}/parse-msexcel/src/java"/> |
---|
| 351 | <packageset dir="${plugins.dir}/parse-mspowerpoint/src/java"/> |
---|
| 352 | <packageset dir="${plugins.dir}/parse-msword/src/java"/> |
---|
| 353 | <packageset dir="${plugins.dir}/parse-oo/src/java"/> |
---|
| 354 | <packageset dir="${plugins.dir}/parse-rss/src/java"/> |
---|
| 355 | <packageset dir="${plugins.dir}/parse-swf/src/java"/> |
---|
| 356 | <packageset dir="${plugins.dir}/parse-zip/src/java"/> |
---|
| 357 | <packageset dir="${plugins.dir}/index-basic/src/java"/> |
---|
| 358 | <packageset dir="${plugins.dir}/index-more/src/java"/> |
---|
| 359 | <packageset dir="${plugins.dir}/query-basic/src/java"/> |
---|
| 360 | <packageset dir="${plugins.dir}/query-more/src/java"/> |
---|
| 361 | <packageset dir="${plugins.dir}/query-site/src/java"/> |
---|
| 362 | <packageset dir="${plugins.dir}/query-url/src/java"/> |
---|
| 363 | <packageset dir="${plugins.dir}/scoring-opic/src/java"/> |
---|
| 364 | <packageset dir="${plugins.dir}/summary-basic/src/java"/> |
---|
| 365 | <packageset dir="${plugins.dir}/summary-lucene/src/java"/> |
---|
| 366 | <packageset dir="${plugins.dir}/urlfilter-automaton/src/java"/> |
---|
| 367 | <packageset dir="${plugins.dir}/urlfilter-regex/src/java"/> |
---|
| 368 | <packageset dir="${plugins.dir}/urlfilter-prefix/src/java"/> |
---|
| 369 | <packageset dir="${plugins.dir}/creativecommons/src/java"/> |
---|
| 370 | <packageset dir="${plugins.dir}/languageidentifier/src/java"/> |
---|
| 371 | <packageset dir="${plugins.dir}/clustering-carrot2/src/java"/> |
---|
| 372 | <packageset dir="${plugins.dir}/ontology/src/java"/> |
---|
| 373 | |
---|
| 374 | <link href="${javadoc.link.java}"/> |
---|
| 375 | <link href="${javadoc.link.lucene}"/> |
---|
| 376 | <link href="${javadoc.link.hadoop}"/> |
---|
| 377 | |
---|
| 378 | <classpath refid="classpath"/> |
---|
| 379 | <classpath> |
---|
| 380 | <fileset dir="${plugins.dir}" > |
---|
| 381 | <include name="**/*.jar"/> |
---|
| 382 | </fileset> |
---|
| 383 | </classpath> |
---|
| 384 | |
---|
| 385 | <group title="Core" packages="org.apache.nutch.*"/> |
---|
| 386 | <group title="Plugins API" packages="${plugins.api}"/> |
---|
| 387 | <group title="Protocol Plugins" packages="${plugins.protocol}"/> |
---|
| 388 | <group title="URL Filter Plugins" packages="${plugins.urlfilter}"/> |
---|
| 389 | <group title="Scoring Plugins" packages="${plugins.scoring}"/> |
---|
| 390 | <group title="Parse Plugins" packages="${plugins.parse}"/> |
---|
| 391 | <group title="Analysis Plugins" packages="${plugins.analysis}"/> |
---|
| 392 | <group title="Indexing Filter Plugins" packages="${plugins.index}"/> |
---|
| 393 | <group title="Query Filter Plugins" packages="${plugins.query}"/> |
---|
| 394 | <group title="Summary Plugins" packages="${plugins.summary}"/> |
---|
| 395 | <group title="Clustering Plugins" packages="${plugins.clustering}"/> |
---|
| 396 | <group title="Ontology Plugins" packages="${plugins.ontology}"/> |
---|
| 397 | <group title="Misc. Plugins" packages="${plugins.misc}"/> |
---|
| 398 | </javadoc> |
---|
| 399 | <!-- Copy the plugin.dtd file to the plugin doc-files dir --> |
---|
| 400 | <copy file="${plugins.dir}/plugin.dtd" |
---|
| 401 | todir="${build.javadoc}/org/apache/nutch/plugin/doc-files"/> |
---|
| 402 | </target> |
---|
| 403 | |
---|
| 404 | <target name="default-doc"> |
---|
| 405 | <style basedir="${conf.dir}" destdir="${docs.dir}" |
---|
| 406 | includes="nutch-default.xml" style="conf/nutch-conf.xsl"/> |
---|
| 407 | </target> |
---|
| 408 | |
---|
| 409 | <target name="generate-locale" if="doc.locale"> |
---|
| 410 | <echo message="Generating docs for locale=${doc.locale}"/> |
---|
| 411 | |
---|
| 412 | <mkdir dir="${build.docs}/${doc.locale}/include"/> |
---|
| 413 | <xslt in="${docs.src}/include/${doc.locale}/header.xml" |
---|
| 414 | out="${build.docs}/${doc.locale}/include/header.html" |
---|
| 415 | style="${docs.src}/style/nutch-header.xsl"> |
---|
| 416 | <xmlcatalog refid="docDTDs"/> |
---|
| 417 | </xslt> |
---|
| 418 | |
---|
| 419 | <dependset> |
---|
| 420 | <srcfileset dir="${docs.src}/include/${doc.locale}" includes="*.xml"/> |
---|
| 421 | <srcfileset dir="${docs.src}/style" includes="*.xsl"/> |
---|
| 422 | <targetfileset dir="${docs.dir}/${doc.locale}" includes="*.html"/> |
---|
| 423 | </dependset> |
---|
| 424 | |
---|
| 425 | <copy file="${docs.src}/style/nutch-page.xsl" |
---|
| 426 | todir="${build.docs}/${doc.locale}" |
---|
| 427 | preservelastmodified="true"/> |
---|
| 428 | |
---|
| 429 | <xslt basedir="${docs.src}/pages/${doc.locale}" |
---|
| 430 | destdir="${docs.dir}/${doc.locale}" |
---|
| 431 | includes="*.xml" |
---|
| 432 | style="${build.docs}/${doc.locale}/nutch-page.xsl"> |
---|
| 433 | <xmlcatalog refid="docDTDs"/> |
---|
| 434 | </xslt> |
---|
| 435 | </target> |
---|
| 436 | |
---|
| 437 | |
---|
| 438 | <target name="generate-docs" depends="init"> |
---|
| 439 | <dependset> |
---|
| 440 | <srcfileset dir="${docs.src}/include" includes="*.html"/> |
---|
| 441 | <targetfileset dir="${docs.dir}" includes="**/*.html"/> |
---|
| 442 | </dependset> |
---|
| 443 | |
---|
| 444 | <mkdir dir="${build.docs}/include"/> |
---|
| 445 | <copy todir="${build.docs}/include"> |
---|
| 446 | <fileset dir="${docs.src}/include"/> |
---|
| 447 | </copy> |
---|
| 448 | |
---|
| 449 | <antcall target="generate-locale"> |
---|
| 450 | <param name="doc.locale" value="ca"/> |
---|
| 451 | </antcall> |
---|
| 452 | |
---|
| 453 | <antcall target="generate-locale"> |
---|
| 454 | <param name="doc.locale" value="de"/> |
---|
| 455 | </antcall> |
---|
| 456 | |
---|
| 457 | <antcall target="generate-locale"> |
---|
| 458 | <param name="doc.locale" value="en"/> |
---|
| 459 | </antcall> |
---|
| 460 | |
---|
| 461 | <antcall target="generate-locale"> |
---|
| 462 | <param name="doc.locale" value="es"/> |
---|
| 463 | </antcall> |
---|
| 464 | |
---|
| 465 | <antcall target="generate-locale"> |
---|
| 466 | <param name="doc.locale" value="fi"/> |
---|
| 467 | </antcall> |
---|
| 468 | |
---|
| 469 | <antcall target="generate-locale"> |
---|
| 470 | <param name="doc.locale" value="fr"/> |
---|
| 471 | </antcall> |
---|
| 472 | |
---|
| 473 | <antcall target="generate-locale"> |
---|
| 474 | <param name="doc.locale" value="hu"/> |
---|
| 475 | </antcall> |
---|
| 476 | |
---|
| 477 | <antcall target="generate-locale"> |
---|
| 478 | <param name="doc.locale" value="it"/> |
---|
| 479 | </antcall> |
---|
| 480 | |
---|
| 481 | <antcall target="generate-locale"> |
---|
| 482 | <param name="doc.locale" value="jp"/> |
---|
| 483 | </antcall> |
---|
| 484 | |
---|
| 485 | <antcall target="generate-locale"> |
---|
| 486 | <param name="doc.locale" value="ms"/> |
---|
| 487 | </antcall> |
---|
| 488 | |
---|
| 489 | <antcall target="generate-locale"> |
---|
| 490 | <param name="doc.locale" value="nl"/> |
---|
| 491 | </antcall> |
---|
| 492 | |
---|
| 493 | <antcall target="generate-locale"> |
---|
| 494 | <param name="doc.locale" value="pl"/> |
---|
| 495 | </antcall> |
---|
| 496 | |
---|
| 497 | <antcall target="generate-locale"> |
---|
| 498 | <param name="doc.locale" value="pt"/> |
---|
| 499 | </antcall> |
---|
| 500 | |
---|
| 501 | <antcall target="generate-locale"> |
---|
| 502 | <param name="doc.locale" value="sh"/> |
---|
| 503 | </antcall> |
---|
| 504 | |
---|
| 505 | <antcall target="generate-locale"> |
---|
| 506 | <param name="doc.locale" value="sr"/> |
---|
| 507 | </antcall> |
---|
| 508 | |
---|
| 509 | <antcall target="generate-locale"> |
---|
| 510 | <param name="doc.locale" value="sv"/> |
---|
| 511 | </antcall> |
---|
| 512 | |
---|
| 513 | <antcall target="generate-locale"> |
---|
| 514 | <param name="doc.locale" value="th"/> |
---|
| 515 | </antcall> |
---|
| 516 | |
---|
| 517 | <antcall target="generate-locale"> |
---|
| 518 | <param name="doc.locale" value="zh"/> |
---|
| 519 | </antcall> |
---|
| 520 | |
---|
| 521 | <fixcrlf srcdir="${docs.dir}" eol="lf" encoding="utf-8" |
---|
| 522 | includes="**/*.html"/> |
---|
| 523 | |
---|
| 524 | </target> |
---|
| 525 | |
---|
| 526 | <!-- ================================================================== --> |
---|
| 527 | <!-- D I S T R I B U T I O N --> |
---|
| 528 | <!-- ================================================================== --> |
---|
| 529 | <!-- --> |
---|
| 530 | <!-- ================================================================== --> |
---|
| 531 | <target name="package" depends="jar, job, war, javadoc"> |
---|
| 532 | <mkdir dir="${dist.dir}"/> |
---|
| 533 | <mkdir dir="${dist.dir}/lib"/> |
---|
| 534 | <mkdir dir="${dist.dir}/bin"/> |
---|
| 535 | <mkdir dir="${dist.dir}/docs"/> |
---|
| 536 | <mkdir dir="${dist.dir}/docs/api"/> |
---|
| 537 | <mkdir dir="${dist.dir}/plugins"/> |
---|
| 538 | |
---|
| 539 | <copy todir="${dist.dir}/lib" includeEmptyDirs="false"> |
---|
| 540 | <fileset dir="lib"/> |
---|
| 541 | </copy> |
---|
| 542 | |
---|
| 543 | <copy todir="${dist.dir}/plugins"> |
---|
| 544 | <fileset dir="${build.plugins}"/> |
---|
| 545 | </copy> |
---|
| 546 | |
---|
| 547 | <copy todir="${dist.dir}/webapps"> |
---|
| 548 | <fileset dir="${build.webapps}"/> |
---|
| 549 | </copy> |
---|
| 550 | |
---|
| 551 | <copy file="${build.dir}/${final.name}.jar" todir="${dist.dir}"/> |
---|
| 552 | <copy file="${build.dir}/${final.name}.job" todir="${dist.dir}"/> |
---|
| 553 | <copy file="${build.dir}/${final.name}.war" todir="${dist.dir}"/> |
---|
| 554 | |
---|
| 555 | <copy todir="${dist.dir}/bin"> |
---|
| 556 | <fileset dir="bin"/> |
---|
| 557 | </copy> |
---|
| 558 | |
---|
| 559 | <copy todir="${dist.dir}/conf"> |
---|
| 560 | <fileset dir="${conf.dir}" excludes="**/*.template"/> |
---|
| 561 | </copy> |
---|
| 562 | |
---|
| 563 | <chmod perm="ugo+x" type="file"> |
---|
| 564 | <fileset dir="${dist.dir}/bin"/> |
---|
| 565 | </chmod> |
---|
| 566 | |
---|
| 567 | <copy todir="${dist.dir}/docs"> |
---|
| 568 | <fileset dir="${docs.dir}"/> |
---|
| 569 | </copy> |
---|
| 570 | |
---|
| 571 | <copy todir="${dist.dir}/docs/api"> |
---|
| 572 | <fileset dir="${build.javadoc}"/> |
---|
| 573 | </copy> |
---|
| 574 | |
---|
| 575 | <copy todir="${dist.dir}"> |
---|
| 576 | <fileset dir="."> |
---|
| 577 | <include name="*.txt" /> |
---|
| 578 | <include name="KEYS" /> |
---|
| 579 | </fileset> |
---|
| 580 | </copy> |
---|
| 581 | |
---|
| 582 | <copy todir="${dist.dir}/src" includeEmptyDirs="true"> |
---|
| 583 | <fileset dir="src"/> |
---|
| 584 | </copy> |
---|
| 585 | |
---|
| 586 | <copy todir="${dist.dir}/" file="build.xml"/> |
---|
| 587 | <copy todir="${dist.dir}/" file="default.properties"/> |
---|
| 588 | |
---|
| 589 | </target> |
---|
| 590 | |
---|
| 591 | <!-- ================================================================== --> |
---|
| 592 | <!-- Make release tarball --> |
---|
| 593 | <!-- ================================================================== --> |
---|
| 594 | <target name="tar" depends="package"> |
---|
| 595 | <tar compression="gzip" longfile="gnu" |
---|
| 596 | destfile="${build.dir}/${final.name}.tar.gz"> |
---|
| 597 | <tarfileset dir="${build.dir}" mode="664"> |
---|
| 598 | <exclude name="${final.name}/bin/*" /> |
---|
| 599 | <include name="${final.name}/**" /> |
---|
| 600 | </tarfileset> |
---|
| 601 | <tarfileset dir="${build.dir}" mode="755"> |
---|
| 602 | <include name="${final.name}/bin/*" /> |
---|
| 603 | </tarfileset> |
---|
| 604 | </tar> |
---|
| 605 | </target> |
---|
| 606 | |
---|
| 607 | <!-- ================================================================== --> |
---|
| 608 | <!-- Clean. Delete the build files, and their directories --> |
---|
| 609 | <!-- ================================================================== --> |
---|
| 610 | <target name="clean"> |
---|
| 611 | <delete dir="${build.dir}"/> |
---|
| 612 | </target> |
---|
| 613 | |
---|
| 614 | <!-- ================================================================== --> |
---|
| 615 | <!-- RAT targets --> |
---|
| 616 | <!-- ================================================================== --> |
---|
| 617 | <target name="rat-sources-typedef"> |
---|
| 618 | <typedef resource="org/apache/rat/anttasks/antlib.xml" > |
---|
| 619 | <classpath> |
---|
| 620 | <fileset dir="." includes="rat*.jar"/> |
---|
| 621 | </classpath> |
---|
| 622 | </typedef> |
---|
| 623 | </target> |
---|
| 624 | |
---|
| 625 | <target name="rat-sources" depends="rat-sources-typedef" |
---|
| 626 | description="runs the tasks over src/java"> |
---|
| 627 | <rat:report xmlns:rat="antlib:org.apache.rat.anttasks"> |
---|
| 628 | <fileset dir="src"> |
---|
| 629 | <include name="java/**/*"/> |
---|
| 630 | <include name="plugin/**/src/**/*"/> |
---|
| 631 | </fileset> |
---|
| 632 | </rat:report> |
---|
| 633 | </target> |
---|
| 634 | |
---|
| 635 | </project> |
---|