"Fossies" - the Fresh Open Source Software Archive

Member "apache-zookeeper-3.5.6/zookeeper-recipes/zookeeper-recipes-election/build.xml" (5 Oct 2019, 5448 Bytes) of package /linux/misc/apache-zookeeper-3.5.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) XML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <!--
    2    Licensed to the Apache Software Foundation (ASF) under one or more
    3    contributor license agreements.  See the NOTICE file distributed with
    4    this work for additional information regarding copyright ownership.
    5    The ASF licenses this file to You under the Apache License, Version 2.0
    6    (the "License"); you may not use this file except in compliance with
    7    the License.  You may obtain a copy of the License at
    8 
    9        http://www.apache.org/licenses/LICENSE-2.0
   10 
   11    Unless required by applicable law or agreed to in writing, software
   12    distributed under the License is distributed on an "AS IS" BASIS,
   13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14    See the License for the specific language governing permissions and
   15    limitations under the License.
   16 -->
   17 
   18 <project name="election" default="jar">
   19   <import file="../build-recipes.xml"/>
   20     <property name="test.main.classes" value="${zk.root}/build/test/classes"/>
   21     <property name="test.build.dir" value="${build.test}" />
   22     <property name="test.src.dir" value="src/test/java"/>
   23     <property name="test.log.dir" value="${test.build.dir}/logs" />
   24     <property name="test.data.dir" value="${test.build.dir}/data" />
   25     <property name="test.data.upgrade.dir" value="${test.data.dir}/upgrade" />
   26     <property name="test.tmp.dir" value="${test.build.dir}/tmp" />
   27     <property name="test.output" value="no" />
   28     <property name="test.timeout" value="900000" />
   29     <property name="test.junit.output.format" value="plain" />
   30     <property name="test.junit.fork.mode" value="perTest" />
   31     <property name="test.junit.printsummary" value="yes" />
   32     <property name="test.junit.haltonfailure" value="no" />
   33     <property name="test.junit.maxmem" value="512m" />
   34 
   35   <target name="setjarname">
   36     <property name="jarname"
   37               value="${build.dir}/zookeeper-${version}-recipes-${name}.jar"/>
   38   </target>
   39 
   40   <!-- Override jar target to specify main class -->
   41   <target name="jar" depends="checkMainCompiled, setjarname, compile">
   42     <echo message="recipes: ${name}"/>
   43 
   44     <jar jarfile="${jarname}">
   45       <fileset file="${zk.root}/LICENSE.txt" />
   46       <fileset dir="${build.classes}"/>
   47       <fileset dir="${build.test}"/>
   48     </jar>
   49   </target>
   50 
   51     <target name="test" depends="compile-test,test-init,test-category,junit.run" />
   52 
   53     <target name="compile-test" depends="compile">
   54         <property name="target.jdk" value="${ant.java.version}" />  
   55         <property name="src.test.local" location="${basedir}/src/test/java" />
   56         <mkdir dir="${build.test}"/>
   57         <javac srcdir="${src.test.local}" 
   58             destdir="${build.test}" 
   59             target="${target.jdk}" 
   60             debug="on" encoding="${build.encoding}">
   61             <classpath refid="classpath" />
   62                         <classpath>
   63                         <pathelement path="${test.main.classes}"/>
   64                         </classpath>
   65         </javac>
   66     </target>
   67     
   68     <target name="test-init" depends="jar,compile-test">
   69         <delete dir="${test.log.dir}" />
   70         <delete dir="${test.tmp.dir}" />
   71         <delete dir="${test.data.dir}" />
   72         <mkdir dir="${test.log.dir}" />
   73         <mkdir dir="${test.tmp.dir}" />
   74         <mkdir dir="${test.data.dir}" />
   75     </target>
   76 
   77     <target name="test-category">
   78          <property name="test.category" value=""/>
   79     </target>
   80 
   81     <target name="junit.run">
   82         <echo message="${test.src.dir}" />
   83         <junit showoutput="${test.output}"
   84                printsummary="${test.junit.printsummary}"
   85                haltonfailure="${test.junit.haltonfailure}"
   86                fork="yes"
   87                forkmode="${test.junit.fork.mode}"
   88                maxmemory="${test.junit.maxmem}"
   89                dir="${basedir}" timeout="${test.timeout}"
   90                errorProperty="tests.failed" failureProperty="tests.failed">
   91           <sysproperty key="build.test.dir" value="${test.tmp.dir}" />
   92           <sysproperty key="test.data.dir" value="${test.data.dir}" />
   93           <sysproperty key="log4j.configuration"
   94                     value="file:${basedir}/conf/log4j.properties" />
   95           <classpath refid="classpath"/>
   96           <classpath>
   97              <pathelement path="${build.test}" />
   98              <pathelement path="${test.main.classes}"/>
   99           </classpath>
  100           <formatter type="${test.junit.output.format}" />
  101           <batchtest todir="${test.log.dir}" unless="testcase">
  102               <fileset dir="${test.src.dir}"
  103                      includes="**/*${test.category}Test.java"/>
  104           </batchtest>
  105           <batchtest todir="${test.log.dir}" if="testcase">
  106               <fileset dir="${test.src.dir}" includes="**/${testcase}.java"/>
  107           </batchtest>
  108        </junit>
  109             <fail if="tests.failed">Tests failed!</fail>
  110     </target>
  111 
  112   <target name="package" depends="jar, zookeeperbuildrecipes.package"
  113           unless="skip.recipes">
  114 
  115     <copy file="${basedir}/build.xml" todir="${dist.dir}/zookeeper-recipes/zookeeper-recipes-${name}"/>
  116 
  117     <mkdir dir="${dist.dir}/zookeeper-recipes/zookeeper-recipes-${name}/src/test/java"/>
  118     <copy todir="${dist.dir}/zookeeper-recipes/zookeeper-recipes-${name}/src/test/java">
  119       <fileset dir="${basedir}/src/test/java"/>
  120     </copy>
  121     <mkdir dir="${dist.dir}/zookeeper-recipes/zookeeper-recipes-${name}/src/main/java"/>
  122     <copy todir="${dist.dir}/zookeeper-recipes/zookeeper-recipes-${name}/src/main/java">
  123       <fileset dir="${basedir}/src/main/java"/>
  124     </copy>
  125   </target>
  126 
  127 </project>
  128