149 lines
6.0 KiB
XML
149 lines
6.0 KiB
XML
<!--
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
this work for additional information regarding copyright ownership.
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
(the "License"); you may not use this file except in compliance with
|
|
the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
-->
|
|
|
|
<project name="zooinspector" default="jar">
|
|
<import file="../build-contrib.xml" />
|
|
|
|
|
|
<target name="setjarname">
|
|
<property name="jarname" value="${build.dir}/zookeeper-${version}-${name}.jar" />
|
|
</target>
|
|
|
|
<target name="init" depends="checkMainCompiled, zookeeperbuildcontrib.init">
|
|
<mkdir dir="${build.dir}/licences" />
|
|
<copy todir="${build.dir}/licences">
|
|
<fileset dir="${basedir}/licences" />
|
|
</copy>
|
|
<mkdir dir="${build.dir}/icons" />
|
|
<copy todir="${build.dir}/icons">
|
|
<fileset dir="${basedir}/src/main/resources/icons" />
|
|
</copy>
|
|
<mkdir dir="${build.dir}/config" />
|
|
<copy todir="${build.dir}/config">
|
|
<fileset dir="${basedir}/src/main/resources">
|
|
<include name="defaultConnectionSettings.cfg" />
|
|
<include name="defaultNodeViewers.cfg" />
|
|
</fileset>
|
|
</copy>
|
|
<copy todir="${build.dir}/lib">
|
|
<fileset file="${basedir}/src/main/resources/log4j.properties" />
|
|
</copy>
|
|
<copy todir="${build.dir}/lib">
|
|
<fileset file="../../build/zookeeper-${version}.jar" />
|
|
</copy>
|
|
<copy todir="${build.dir}">
|
|
<fileset dir="${basedir}" includes="*.*" excludes="build.xml,ivy.xml" />
|
|
</copy>
|
|
</target>
|
|
|
|
<!-- Override jar target to specify main class -->
|
|
<target name="jar" depends="setjarname, compile">
|
|
<echo message="contrib: ${name}" />
|
|
|
|
<jar jarfile="${jarname}">
|
|
<manifest>
|
|
<attribute name="Main-Class" value="org.apache.zookeeper.inspector.ZooInspector" />
|
|
<attribute name="Built-By" value="${user.name}" />
|
|
<attribute name="Built-At" value="${build.time}" />
|
|
<attribute name="Built-On" value="${host.name}" />
|
|
<attribute name="Implementation-Title" value="org.apache.zookeeper" />
|
|
<attribute name="Implementation-Version" value="${revision}" />
|
|
<attribute name="Implementation-Vendor" value="The Apache Software Foundation" />
|
|
</manifest>
|
|
<fileset file="${zk.root}/LICENSE.txt" />
|
|
<fileset dir="${build.classes}" />
|
|
<fileset dir="${basedir}/src/main/resources">
|
|
<exclude name="*.cfg" />
|
|
<exclude name="*.properties" />
|
|
</fileset>
|
|
<fileset dir="${basedir}/src/main/java" excludes="**/*.jar, **/*.java"/>
|
|
</jar>
|
|
</target>
|
|
|
|
<target name="compile" depends="ivy-retrieve,zookeeperbuildcontrib.compile" />
|
|
|
|
<target name="test" depends="checkMainTestCompiled,compile-test,test-init,test-category,junit.run" />
|
|
|
|
<target name="compile-test" depends="ivy-retrieve-test,compile">
|
|
<property name="target.jdk" value="${ant.java.version}" />
|
|
<property name="src.test.local" location="${basedir}/test" />
|
|
<mkdir dir="${build.test}" />
|
|
<javac srcdir="${src.test.local}" destdir="${build.test}" target="${target.jdk}" debug="on" encoding="${build.encoding}">
|
|
<classpath refid="classpath" />
|
|
<classpath>
|
|
<pathelement location="${zk.root}/build/test/classes" />
|
|
</classpath>
|
|
</javac>
|
|
</target>
|
|
|
|
<target name="test-init" depends="jar,compile-test">
|
|
<delete dir="${test.log.dir}" />
|
|
<delete dir="${test.tmp.dir}" />
|
|
<delete dir="${test.data.dir}" />
|
|
<mkdir dir="${test.log.dir}" />
|
|
<mkdir dir="${test.tmp.dir}" />
|
|
<mkdir dir="${test.data.dir}" />
|
|
</target>
|
|
|
|
<target name="test-category">
|
|
<property name="test.category" value="" />
|
|
</target>
|
|
|
|
<target name="junit.run">
|
|
<echo message="${test.src.dir}" />
|
|
<junit showoutput="${test.output}" printsummary="${test.junit.printsummary}" haltonfailure="${test.junit.haltonfailure}" fork="yes" forkmode="${test.junit.fork.mode}" maxmemory="${test.junit.maxmem}" dir="${basedir}" timeout="${test.timeout}" errorProperty="tests.failed" failureProperty="tests.failed">
|
|
<sysproperty key="build.test.dir" value="${test.tmp.dir}" />
|
|
<sysproperty key="test.data.dir" value="${test.data.dir}" />
|
|
<sysproperty key="log4j.configuration" value="file:${basedir}/conf/log4j.properties" />
|
|
<classpath refid="classpath" />
|
|
<classpath>
|
|
<pathelement path="${build.test}" />
|
|
<pathelement location="${zk.root}/build/test/classes" />
|
|
</classpath>
|
|
<formatter type="${test.junit.output.format}" />
|
|
<batchtest todir="${test.log.dir}" unless="testcase">
|
|
<fileset dir="${test.src.dir}" includes="**/*${test.category}Test.java" />
|
|
</batchtest>
|
|
<batchtest todir="${test.log.dir}" if="testcase">
|
|
<fileset dir="${test.src.dir}" includes="**/${testcase}.java" />
|
|
</batchtest>
|
|
</junit>
|
|
<fail if="tests.failed">Tests failed!</fail>
|
|
</target>
|
|
|
|
<target name="package" depends="jar, zookeeperbuildcontrib.package" unless="skip.contrib">
|
|
|
|
<copy file="${basedir}/build.xml" todir="${dist.dir}/zookeeper-contrib/zookeeper-contrib-${name}" />
|
|
|
|
<mkdir dir="${dist.dir}/zookeeper-contrib/zookeeper-contrib-${name}/src" />
|
|
<copy todir="${dist.dir}/zookeeper-contrib/zookeeper-contrib-${name}/src">
|
|
<fileset dir="${basedir}/src" />
|
|
</copy>
|
|
<mkdir dir="${dist.dir}/zookeeper-contrib/zookeeper-contrib-${name}/licences" />
|
|
<copy todir="${dist.dir}/zookeeper-contrib/zookeeper-contrib-${name}/licences">
|
|
<fileset dir="${basedir}/licences" />
|
|
</copy>
|
|
<mkdir dir="${dist.dir}/zookeeper-contrib/zookeeper-contrib-${name}/config" />
|
|
<copy todir="${dist.dir}/zookeeper-contrib/zookeeper-contrib-${name}/config">
|
|
<fileset dir="${basedir}/src/main/resources">
|
|
<include name="defaultConnectionSettings.cfg" />
|
|
<include name="defaultNodeViewers.cfg" />
|
|
</fileset>
|
|
</copy>
|
|
</target>
|
|
</project>
|