build.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?xml version="1.0"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <project name="zkpython" default="install">
  17. <import file="../build-contrib.xml"/>
  18. <property name="python.src.dir" value="src/python"/>
  19. <property name="test.src.dir" value="src/test"/>
  20. <property name="test.log.dir" value="${build.test}/logs" />
  21. <property name="test.output" value="no" />
  22. <property name="test.output" value="no" />
  23. <property name="test.timeout" value="900000" />
  24. <target name="test"
  25. depends="compile,test-init,test-category,test-start,python-test,test-stop" />
  26. <target name="test-init" depends="checkMainCompiled">
  27. <delete dir="${test.log.dir}" />
  28. <mkdir dir="${test.log.dir}" />
  29. </target>
  30. <target name="test-start">
  31. <exec executable="${test.src.dir}/zkServer.sh" failonerror="true">
  32. <arg value="startClean"/>
  33. </exec>
  34. </target>
  35. <target name="test-stop">
  36. <exec executable="${test.src.dir}/zkServer.sh" failonerror="true">
  37. <arg value="stop"/>
  38. </exec>
  39. </target>
  40. <target name="test-category">
  41. <property name="test.category" value=""/>
  42. </target>
  43. <target name="python-test">
  44. <exec executable="${test.src.dir}/run_tests.sh" failonerror="true">
  45. <arg value="${test.src.dir}"/>
  46. <arg value="${test.log.dir}"/>
  47. </exec>
  48. </target>
  49. <target name="compile" depends="ivy-retrieve">
  50. <exec executable="python" failonerror="true">
  51. <arg value="${python.src.dir}/setup.py"/>
  52. <arg value="build"/>
  53. <arg value="--build-base=${build.dir}"/>
  54. </exec>
  55. </target>
  56. <target name="install" depends="compile">
  57. <exec executable="python" failonerror="true">
  58. <arg value="${python.src.dir}/setup.py"/>
  59. <arg value="build"/>
  60. <arg value="--build-base=${build.dir}"/>
  61. <arg value="install"/>
  62. </exec>
  63. </target>
  64. <target name="package" unless="skip.contrib">
  65. <echo message="contrib: ${name}"/>
  66. <mkdir dir="${build.dir}"/>
  67. <copy todir="${build.dir}">
  68. <fileset dir="${basedir}">
  69. <exclude name="**/VERSION"/>
  70. </fileset>
  71. </copy>
  72. <exec executable="echo" output="${build.dir}/VERSION">
  73. <arg line="${version}" />
  74. </exec>
  75. <mkdir dir="${dist.dir}/zookeeper-contrib/zookeeper-contrib-${name}"/>
  76. <copy todir="${dist.dir}/zookeeper-contrib/zookeeper-contrib-${name}">
  77. <fileset dir="${build.dir}">
  78. <exclude name="**/temp*"/>
  79. </fileset>
  80. </copy>
  81. </target>
  82. <target name="bin-package" depends="compile, package" unless="skip.contrib">
  83. </target>
  84. <target name="tar-bin" depends="init, compile, bin-package" unless="skip.contrib">
  85. <exec executable="python" failonerror="true" dir="${build.dir}">
  86. <arg value="${python.src.dir}/setup.py"/>
  87. <arg value="build"/>
  88. <arg value="--build-base=${build.dir}"/>
  89. <arg value="bdist_dumb"/>
  90. </exec>
  91. </target>
  92. </project>