r63847 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63846‎ | r63847 | r63848 >
Date:00:01, 17 March 2010
Author:mah
Status:deferred
Tags:
Comment:
* back-track on properties, povide “clean” target instead
* add build.properties file
Modified paths:
  • /trunk/lucene-search-2/build.properties (added) (history)
  • /trunk/lucene-search-2/build.xml (modified) (history)

Diff [purge]

Index: trunk/lucene-search-2/build.properties
@@ -0,0 +1,11 @@
 2+version=2.1
 3+pack.name=lucene-search
 4+pack.src.name=lucene-search-src
 5+binary.name=lucene-search-bin
 6+jar.name=LuceneSearch.jar
 7+
 8+lib.dir=lib
 9+dest.dir=bin
 10+src.dir=src
 11+test.dir=test
 12+dist.dir=dist
Index: trunk/lucene-search-2/build.xml
@@ -1,15 +1,7 @@
22 <?xml version="1.0" encoding="UTF-8"?>
33 <project name="LuceneSearch" default="alljar" basedir=".">
4 - <property name="lib" value="lib"/>
5 - <property name="bin" value="bin"/>
6 - <property name="src" value="src"/>
7 - <property name="jars" value="jars"/>
8 - <property name="test" value="test"/>
9 - <property name="dist" location="dist"/>
10 - <property name="pack.name" value="lucene-search-2.1"/>
11 - <property name="src.name" value="lucene-search-src-2.1"/>
12 - <property name="binary.name" value="ls2.1-bin"/>
13 - <property name="jar.name" value="LuceneSearch.jar"/>
 4+ <property file="build.properties"/>
 5+ <property name="junit.class.dir" value="${test.dir}/classes"/>
146 <property name="include" value="src/** lib/** sql/** test-data/** webinterface/** *-example *.txt
157 lsearch* build.xml scripts/* VERSION configure build update
168 resources/** test/** udplogger/**"/>
@@ -18,10 +10,8 @@
1911 <property name="include.bin" value="*.log4j *.txt config.inc template/** udplogger/**"/>
2012 <property name="include.sh" value="configure build update lsearchd"/>
2113
22 - <property file="${basedir}/hostname"/>
23 -
2414 <path id="classpath">
25 - <fileset dir="${lib}" includes="*.jar"/>
 15+ <fileset dir="${lib.dir}" includes="*.jar"/>
2616 <file name="${jar.name}"/>
2717 </path>
2818
@@ -30,7 +20,7 @@
3121 <sysproperty key="java.rmi.server.codebase" value="file://${basedir}/${jar.name}"/>
3222 <sysproperty key="java.rmi.server.hostname" value="${hostname}"/>
3323 <classpath>
34 - <fileset dir="${lib}">
 24+ <fileset dir="${lib.dir}">
3525 <include name="*.jar"/>
3626 </fileset>
3727 </classpath>
@@ -48,7 +38,7 @@
4939 lib/lucene-analyzers.jar lib/snowball.jar lib/mwdumper.jar
5040 lib/mysql-connector-java-3.0.17-ga-bin.jar"/>
5141 </manifest>
52 - <zipfileset dir="${bin}" prefix="">
 42+ <zipfileset dir="${dest.dir}" prefix="">
5343 <include name="org/**"/>
5444 </zipfileset>
5545 </jar>
@@ -80,53 +70,53 @@
8171
8272
8373 <target name="build" description="Compile classes">
84 - <mkdir dir="${bin}"/>
85 - <javac srcdir="${src}/org/" debug="on" encoding="UTF-8" includes="**/*.java" destdir="${bin}/">
 74+ <mkdir dir="${dest.dir}"/>
 75+ <javac srcdir="${src.dir}/org/" debug="on" encoding="UTF-8" includes="**/*.java" destdir="${dest.dir}/">
8676 <classpath refid="classpath"/>
8777 </javac>
8878 </target>
8979
9080 <target name="pack" description="Make tar.gz distribution">
91 - <mkdir dir="${dist}"/>
92 - <delete file="${dist}/${pack.name}.tar"/>
93 - <delete file="${dist}/${pack.name}.tar.gz"/>
94 - <tar tarfile="${dist}/${pack.name}.tar">
 81+ <mkdir dir="${dist.dir}"/>
 82+ <delete file="${dist.dir}/${pack.name}.tar"/>
 83+ <delete file="${dist.dir}/${pack.name}.tar.gz"/>
 84+ <tar tarfile="${dist.dir}/${pack.name}.tar">
9585 <tarfileset prefix="${pack.name}" dir="." includes="${include}"/>
9686 </tar>
9787
98 - <gzip zipfile="${dist}/${pack.name}.tar.gz" src="${dist}/${pack.name}.tar"/>
99 - <delete file="${dist}/${pack.name}.tar"/>
 88+ <gzip zipfile="${dist.dir}/${pack.name}.tar.gz" src="${dist.dir}/${pack.name}.tar"/>
 89+ <delete file="${dist.dir}/${pack.name}.tar"/>
