"Fossies" - the Fresh Open Source Software Archive

Member "apache-zookeeper-3.5.6/zookeeper-recipes/build-recipes.xml" (5 Oct 2019, 6325 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 <?xml version="1.0"?>
    2 
    3 <!--
    4    Licensed to the Apache Software Foundation (ASF) under one or more
    5    contributor license agreements.  See the NOTICE file distributed with
    6    this work for additional information regarding copyright ownership.
    7    The ASF licenses this file to You under the Apache License, Version 2.0
    8    (the "License"); you may not use this file except in compliance with
    9    the License.  You may obtain a copy of the License at
   10 
   11        http://www.apache.org/licenses/LICENSE-2.0
   12 
   13    Unless required by applicable law or agreed to in writing, software
   14    distributed under the License is distributed on an "AS IS" BASIS,
   15    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   16    See the License for the specific language governing permissions and
   17    limitations under the License.
   18 -->
   19 
   20 <!-- Imported by recipesb/*/build.xml files to share generic targets. -->
   21 
   22 <project name="zookeeperbuildrecipes">
   23 
   24   <property name="name" value="${ant.project.name}"/>
   25   <property name="root" value="${basedir}"/>
   26 
   27   <property name="zk.root" location="${root}/../../"/>
   28 
   29   <property name="src.dir"  location="${root}/src/main/java"/>
   30   <property name="src.test" location="${root}/src/test"/>
   31 
   32   <property name="build.dir" location="${zk.root}/build/recipes/${name}"/>
   33   <property name="build.classes" location="${build.dir}/classes"/>
   34   <property name="build.test" location="${build.dir}/test"/>
   35 
   36   <property name="javac.deprecation" value="on"/>
   37   <property name="javac.debug" value="on"/>
   38 
   39   <property name="build.encoding" value="utf8"/>
   40 
   41   <!-- to be overridden by sub-projects -->
   42   <target name="check-recipes"/>
   43   <target name="init-recipes"/>
   44 
   45   <property name="lib.jars.includes" value="lib/*.jar" />
   46   <property name="lib.jars.excludes" value="" />
   47 
   48   <!-- prior to ant 1.7.1 fileset always fails if dir doesn't exist
   49        so just point to bin directory and provide settings that exclude
   50        everything - user can change as appropriate -->
   51   <property name="additional.lib.dir" value="${zk.root}/bin" />
   52   <property name="additional.lib.dir.includes" value="**/*.jar" />
   53   <property name="additional.lib.dir.excludes" value="**/*.jar" />
   54 
   55   <fileset id="lib.jars" dir="${root}">
   56     <include name="${lib.jars.includes}" />
   57     <exclude name="${lib.jars.excludes}" />
   58   </fileset>
   59 
   60   <path id="classpath">
   61     <pathelement location="${build.classes}"/>
   62     <!-- allow the user to override (e.g. if there are local versions) -->
   63     <fileset dir="${additional.lib.dir}">
   64       <include name="${additional.lib.dir.includes}" />
   65       <exclude name="${additional.lib.dir.excludes}" />
   66     </fileset>
   67     <fileset refid="lib.jars"/>
   68     <pathelement location="${zk.root}/build/classes"/>
   69     <fileset dir="${zk.root}/build/lib">
   70       <include name="**/*.jar" />
   71     </fileset>
   72     <fileset dir="${zk.root}/build/test/lib">
   73       <include name="**/*.jar"/>
   74     </fileset>
   75     <fileset dir="${zk.root}/zookeeper-server/src/main/resources/lib">
   76       <include name="**/*.jar" />
   77     </fileset>
   78   </path>
   79 
   80   <!-- ====================================================== -->
   81   <!-- Stuff needed by all targets                            -->
   82   <!-- ====================================================== -->
   83   <target name="init" depends="check-recipes" unless="skip.recipes">
   84     <echo message="recipes: ${name}"/>
   85     <mkdir dir="${build.dir}"/>
   86     <mkdir dir="${build.classes}"/>
   87     <mkdir dir="${build.test}"/>
   88     <antcall target="init-recipes"/>
   89   </target>
   90 
   91   <!-- ====================================================== -->
   92   <!-- Compile a recipes files                                -->
   93   <!-- ====================================================== -->
   94   <target name="compile" depends="init" unless="skip.contrib">
   95     <echo message="contrib: ${name}"/>
   96 
   97     <javac
   98      encoding="${build.encoding}"
   99      srcdir="${src.dir}"
  100      includes="**/*.java"
  101      destdir="${build.classes}"
  102      debug="${javac.debug}"
  103      deprecation="${javac.deprecation}">
  104       <classpath refid="classpath"/>
  105     </javac>
  106   </target>
  107 
  108   <!-- ====================================================== -->
  109   <!-- Make a recipes jar                                     -->
  110   <!-- ====================================================== -->
  111   <target name="jar" depends="compile" unless="skip.recipes">
  112     <echo message="recipes: ${name}"/>
  113     <jar
  114       jarfile="${build.dir}/zookeeper-${version}-recipes-${name}.jar"
  115       basedir="${build.classes}"      
  116     />
  117   </target>
  118 
  119   <!-- ====================================================== -->
  120   <!-- Package a recipes files                                -->
  121   <!-- ====================================================== -->
  122   <target name="package" depends="jar" unless="skip.recipes"> 
  123     <echo message="recipes: ${name}"/>
  124 
  125     <mkdir dir="${dist.dir}${package.share}/zookeeper-recipes/zookeeper-recipes-${name}"/>
  126     <copy todir="${dist.dir}${package.share}/zookeeper-recipes/zookeeper-recipes-${name}" includeEmptyDirs="false"
  127           flatten="true">
  128       <fileset dir="${build.dir}">
  129         <include name="zookeeper-${version}-recipes-${name}.jar" />
  130       </fileset>
  131     </copy>
  132   </target>
  133 
  134   <!-- ================================================================== -->
  135   <!-- Clean.  Delete the build files, and their directories              -->
  136   <!-- ================================================================== -->
  137   <target name="clean">
  138     <echo message="recipes: ${name}"/>
  139     <delete dir="${build.dir}"/>
  140   </target>
  141 
  142   <!-- ================================================================== -->
  143   <!-- Utility features                                                   -->
  144   <!-- ================================================================== -->
  145 
  146   <target name="checkMainIsAvailable">
  147     <available classname="org.apache.zookeeper.ZooKeeperMain"
  148                property="mainIsCompiled">
  149       <!-- we can't use id=classpath, because available fails if fileset directory
  150            doesn't exist -->
  151       <classpath>
  152         <pathelement location="${zk.root}/build/classes"/>
  153       </classpath>
  154     </available>
  155   </target>
  156 
  157   <target name="checkMainCompiled" unless="mainIsCompiled" depends="checkMainIsAvailable">
  158     <fail message="ZooKeeper main must first be compiled (toplevel build.xml)"/>
  159   </target>
  160 
  161 </project>