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 @@ |
2 | 2 | <?xml version="1.0" encoding="UTF-8"?> |
3 | 3 | <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"/> |
14 | 6 | <property name="include" value="src/** lib/** sql/** test-data/** webinterface/** *-example *.txt |
15 | 7 | lsearch* build.xml scripts/* VERSION configure build update |
16 | 8 | resources/** test/** udplogger/**"/> |
— | — | @@ -18,10 +10,8 @@ |
19 | 11 | <property name="include.bin" value="*.log4j *.txt config.inc template/** udplogger/**"/> |
20 | 12 | <property name="include.sh" value="configure build update lsearchd"/> |
21 | 13 | |
22 | | - <property file="${basedir}/hostname"/> |
23 | | - |
24 | 14 | <path id="classpath"> |
25 | | - <fileset dir="${lib}" includes="*.jar"/> |
| 15 | + <fileset dir="${lib.dir}" includes="*.jar"/> |
26 | 16 | <file name="${jar.name}"/> |
27 | 17 | </path> |
28 | 18 | |
— | — | @@ -30,7 +20,7 @@ |
31 | 21 | <sysproperty key="java.rmi.server.codebase" value="file://${basedir}/${jar.name}"/> |
32 | 22 | <sysproperty key="java.rmi.server.hostname" value="${hostname}"/> |
33 | 23 | <classpath> |
34 | | - <fileset dir="${lib}"> |
| 24 | + <fileset dir="${lib.dir}"> |
35 | 25 | <include name="*.jar"/> |
36 | 26 | </fileset> |
37 | 27 | </classpath> |
— | — | @@ -48,7 +38,7 @@ |
49 | 39 | lib/lucene-analyzers.jar lib/snowball.jar lib/mwdumper.jar |
50 | 40 | lib/mysql-connector-java-3.0.17-ga-bin.jar"/> |
51 | 41 | </manifest> |
52 | | - <zipfileset dir="${bin}" prefix=""> |
| 42 | + <zipfileset dir="${dest.dir}" prefix=""> |
53 | 43 | <include name="org/**"/> |
54 | 44 | </zipfileset> |
55 | 45 | </jar> |
— | — | @@ -80,53 +70,53 @@ |
81 | 71 | |
82 | 72 | |
83 | 73 | <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}/"> |
86 | 76 | <classpath refid="classpath"/> |
87 | 77 | </javac> |
88 | 78 | </target> |
89 | 79 | |
90 | 80 | <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"> |
95 | 85 | <tarfileset prefix="${pack.name}" dir="." includes="${include}"/> |
96 | 86 | </tar> |
97 | 87 | |
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"/> |
100 | 90 | </target> |
101 | 91 | |
102 | 92 | <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"> |
107 | 97 | <tarfileset prefix="${pack.name}" dir="." includes="${include.src}"/> |
108 | 98 | </tar> |
109 | 99 | |
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"/> |
112 | 102 | </target> |
113 | 103 | |
114 | 104 | |
115 | 105 | <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"> |
120 | 110 | <tarfileset prefix="${pack.name}" dir="." includes="${jar.name} ${include.bin}" |
121 | 111 | excludes="template/backup/**"/> |
122 | 112 | <tarfileset prefix="${pack.name}" mode="755" dir="." includes="${include.sh}"/> |
123 | 113 | </tar> |
124 | 114 | |
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"/> |
127 | 117 | </target> |
128 | 118 | |
129 | 119 | <target name="test-build" description="Compile the junit tests"> |
130 | | - <javac srcdir="${test}" destdir="${test}"> |
| 120 | + <javac srcdir="${test.dir}" destdir="${test.dir}"> |
131 | 121 | <classpath> |
132 | 122 | <pathelement path="${java.class.path}"/> |
133 | 123 | <pathelement location="${collector.dir}"/> |
— | — | @@ -136,21 +126,30 @@ |
137 | 127 | </target> |
138 | 128 | |
139 | 129 | <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}"/> |
142 | 132 | |
143 | | - <junit haltonerror="false" haltonfailure="false"> |
| 133 | + <junit haltonerror="false" haltonfailure="false" printsummary="yes" |
| 134 | + errorProperty="tests.failed" failureproperty="tests.failed"> |
144 | 135 | <classpath> |
145 | 136 | <pathelement path="${java.class.path}"/> |
146 | 137 | <pathelement location="${collector.dir}"/> |
147 | 138 | <pathelement path="${jar.name}"/> |
148 | 139 | </classpath> |
149 | | - <sysproperty key="ant.junit.failureCollector" value="${collector.dir}/${collector.class}"/> |
150 | 140 | |
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"/> |
153 | 143 | <formatter type="plain" usefile="false"/> |
154 | 144 | </batchtest> |
155 | 145 | </junit> |
156 | 146 | </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> |
157 | 156 | </project> |