10090 </target>
10191
10292 <target name="pack-src" depends="alljar" description="Make tar.gz distribution of only core source files">
103 - <mkdir dir="${dist}"/>
104 - <delete file="${dist}/${src.name}.tar"/>
105 - <delete file="${dist}/${src.name}.tar.gz"/>
106 - <tar tarfile="${dist}/${src.name}.tar">
 93+ <mkdir dir="${dist.dir}"/>
 94+ <delete file="${dist.dir}/${src.name}.tar"/>
 95+ <delete file="${dist.dir}/${src.name}.tar.gz"/>
 96+ <tar tarfile="${dist.dir}/${src.name}.tar">
10797 <tarfileset prefix="${pack.name}" dir="." includes="${include.src}"/>
10898 </tar>
10999
110 - <gzip zipfile="${dist}/${src.name}.tar.gz" src="${dist}/${src.name}.tar"/>
111 - <delete file="${dist}/${src.name}.tar"/>
 100+ <gzip zipfile="${dist.dir}/${src.name}.tar.gz" src="${dist.dir}/${src.name}.tar"/>
 101+ <delete file="${dist.dir}/${src.name}.tar"/>
112102 </target>
113103
114104
115105 <target name="binary" depends="alljar" description="Make binary tar.gz distribution">
116 - <mkdir dir="${bin}"/>
117 - <delete file="${dist}/${binary.name}.tar"/>
118 - <delete file="${dist}/${binary.name}.tar.gz"/>
119 - <tar tarfile="${dist}/${binary.name}.tar">
 106+ <mkdir dir="${dest.dir}"/>
 107+ <delete file="${dist.dir}/${binary.name}.tar"/>
 108+ <delete file="${dist.dir}/${binary.name}.tar.gz"/>
 109+ <tar tarfile="${dist.dir}/${binary.name}.tar">
120110 <tarfileset prefix="${pack.name}" dir="." includes="${jar.name} ${include.bin}"
121111 excludes="template/backup/**"/>
122112 <tarfileset prefix="${pack.name}" mode="755" dir="." includes="${include.sh}"/>
123113 </tar>
124114
125 - <gzip zipfile="${dist}/${binary.name}.tar.gz" src="${dist}/${binary.name}.tar"/>
126 - <delete file="${dist}/${binary.name}.tar"/>
 115+ <gzip zipfile="${dist.dir}/${binary.name}.tar.gz" src="${dist.dir}/${binary.name}.tar"/>
 116+ <delete file="${dist.dir}/${binary.name}.tar"/>
127117 </target>
128118
129119 <target name="test-build" description="Compile the junit tests">
130 - <javac srcdir="${test}" destdir="${test}">
 120+ <javac srcdir="${test.dir}" destdir="${test.dir}">
131121 <classpath>
132122 <pathelement path="${java.class.path}"/>
133123 <pathelement location="${collector.dir}"/>
@@ -136,21 +126,30 @@
137127 </target>
138128
139129 <target name="test" depends="test-build">
140 - <property name="collector.dir" value="${test}"/>
141 - <available file="${collector.dir}/${collector.class}.class" property="hasFailingTests"/>
 130+ <property name="collector.dir" value="${test.dir}"/>
 131+ <mkdir dir="${junit.class.dir}"/>
142132
143 - <junit haltonerror="false" haltonfailure="false">
 133+ <junit haltonerror="false" haltonfailure="false" printsummary="yes"
 134+ errorProperty="tests.failed" failureproperty="tests.failed">
144135 <classpath>
145136 <pathelement path="${java.class.path}"/>
146137 <pathelement location="${collector.dir}"/>
147138 <pathelement path="${jar.name}"/>
148139 </classpath>
149 - <sysproperty key="ant.junit.failureCollector" value="${collector.dir}/${collector.class}"/>
150140
151 - <batchtest fork="yes" todir="${collector.dir}" unless="hasFailingTests">
152 - <fileset dir="${collector.dir}" includes="**/*.java" excludes="**/${collector.class}.*"/>
 141+ <batchtest fork="yes" todir="${collector.dir}">
 142+ <fileset dir="${collector.dir}" includes="**/*.java"/>
153143 <formatter type="plain" usefile="false"/>
154144 </batchtest>
155145 </junit>
156146 </target>
 147+ <fail if="tests.failed" message="Test(s) failed."/>
 148+
 149+ <target name="clean"
 150+ description="Destroys all generated files and dirs.">
 151+ <delete dir="${dest.dir}"/>
 152+ <delete dir="${dist.dir}"/>
 153+ <delete dir="${junit.class.dir}"/>
 154+ <delete file="${basedir}/${jar.name}"/>
 155+ </target>
157156 </project>

Status & tagging log