| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| 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="Apache Hadoop Gateway" default="release" basedir="."> |
| |
| <description> |
| Release build file for the Hadoop Gateway |
| </description> |
| |
| <property name="version" value="0.2.0-SNAPSHOT"/> |
| <property name="archive" value="target/gateway-${version}.zip"/> |
| <property name="gateway_home" value="gateway-${version}"/> |
| |
| <condition property="mvn.cmd" value="mvn"> |
| <os family="unix" /> |
| </condition> |
| <condition property="mvn.cmd" value="mvn.bat"> |
| <os family="windows" /> |
| </condition> |
| |
| <condition property="svn.cmd" value="svn"> |
| <os family="unix" /> |
| </condition> |
| <condition property="svn.cmd" value="svn"> |
| <os family="windows" /> |
| </condition> |
| |
| <target name="init" description="Initialize the build."> |
| </target> |
| |
| <target name="clean" depends="init" description="Clean up any build artifacts."> |
| <delete file="${archive}"/> |
| </target> |
| |
| <target name="build" depends="init" description="Build the product."> |
| <exec executable="${mvn.cmd}"> |
| <arg value="-Prelease"/> |
| <arg value="clean"/> |
| <arg value="package"/> |
| </exec> |
| </target> |
| |
| <target name="archive" depends="init" description="Create the release ZIP."> |
| <zip destfile="${archive}"> |
| <zipfileset |
| dir="gateway-release" |
| includes="**/*" |
| excludes="src,target,*.xml,*.iml,*.md" |
| prefix="${gateway_home}"/> |
| <zipfileset |
| dir="gateway-test-ldap/target" |
| includes="gateway-test-ldap-${version}.jar" |
| fullpath="${gateway_home}/bin/ldap-${version}.jar"/> |
| <zipfileset |
| dir="gateway-release/target" |
| includes="gateway-release-${version}.jar" |
| fullpath="${gateway_home}/bin/gateway-${version}.jar"/> |
| <zipfileset |
| dir="gateway-shell/target" |
| includes="gateway-shell-${version}.jar" |
| fullpath="${gateway_home}/bin/shell-${version}.jar"/> |
| </zip> |
| </target> |
| |
| <target name="publish" description="Generate and publish the Apache web site."> |
| <exec executable="${mvn.cmd}" dir="gateway-site"> |
| <arg value="clean"/> |
| </exec> |
| <mkdir dir="gateway-site/target/site"/> |
| <exec executable="${svn.cmd}" dir="gateway-site/target"> |
| <arg value="checkout"/> |
| <arg value="https://svn.apache.org/repos/asf/incubator/knox/site"/> |
| </exec> |
| <delete quiet="true" verbose="true"> |
| <fileset dir="gateway-site/target/site" includes="**/*.html,**/*.css,**/*.png,**/*.gif"> |
| </fileset> |
| </delete> |
| <exec executable="${mvn.cmd}" dir="gateway-site"> |
| <arg value="site"/> |
| </exec> |
| <exec executable="${svn.cmd}" dir="gateway-site/target/site"> |
| <arg value="add"/> |
| <arg value="--force"/> |
| <arg value="."/> |
| </exec> |
| <exec executable="${svn.cmd}" dir="gateway-site/target/site"> |
| <arg value="commit"/> |
| <arg value="-m"/> |
| <arg value="Publish site from Git repository."/> |
| </exec> |
| </target> |
| |
| <target name="release" depends="init,clean,build,archive" description="Create the release."/> |
| |
| </project> |