| <?xml version="1.0" ?> |
| |
| <!-- |
| 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="chukwa" default="main" xmlns:ivy="antlib:org.apache.ivy.ant"> |
| |
| <property name="name" value="chukwa" /> |
| <property name="chukwaVersion" value="0.4.0" /> |
| <property name="chukwaRelease" value="dev" /> |
| <property name="final.name" value="${name}-${chukwaVersion}" /> |
| <property name="contrib.dir" value="${basedir}/contrib"/> |
| |
| <import file="../build-contrib.xml" optional="true" /> |
| <available file="../build-contrib.xml" property="present" /> |
| |
| <property file="build.properties" /> |
| <property file="default.properties" /> |
| |
| <condition property="standaloneMode"> |
| <and> |
| <not> |
| <available file="../build-contrib.xml" property="present" /> |
| </not> |
| </and> |
| </condition> |
| |
| <condition property="hadoopMode"> |
| <and> |
| <available file="../build-contrib.xml" property="present" /> |
| </and> |
| </condition> |
| |
| <target name="init-standalone" depends="ivy-retrieve" if="standaloneMode"> |
| <echo>Standalone Mode</echo> |
| <property environment="env" /> |
| <property name="basedir" value="." /> |
| <!--SET UP HADOOP JARS--> |
| <property name="hadoop.home.dir" value="${env.HADOOP_HOME}" /> |
| <echo message="HADOOP_HOME set to: ${hadoop.home.dir}" /> |
| <property name="hadoop.default.jars.dir" value="${basedir}/hadoopjars" /> |
| |
| <condition property="hadoop.home.jars.dir" value="${hadoop.home.dir}/build" else="${basedir}/hadoopjars"> |
| <available file="${hadoop.home.dir}/build" /> |
| </condition> |
| <echo message="hadoop.home.jars.dir set to ${hadoop.home.jars.dir}" /> |
| |
| <property name="build.dir" value="${basedir}/build" /> |
| <property name="build.classes" value="${basedir}/build/classes" /> |
| <property name="build.docs" value="${build.dir}/docs" /> |
| <property name="build.javadoc" value="${build.docs}/api" /> |
| <property name="build.javadoc.timestamp" value="${build.javadoc}/index.html" /> |
| <property name="build.javadoc.dev" value="${build.docs}/dev-api" /> |
| |
| <property name="test.build.dir" value="${build.dir}/test" /> |
| <property name="test.build.classes" value="${test.build.dir}/classes" /> |
| <property name="lib.dir" value="${basedir}/lib" /> |
| <path id="classpath"> |
| <fileset dir="${lib.dir}"> |
| <include name="**/*.jar" /> |
| <exclude name="**/excluded/" /> |
| </fileset> |
| <fileset dir="${hadoop.default.jars.dir}"> |
| <!-- ASR --> |
| <include name="**/*.jar" /> |
| <exclude name="**/*core*.jar" /> |
| </fileset> |
| <fileset dir="${hadoop.home.jars.dir}"> |
| <!-- ASR --> |
| <include name="**/hadoop-0.2*-core.jar" /> |
| </fileset> |
| <fileset dir="${common.ivy.lib.dir}"> |
| <include name="**/*.jar" /> |
| </fileset> |
| <path refid="contrib-classpath" /> |
| </path> |
| |
| <path id="testClasspath"> |
| <pathelement location="${build.classes}" /> |
| <pathelement location="${test.build.classes}" /> |
| <pathelement location="${build.dir}/hicc.war" /> |
| <pathelement location="${test.build.dir}/conf" /> |
| <fileset dir="${lib.dir}"> |
| <include name="**/*.jar" /> |
| <exclude name="**/excluded/" /> |
| </fileset> |
| <fileset dir="${hadoop.default.jars.dir}"> |
| <!-- ASR --> |
| <include name="**/*.jar" /> |
| <exclude name="**/*core*.jar" /> |
| </fileset> |
| <fileset dir="${hadoop.home.jars.dir}"> |
| <!-- ASR --> |
| <include name="**/hadoop-0.20*.jar" /> |
| </fileset> |
| <path refid="contrib-classpath" /> |
| </path> |
| <path id="testDemuxClasspath"> |
| <pathelement location="${build.classes}" /> |
| <pathelement location="${test.build.classes}" /> |
| <fileset dir="${hadoop.default.jars.dir}"> |
| <!-- ASR --> |
| <include name="**/*.jar" /> |
| <exclude name="**/hadoop-0.2*-core.jar" /> |
| </fileset> |
| <fileset dir="${hadoop.home.jars.dir}"> |
| <!-- ASR --> |
| <include name="**/*core*.jar" /> |
| </fileset> |
| <fileset dir="${lib.dir}"> |
| <include name="**/*.jar" /> |
| <exclude name="**/excluded/" /> |
| </fileset> |
| <path refid="contrib-classpath" /> |
| </path> |
| </target> |
| |
| <target name="ivy-init-properties-local" description="to initiate ivy properties"> |
| <property name="ivy.dir" location="ivy" /> |
| <property name="ivysettings.xml" location="${ivy.dir}/ivysettings.xml" /> |
| <loadproperties srcfile="${ivy.dir}/libraries.properties" /> |
| <loadproperties srcfile="${ivy.dir}/libraries.properties" /> |
| <property name="ivy.jar" location="${ivy.dir}/ivy-${ivy.version}.jar" /> |
| <property name="ivy_repo_url" value="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.version}/ivy-${ivy.version}.jar" /> |
| <property name="build.dir" location="build" /> |
| <property name="build.ivy.dir" location="${build.dir}/ivy" /> |
| <property name="build.ivy.lib.dir" location="${build.ivy.dir}/lib" /> |
| <property name="build.ivy.report.dir" location="${build.ivy.dir}/report" /> |
| <property name="common.ivy.lib.dir" location="${build.ivy.lib.dir}/${ant.project.name}/common" /> |
| <property name="rat.reporting.classname" value="rat.Report" /> |
| <property name="jdiff.build.dir" value="${build.docs}/jdiff" /> |
| <property name="jdiff.xml.dir" value="${build.ivy.lib.dir}/${name}/jdiff" /> |
| <property name="jdiff.stable" value="0.1.2" /> |
| <property name="jdiff.stable.javadoc" value="http://hadoop.apache.org/core/docs/r${jdiff.stable}/api/" /> |
| |
| <!--this is the naming policy for artifacts we want pulled down--> |
| <property name="ivy.artifact.retrieve.pattern" value="${ant.project.name}/[conf]/[artifact]-[revision].[ext]" /> |
| <property name="jdiff.home" value="${build.ivy.lib.dir}/${ant.project.name}/jdiff" /> |
| <property name="jdiff.jar" value="${jdiff.home}/jdiff-${jdiff.version}.jar" /> |
| <property name="xerces.jar" value="${jdiff.home}/xerces-${xerces.version}.jar" /> |
| |
| <property name="clover.jar" location="${clover.home}/lib/clover.jar" /> |
| <available property="clover.present" file="${clover.jar}" /> |
| |
| </target> |
| |
| <target name="ivy-download-local" description="To download ivy" unless="offline"> |
| <get src="${ivy_repo_url}" dest="${ivy.jar}" usetimestamp="true" /> |
| </target> |
| |
| <target name="ivy-init-dirs-local" depends="ivy-init-properties-local"> |
| <mkdir dir="${build.ivy.dir}" /> |
| <mkdir dir="${build.ivy.lib.dir}" /> |
| <mkdir dir="${build.ivy.report.dir}" /> |
| </target> |
| |
| <target name="ivy-probe-antlib-local"> |
| <condition property="ivy.found.local"> |
| <typefound uri="antlib:org.apache.ivy.ant" name="cleancache" /> |
| </condition> |
| </target> |
| |
| <target name="ivy-init-antlib-local" depends="ivy-init-dirs-local,ivy-download-local,ivy-probe-antlib-local" unless="ivy.found.local"> |
| <typedef uri="antlib:org.apache.ivy.ant" onerror="fail" loaderRef="ivyLoader"> |
| <classpath> |
| <pathelement location="${ivy.jar}" /> |
| </classpath> |
| </typedef> |
| <fail> |
| <condition> |
| <not> |
| <typefound uri="antlib:org.apache.ivy.ant" name="cleancache" /> |
| </not> |
| </condition> |
| You need Apache Ivy 2.0 or later from http://ant.apache.org/ |
| It could not be loaded from ${ivy_repo_url} |
| </fail> |
| </target> |
| |
| <target name="ivy-init-local" depends="ivy-init-antlib-local"> |
| <ivy:configure settingsid="${ant.project.name}.ivy.settings" file="${ivysettings.xml}" override="true" /> |
| </target> |
| |
| <target name="ivy-retrieve" depends="ivy-resolve" description="Retrieve Ivy-managed artifacts for the compile/test configurations"> |
| <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings" pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" sync="true" /> |
| <ivy:cachepath pathid="contrib-classpath" conf="common" /> |
| </target> |
| |
| <target name="ivy-resolve" depends="ivy-init-local"> |
| <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" /> |
| </target> |
| |
| <target name="ivy-resolve-javadoc" depends="ivy-init-local"> |
| <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="javadoc" /> |
| </target> |
| |
| <target name="ivy-resolve-checkstyle" depends="ivy-init-local"> |
| <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="checkstyle" /> |
| </target> |
| |
| <target name="ivy-retrieve-checkstyle" depends="ivy-resolve-checkstyle" description="Retrieve Ivy-managed artifacts for the checkstyle configurations"> |
| <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings" pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" /> |
| <ivy:cachepath pathid="checkstyle-classpath" conf="checkstyle" /> |
| </target> |
| |
| <target name="ivy-resolve-test" depends="ivy-init-local"> |
| <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="test" /> |
| </target> |
| |
| <target name="ivy-resolve-common" depends="ivy-init-local"> |
| <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="common" /> |
| </target> |
| |
| <target name="ivy-resolve-jdiff" depends="ivy-init-local"> |
| <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="jdiff" /> |
| </target> |
| |
| <target name="ivy-retrieve-jdiff" depends="ivy-resolve-jdiff" description="Retrieve Ivy-managed artifacts for the javadoc configurations"> |
| <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings" pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" /> |
| <ivy:cachepath pathid="jdiff-classpath" conf="jdiff" /> |
| </target> |
| |
| <target name="ivy-retrieve-javadoc" depends="ivy-resolve-javadoc" description="Retrieve Ivy-managed artifacts for the javadoc configurations"> |
| <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings" pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" /> |
| <ivy:cachepath pathid="javadoc-classpath" conf="javadoc" /> |
| </target> |
| |
| <target name="ivy-retrieve-test" depends="ivy-resolve-test" description="Retrieve Ivy-managed artifacts for the test configurations"> |
| <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings" pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" /> |
| <ivy:cachepath pathid="test.classpath" conf="test" /> |
| </target> |
| |
| <target name="ivy-retrieve-common" depends="ivy-resolve-common" description="Retrieve Ivy-managed artifacts for the compile configurations"> |
| <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings" pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" /> |
| <ivy:cachepath pathid="ivy-common.classpath" conf="common" /> |
| </target> |
| |
| <target name="ivy-report" depends="ivy-resolve-releaseaudit" description="Generate"> |
| <ivy:report todir="${build.ivy.report.dir}" settingsRef="${ant.project.name}.ivy.settings" /> |
| <echo> |
| Reports generated:${build.ivy.report.dir} |
| </echo> |
| </target> |
| |
| <target name="init-hadoop" if="hadoopMode"> |
| <antcall target="ivy-retrieve-common" /> |
| <echo>Hadoop Mode</echo> |
| <property name="build.dir" value="${basedir}/build" /> |
| <property name="build.classes" value="${basedir}/build/classes" /> |
| <property name="test.build.dir" value="${build.dir}/test" /> |
| <property name="test.build.classes" value="${test.build.dir}/classes" /> |
| <delete file="${build.dir}/${final.name}/hadoop-*-core.jar" /> |
| <property name="lib.dir" value="${basedir}/lib" /> |
| <path id="classpath"> |
| <fileset dir="${lib.dir}"> |
| <include name="**/*.jar" /> |
| <exclude name="**/excluded/" /> |
| </fileset> |
| <fileset dir="${hadoop.root}/lib"> |
| <include name="**/*.jar" /> |
| <exclude name="**/excluded/" /> |
| </fileset> |
| <pathelement location="${hadoop.root}/build/classes" /> |
| <path refid="contrib-classpath" /> |
| </path> |
| <path id="testClasspath"> |
| <pathelement location="${build.classes}" /> |
| <pathelement location="${test.build.classes}" /> |
| <path refid="contrib-classpath" /> |
| <fileset dir="${lib.dir}"> |
| <include name="**/*.jar" /> |
| <exclude name="**/excluded/" /> |
| </fileset> |
| <fileset dir="${hadoop.root}/lib"> |
| <include name="**/*.jar" /> |
| <exclude name="**/excluded/" /> |
| </fileset> |
| <pathelement location="${hadoop.root}/build/classes" /> |
| <pathelement location="${hadoop.root}/build/test/classes" /> |
| <pathelement location="${clover.jar}" /> |
| </path> |
| |
| <path id="testDemuxClasspath"> |
| <pathelement location="${build.classes}" /> |
| <pathelement location="${test.build.classes}" /> |
| <path refid="contrib-classpath" /> |
| <fileset dir="${hadoop.root}/lib"> |
| <include name="**/*.jar" /> |
| <exclude name="**/excluded/" /> |
| </fileset> |
| <fileset dir="${lib.dir}"> |
| <include name="**/*.jar" /> |
| <exclude name="**/excluded/" /> |
| </fileset> |
| <pathelement location="${hadoop.root}/build/classes" /> |
| <pathelement location="${hadoop.root}/build/test/classes" /> |
| </path> |
| |
| </target> |
| |
| <target name="init" depends="init-standalone,init-hadoop"> |
| <property name="src.dir" value="${basedir}/src" /> |
| <property name="build.classes" value="${build.dir}/classes" /> |
| <property name="conf.dir" value="${basedir}/conf" /> |
| <property name="docs.src" value="${basedir}/src/docs" /> |
| <property name="docs.dir" value="${basedir}/docs" /> |
| <property name="changes.src" value="${docs.src}/changes" /> |
| <property name="tools.dir" value="${basedir}/tools" /> |
| <property name="opt.dir" value="${basedir}/opt" /> |
| <property name="javac.debug" value="on" /> |
| <property name="javac.version" value="1.6" /> |
| <property name="test.src.dir" value="${basedir}/src/test" /> |
| <property name="test.lib.dir" value="${basedir}/src/test/lib" /> |
| <property name="test.build.dir" value="${build.dir}/test" /> |
| <property name="test.generated.dir" value="${test.build.dir}/src" /> |
| <property name="test.build.data" value="${test.build.dir}/data" /> |
| <property name="test.cache.data" value="${test.build.dir}/cache" /> |
| <property name="test.debug.data" value="${test.build.dir}/debug" /> |
| <property name="test.log.dir" value="${test.build.dir}/logs" /> |
| <property name="test.build.classes" value="${test.build.dir}/classes" /> |
| <property name="test.build.testjar" value="${test.build.dir}/testjar" /> |
| <property name="test.build.javadoc" value="${test.build.dir}/docs/api" /> |
| <property name="test.build.javadoc.dev" value="${test.build.dir}/docs/dev-api" /> |
| <property name="test.include" value="Test*" /> |
| <property name="test.classpath.id" value="test.classpath" /> |
| <property name="test.output" value="no" /> |
| <property name="test.printsummary" value="on" /> |
| <!-- property name="test.printsummary" value="withOutAndError" / --> |
| <property name="test.timeout" value="900000" /> |
| <property name="test.junit.output.format" value="brief" /> |
| <property name="test.junit.fork.mode" value="perTest" /> |
| <property name="test.junit.printsummary" value="yes" /> |
| <property name="test.junit.haltonfailure" value="yes" /> |
| <property name="test.junit.maxmemory" value="256m" /> |
| <property name="javadoc.link.java" value="http://java.sun.com/javase/6/docs/api/" /> |
| <property name="javadoc.packages" value="org.apache.hadoop.*" /> |
| <property name="javadoc.maxmemory" value="512m" /> |
| |
| <mkdir dir="${build.dir}" /> |
| <mkdir dir="${build.classes}" /> |
| <mkdir dir="${build.dir}/test" /> |
| <exec executable="echo" output="${basedir}/bin/VERSION"> |
| <arg line="${chukwaVersion}" /> |
| </exec> |
| |
| </target> |
| |
| <target name="main" depends="init, compile, compile-contrib,compress" description="Main target"> |
| <echo> |
| Building the .jar files. |
| </echo> |
| </target> |
| |
| <target name="compile" depends="compile-common,compile-inputtools,compile-datacollection,compile-extraction,compile-hicc,compile-contrib" description="Compilation target"> |
| </target> |
| |
| <target name="compile-common" depends="init" description="Compilation target"> |
| <javac srcdir="src/java" destdir="${build.classes}" debug="${javac.debug}"> |
| <exclude name="org/apache/hadoop/chukwa/datacollection/**" /> |
| <exclude name="org/apache/hadoop/chukwa/extraction/**" /> |
| <exclude name="org/apache/hadoop/chukwa/inputtools/**" /> |
| <exclude name="org/apache/hadoop/mapred/**" /> |
| <compilerarg value="-Xlint" /> |
| <classpath refid="classpath" /> |
| </javac> |
| </target> |
| |
| <target name="compile-inputtools" depends="init,compile-common" description="Compile Input Tools"> |
| <javac srcdir="src/java" destdir="${build.classes}" excludes="**/ChukwaTTInstru.java" debug="${javac.debug}"> |
| <compilerarg value="-Xlint" /> |
| <exclude name="org/apache/hadoop/*" /> |
| <include name="org/apache/hadoop/mapred/**" /> |
| <include name="org/apache/hadoop/chukwa/inputtools/**" /> |
| <classpath refid="classpath" /> |
| </javac> |
| </target> |
| |
| <target name="compile-datacollection" depends="init,compile-common" description="Compilation Data Collection Framework"> |
| <javac srcdir="src/java" destdir="${build.classes}" debug="${javac.debug}"> |
| <compilerarg value="-Xlint" /> |
| <classpath refid="classpath" /> |
| <exclude name="org/apache/hadoop/mapred/**" /> |
| <include name="org/apache/hadoop/chukwa/datacollection/**" /> |
| <include name="org/apache/hadoop/metrics/spi/**" /> |
| </javac> |
| </target> |
| |
| <target name="compile-extraction" depends="init,compile-common" description="Compilation Data Processing Framework"> |
| <javac srcdir="src/java" destdir="${build.classes}" debug="${javac.debug}"> |
| <compilerarg value="-Xlint" /> |
| <classpath refid="classpath" /> |
| <exclude name="org/apache/hadoop/chukwa/*" /> |
| <include name="org/apache/hadoop/chukwa/database/**" /> |
| <include name="org/apache/hadoop/chukwa/extraction/**" /> |
| </javac> |
| </target> |
| |
| <target name="compile-hicc" depends="init" description="Compilation HICC Framework"> |
| <javac srcdir="src/java" destdir="${build.classes}" debug="${javac.debug}"> |
| <compilerarg value="-Xlint" /> |
| <classpath refid="classpath" /> |
| <exclude name="org/apache/hadoop/chukwa/*" /> |
| <include name="org/apache/hadoop/chukwa/hicc/**" /> |
| <include name="org/apache/hadoop/chukwa/rest/**" /> |
| </javac> |
| </target> |
| |
| <target name="compile-test" depends="init,compress" description="Test target"> |
| |
| <delete dir="${test.build.dir}" /> |
| <mkdir dir="${test.build.dir}" /> |
| <delete dir="${test.log.dir}" /> |
| <mkdir dir="${test.log.dir}" /> |
| <delete dir="${test.build.classes}" /> |
| <mkdir dir="${test.build.classes}" /> |
| |
| <javac srcdir="${test.src.dir}" destdir="${test.build.dir}/classes" debug="${javac.debug}"> |
| <classpath refid="testClasspath" /> |
| <classpath refid="testDemuxClasspath" /> |
| </javac> |
| |
| <copy todir="${test.build.dir}/classes/org/apache/hadoop/chukwa/inputtools/log4j/"> |
| <fileset dir="${basedir}/src/test/org/apache/hadoop/chukwa/inputtools/log4j/"> |
| <include name="late-log4j.properties" /> |
| <include name="tasklog-log4j.properties" /> |
| </fileset> |
| </copy> |
| <copy todir="${test.build.dir}/classes"> |
| <fileset dir="${basedir}/src/test"> |
| <include name="**/*.txt" /> |
| </fileset> |
| </copy> |
| <delete dir="${test.build.dir}/conf" /> |
| <mkdir dir="${test.build.dir}/conf" /> |
| <copy file="${conf.dir}/jdbc.conf.template" tofile="${test.build.dir}/conf/jdbc.conf" /> |
| <copy file="${conf.dir}/mdl.xml" tofile="${test.build.dir}/conf/mdl.xml" /> |
| <copy file="${conf.dir}/aggregator.sql" tofile="${test.build.dir}/conf/aggregator.sql" /> |
| <copy file="${conf.dir}/database_create_tables.sql" tofile="${test.build.dir}/conf/database_create_tables.sql" /> |
| <copy todir="${test.build.dir}/var" failonerror="false"> |
| <fileset dir="${basedir}/test/samples" /> |
| </copy> |
| <copy file="${build.dir}/hicc.war" tofile="${test.build.dir}/hicc.war" /> |
| </target> |
| |
| <target name="compile-contrib" depends="compile-common,compile-datacollection,compile-extraction"> |
| <subant target="compile"> |
| <property name="version" value="${version}"/> |
| <fileset file="${contrib.dir}/build.xml"/> |
| </subant> |
| </target> |
| |
| <target name="test-chukwa" depends="compile,compile-test,compress" description="Run Chukwa unit tests"> |
| <delete dir="/tmp/chukwa/hicc" /> |
| <mkdir dir="${test.build.dir}/var" /> |
| <mkdir dir="${test.build.dir}/var/log" /> |
| <mkdir dir="${test.build.dir}/var/run" /> |
| <mkdir dir="${test.build.classes}/webapps" /> |
| <mkdir dir="${test.build.classes}/logs" /> |
| <copy todir="${test.build.dir}/var/log"> |
| <fileset dir="${basedir}/test/samples/"> |
| <include name="*.log" /> |
| </fileset> |
| </copy> |
| <copy todir="${test.build.classes}"> |
| <fileset dir="${build.dir}"> |
| <include name="chukwa-core*.jar" /> |
| </fileset> |
| </copy> |
| <copy todir="${test.build.classes}/webapps"> |
| <fileset dir="${build.dir}"> |
| <!-- include name="chukwa.war" / --> |
| <include name="hicc.war" /> |
| </fileset> |
| </copy> |
| <echo message="localhost" file="${test.build.dir}/conf/collectors"/> |
| <copy file="${conf.dir}/chukwa-common.xml.template" tofile="${test.build.dir}/conf/chukwa-common.xml"> |
| <filterchain> |
| <replacetokens> |
| <token key="CHUKWA_DIR" value="/tmp/chukwa" /> |
| </replacetokens> |
| </filterchain> |
| </copy> |
| <copy file="${basedir}/conf/chukwa-demux-conf.xml.template" tofile="${test.build.dir}/conf/chukwa-demux-conf.xml"> |
| <filterchain> |
| |
| <replacetokens> |
| <token key="TODO-DEMUX-IO-SORT-MB" value="${TODO-DEMUX-IO-SORT-MB}" /> |
| </replacetokens> |
| <replacetokens> |
| <token key="TODO-DEMUX-FS-INMEMORY-SIZE_MB" value="${TODO-DEMUX-FS-INMEMORY-SIZE_MB}" /> |
| </replacetokens> |
| <replacetokens> |
| <token key="TODO-DEMUX-IO-SORT-FACTOR" value="${TODO-DEMUX-IO-SORT-FACTOR}" /> |
| </replacetokens> |
| |
| </filterchain> |
| </copy> |
| <copy file="${basedir}/conf/log4j.properties" tofile="${test.build.dir}/conf/log4j.properties"></copy> |
| <copy file="${build.dir}/hicc.war" tofile="${test.build.classes}/webapps/hicc.war"></copy> |
| <copy file="${basedir}/conf/auth.conf" tofile="${test.build.dir}/conf/auth.conf"></copy> |
| <junit showoutput="${test.output}" fork="yes" printsummary="${test.printsummary}" forkmode="${test.junit.fork.mode}" maxmemory="${test.junit.maxmemory}" dir="${test.build.dir}/classes/" timeout="${test.timeout}" errorProperty="tests.failed" failureProperty="tests.failed"> |
| <classpath refid="testClasspath" /> |
| <env key="CHUKWA_CONF_DIR" value="${test.build.dir}/conf" /> |
| <env key="CHUKWA_DATA_DIR" value="${test.build.dir}/var" /> |
| <env key="CHUKWA_LOG_DIR" value="${test.build.dir}/var/log" /> |
| <env key="CHUKWA_PID_DIR" value="${test.build.dir}/var/run" /> |
| <env key="CHUKWA_HDFS" value="/chukwa" /> |
| <env key="CHUKWA_HOME" value="${test.build.classes}" /> |
| <sysproperty key="test.src.dir" value="${test.src.dir}" /> |
| <sysproperty key="test.build.classes" value="${test.build.classes}" /> |
| <sysproperty key="log4j.configuration" value="log4j.properties" /> |
| <sysproperty key="CHUKWA_DATA_DIR" value="${test.build.dir}/var" /> |
| <sysproperty key="CHUKWA_CONF_DIR" value="${test.build.dir}/conf" /> |
| <sysproperty key="CHUKWA_LOG_DIR" value="${test.build.dir}/var/log" /> |
| <sysproperty key="CHUKWA_PID_DIR" value="${test.build.dir}/var/run" /> |
| <sysproperty key="CHUKWA_HDFS" value="/chukwa" /> |
| <sysproperty key="CHUKWA_HOME" value="${test.build.classes}" /> |
| <formatter type="${test.junit.output.format}" /> |
| <batchtest todir="${test.build.dir}" unless="testcase"> |
| <fileset dir="${test.src.dir}"> |
| <include name="**/${test.include}.java" /> |
| <exclude name="**/${test.exclude}.java" /> |
| <exclude name="**/TestAgentConfig.java" /> |
| <exclude name="**/TestDemux.java" /> |
| <exclude name="**/TestArchive.java" /> |
| </fileset> |
| </batchtest> |
| <batchtest todir="${test.build.dir}" if="testcase"> |
| <fileset dir="${test.src.dir}" includes="**/${testcase}.java"> |
| <exclude name="**/TestDemux.java" /> |
| </fileset> |
| </batchtest> |
| </junit> |
| <fail if="tests.failed">Tests failed!</fail> |
| <delete> |
| <fileset dir="${basedir}/var" includes="*" /> |
| </delete> |
| </target> |
| |
| <target name="collector" depends="compile" description="Prepare collector.war"> |
| <mkdir dir="${build.dir}/collector" /> |
| <mkdir dir="${build.dir}/collector/WEB-INF" /> |
| <mkdir dir="${build.dir}/collector/WEB-INF/classes" /> |
| <mkdir dir="${build.dir}/collector/WEB-INF/lib" /> |
| <mkdir dir="${build.dir}/collector/META-INF" /> |
| <copy todir="${build.dir}/collector/WEB-INF/classes"> |
| <fileset dir="${build.classes}"> |
| <include name="org/apache/hadoop/chukwa/conf/**/*.class" /> |
| </fileset> |
| <fileset dir="${build.classes}"> |
| <include name="org/apache/hadoop/chukwa/datacollection/**/*.class" /> |
| </fileset> |
| <fileset dir="${build.classes}"> |
| <include name="org/apache/hadoop/chukwa/extraction/**/*.class" /> |
| </fileset> |
| <fileset dir="${build.classes}"> |
| <include name="org/apache/hadoop/chukwa/util/**/*.class" /> |
| </fileset> |
| <fileset dir="${basedir}/src/java"> |
| <include name="org/apache/hadoop/chukwa/conf/**/*.java" /> |
| </fileset> |
| <fileset dir="${basedir}/src/java"> |
| <include name="org/apache/hadoop/chukwa/datacollection/**/*.java" /> |
| </fileset> |
| <fileset dir="${basedir}/src/java"> |
| <include name="org/apache/hadoop/chukwa/extraction/**/*.java" /> |
| </fileset> |
| <fileset dir="${basedir}/src/java"> |
| <include name="org/apache/hadoop/chukwa/util/**/*.java" /> |
| </fileset> |
| </copy> |
| |
| <copy todir="${build.dir}/collector"> |
| <fileset dir="${basedir}/src/web/collector"> |
| <include name="**" /> |
| </fileset> |
| </copy> |
| |
| <copy todir="${build.dir}/collector/WEB-INF/lib"> |
| <fileset dir="${basedir}/lib"> |
| <include name="log4j-${log4j.version}.jar" /> |
| <include name="${build.dir}/${final.name}-core.jar" /> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="collector_jar" depends="compile, collector" description="Create collector jar"> |
| <jar jarfile="${build.dir}/collector-${chukwaVersion}.war" basedir="${build.dir}/collector"> |
| <fileset dir="${build.dir}/collector" includes="**" /> |
| </jar> |
| </target> |
| |
| <target name="tools_jar" depends="compile, collector" description="Create tools jar"> |
| <jar jarfile="${build.dir}/tools-${chukwaVersion}.jar" basedir="${build.classes}" includes="org/apache/hadoop/chukwa/inputtools/**/*.class"> |
| <fileset dir="${basedir}/src/java"> |
| <include name="org/apache/hadoop/chukwa/inputtools/**/*.java" /> |
| </fileset> |
| </jar> |
| </target> |
| |
| <target name="agent_jar" depends="compile, collector" description="Create agent jar"> |
| <jar jarfile="${build.dir}/chukwa-agent-${chukwaVersion}.jar" basedir="${build.classes}" includes="org/apache/hadoop/chukwa/client/**/*.class"> |
| <fileset dir="${build.dir}"> |
| <include name="org/apache/hadoop/chukwa/conf/**/*.class" /> |
| </fileset> |
| <fileset dir="${build.classes}"> |
| <include name="org/apache/hadoop/metrics/**/*.class" /> |
| </fileset> |
| |
| <fileset dir="${build.classes}"> |
| <include name="org/apache/hadoop/chukwa/util/**/*.class" /> |
| </fileset> |
| <fileset dir="${build.classes}"> |
| <include name="org/apache/hadoop/chukwa/inputtools/**/*.class" /> |
| </fileset> |
| <fileset dir="${build.classes}"> |
| <exclude name="org/apache/hadoop/chukwa/datacollection/collector/**/*.class" /> |
| <exclude name="org/apache/hadoop/chukwa/datacollection/writer/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/datacollection/**/*.class" /> |
| </fileset> |
| |
| <fileset dir="${basedir}/src/java"> |
| <include name="org/apache/hadoop/metrics/**/*.java" /> |
| </fileset> |
| <fileset dir="${basedir}/src/java"> |
| <include name="org/apache/hadoop/chukwa/client/**/*.java" /> |
| </fileset> |
| <fileset dir="${basedir}/src/java"> |
| <include name="org/apache/hadoop/chukwa/util/**/*.java" /> |
| </fileset> |
| <fileset dir="${basedir}/src/java"> |
| <include name="org/apache/hadoop/chukwa/inputtools/**/*.java" /> |
| </fileset> |
| <fileset dir="${basedir}/src/java"> |
| <include name="org/apache/hadoop/chukwa/inputtools/**/*.java" /> |
| </fileset> |
| <fileset dir="${basedir}/src/java"> |
| <include name="org/apache/hadoop/chukwa/datacollection/**/*.java" /> |
| <exclude name="org/apache/hadoop/chukwa/datacollection/collector/**/*.java" /> |
| <exclude name="org/apache/hadoop/chukwa/datacollection/writer/**/*.java" /> |
| </fileset> |
| |
| </jar> |
| </target> |
| |
| <target name="chukwa_jar" depends="compile, collector" description="Create chukwa-core jar"> |
| <jar jarfile="${build.dir}/chukwa-core-${chukwaVersion}.jar" basedir="${build.classes}" includes="org/apache/hadoop/chukwa/datacollection/**/*.class"> |
| <manifest> |
| <section name="org/apache/hadoop/chukwa"> |
| <attribute name="Implementation-Title" value="Chukwa" /> |
| <attribute name="Implementation-Version" value="${chukwaVersion}" /> |
| <attribute name="Implementation-Vendor" value="Apache" /> |
| </section> |
| </manifest> |
| |
| <fileset dir="${build.classes}"> |
| <include name="org/apache/hadoop/chukwa/**/*.class" /> |
| </fileset> |
| <fileset dir="${basedir}/src/java"> |
| <include name="org/apache/hadoop/chukwa/**/*.java" /> |
| </fileset> |
| </jar> |
| </target> |
| |
| <target name="chukwa-hadoop_jar" depends="compile" description="Create chukwa_hadoop jar for use with getting hadoop to use chukwa"> |
| <mkdir dir="${build.dir}/conf" /> |
| <jar jarfile="${build.dir}/chukwa-hadoop-${chukwaVersion}-client.jar" basedir="${build.classes}" includes="org/apache/hadoop/chukwa/inputtools/log4j/**/*.class"> |
| <fileset dir="${basedir}/src/java"> |
| <include name="org/apache/hadoop/mapred/**/*.java" /> |
| <include name="org/apache/hadoop/chukwa/inputtools/log4j/**/*.java" /> |
| <include name="org/apache/hadoop/chukwa/datacollection/client/**/*.java" /> |
| <include name="org/apache/hadoop/chukwa/util/**/*.java" /> |
| </fileset> |
| <fileset dir="${build.classes}"> |
| <include name="org/apache/hadoop/mapred/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/datacollection/client/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/util/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/datacollection/controller/*.class" /> |
| </fileset> |
| </jar> |
| </target> |
| |
| <target name="hicc" depends="compile, chukwa_jar, package-hadoop, package-standalone" description="Prepare hicc.war"> |
| <mkdir dir="${build.dir}/hicc" /> |
| <mkdir dir="${build.dir}/hicc/WEB-INF" /> |
| <mkdir dir="${build.dir}/hicc/WEB-INF/classes" /> |
| <mkdir dir="${build.dir}/hicc/WEB-INF/lib" /> |
| <mkdir dir="${build.dir}/hicc/META-INF" /> |
| <copy todir="${build.dir}/hicc"> |
| <fileset dir="${basedir}/src/web/hicc"> |
| <include name="**" /> |
| </fileset> |
| </copy> |
| <copy todir="${build.dir}/hicc/WEB-INF/classes"> |
| <fileset dir="${build.classes}"> |
| <include name="org/apache/hadoop/chukwa/hicc/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/rest/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/conf/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/database/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/datacollection/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/extraction/engine/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/inputtools/*.class" /> |
| <include name="org/apache/hadoop/chukwa/util/**/*.class" /> |
| </fileset> |
| |
| <fileset dir="${basedir}/src/java"> |
| <include name="org/apache/hadoop/chukwa/hicc/**/*.java" /> |
| <include name="org/apache/hadoop/chukwa/rest/**/*.java" /> |
| <include name="org/apache/hadoop/chukwa/conf/**/*.java" /> |
| <include name="org/apache/hadoop/chukwa/datacollection/**/*.java" /> |
| <include name="org/apache/hadoop/chukwa/extraction/engine/**/*.java" /> |
| <include name="org/apache/hadoop/chukwa/inputtools/*.java" /> |
| <include name="org/apache/hadoop/chukwa/util/**/*.java" /> |
| </fileset> |
| |
| </copy> |
| <copy todir="${build.dir}/hicc/WEB-INF/lib"> |
| <fileset dir="${basedir}/lib"> |
| <include name="json.jar" /> |
| <include name="json-lib-2.2.3-jdk15.jar" /> |
| <include name="jchronic-0.2.3.jar" /> |
| <include name="asm-3.1.jar" /> |
| <include name="jersey-bundle-1.1.0-ea.jar" /> |
| <include name="jsr311-api-1.0.jar" /> |
| <include name="html-filter-1.0.jar" /> |
| </fileset> |
| <fileset dir="${common.ivy.lib.dir}"> |
| <include name="*.jar" /> |
| <exclude name="jetty-*.jar" /> |
| <!-- exclude name="junit-*.jar" / --> |
| <exclude name="standard*.jar" /> |
| <!-- start --> |
| <exclude name="jsp-api*.jar" /> |
| <exclude name="servlet*.jar" /> |
| <!-- end --> |
| <exclude name="jstl*.jar" /> |
| </fileset> |
| <fileset dir="${build.dir}"> |
| <include name="${name}-core-${chukwaVersion}.jar" /> |
| </fileset> |
| <fileset dir="${build.dir}/${final.name}/hadoopjars"> |
| <include name="*.jar" /> |
| <exclude name="hadoop-0.2*-core.jar" /> |
| <exclude name="jasper-*.jar" /> |
| <exclude name="jetty-*.jar" /> |
| <exclude name="jsp-api*.jar" /> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="chukwa" depends="compile, chukwa_jar, package-hadoop, package-standalone" description="Prepare chukwa.war"> |
| <mkdir dir="${build.dir}/chukwa" /> |
| <mkdir dir="${build.dir}/chukwa/WEB-INF" /> |
| <mkdir dir="${build.dir}/chukwa/WEB-INF/classes" /> |
| <mkdir dir="${build.dir}/chukwa/WEB-INF/lib" /> |
| <mkdir dir="${build.dir}/chukwa/META-INF" /> |
| <copy todir="${build.dir}/chukwa"> |
| <fileset dir="${basedir}/src/web/hicc"> |
| <include name="**" /> |
| </fileset> |
| </copy> |
| <copy todir="${build.dir}/chukwa/WEB-INF/classes"> |
| <fileset dir="${build.classes}"> |
| <include name="org/apache/hadoop/chukwa/hicc/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/rest/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/conf/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/database/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/datacollection/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/extraction/engine/**/*.class" /> |
| <include name="org/apache/hadoop/chukwa/inputtools/*.class" /> |
| <include name="org/apache/hadoop/chukwa/util/**/*.class" /> |
| </fileset> |
| |
| <fileset dir="${basedir}/src/java"> |
| <include name="org/apache/hadoop/chukwa/hicc/**/*.java" /> |
| <include name="org/apache/hadoop/chukwa/rest/**/*.java" /> |
| <include name="org/apache/hadoop/chukwa/conf/**/*.java" /> |
| <include name="org/apache/hadoop/chukwa/datacollection/**/*.java" /> |
| <include name="org/apache/hadoop/chukwa/extraction/engine/**/*.java" /> |
| <include name="org/apache/hadoop/chukwa/inputtools/*.java" /> |
| <include name="org/apache/hadoop/chukwa/util/**/*.java" /> |
| </fileset> |
| |
| </copy> |
| <copy todir="${build.dir}/chukwa/WEB-INF/lib"> |
| <fileset dir="${basedir}/lib"> |
| <include name="json.jar" /> |
| <include name="json-lib-2.2.3-jdk15.jar" /> |
| <include name="jchronic-0.2.3.jar" /> |
| <include name="asm-3.1.jar" /> |
| <include name="jersey-bundle-1.1.0-ea.jar" /> |
| <include name="jsr311-api-1.0.jar" /> |
| <include name="html-filter-1.0.jar" /> |
| </fileset> |
| <fileset dir="${common.ivy.lib.dir}"> |
| <include name="*.jar" /> |
| <exclude name="jetty-*.jar" /> |
| <exclude name="jsp-api*.jar" /> |
| <exclude name="junit-*.jar" /> |
| </fileset> |
| <fileset dir="${build.dir}"> |
| <include name="${name}-core-${chukwaVersion}.jar" /> |
| </fileset> |
| <fileset dir="${build.dir}/${final.name}/hadoopjars"> |
| <include name="*.jar" /> |
| <exclude name="hadoop-0.2*-core.jar" /> |
| <exclude name="jasper-*.jar" /> |
| <exclude name="jetty-*.jar" /> |
| <exclude name="jsp-api*.jar" /> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="hicc_war" depends="compile, hicc" description="Create hicc jar"> |
| <jar jarfile="${build.dir}/hicc.war" basedir="${build.dir}/hicc"> |
| </jar> |
| </target> |
| |
| <target name="chukwa_war" depends="compile, chukwa" description="Create chukwa jar file for REST API"> |
| <jar jarfile="${build.dir}/chukwa.war" basedir="${build.dir}/chukwa"> |
| </jar> |
| </target> |
| |
| <target name="compress" depends="compile,collector,collector_jar,hicc_war,chukwa_war,tools_jar,agent_jar,chukwa_jar,chukwa-hadoop_jar" description="Compression target"> |
| <copy todir="." includeEmptyDirs="false"> |
| <fileset dir="${build.dir}"> |
| <exclude name="**" /> |
| <include name="**/*.jar" /> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="test" depends="compile,compile-test,test-chukwa,test-contrib" description="Automated Test Framework"> |
| </target> |
| |
| <target name="test-contrib" depends="chukwa_jar" description="Run contrib unit tests"> |
| <subant target="test"> |
| <property name="version" value="${version}"/> |
| <fileset file="${contrib.dir}/build.xml"/> |
| </subant> |
| </target> |
| <!-- ================================================================== --> |
| <!-- Documentation --> |
| <!-- ================================================================== --> |
| |
| <target name="forrest.check" depends="java5.check" if="forrest.home"> |
| <fail unless="forrest.home" message="'forrest.home' is not defined. Please pass -Dforrest.home=<base of Apache Forrest installation> to Ant on the command-line." /> |
| </target> |
| |
| <target name="java5.check" if="forrest.home"> |
| <fail unless="java5.home" message="'java5.home' is not defined. Forrest requires Java 5. Please pass -Djava5.home=<base of Java 5 distribution> to Ant on the command-line." /> |
| </target> |
| |
| <target name="forrest-docs" depends="forrest.check" description="Generate forrest-based documentation. To use, specify -Dforrest.home=<base of Apache Forrest installation> on the command line." if="forrest.home"> |
| <exec dir="${docs.src}" executable="${forrest.home}/bin/forrest" failonerror="true"> |
| <env key="JAVA_HOME" value="${java5.home}" /> |
| </exec> |
| <copy file="${docs.src}/releasenotes.html" todir="${docs.src}/build/site" /> |
| <copy todir="${build.docs}"> |
| <fileset dir="${docs.src}/build/site/" /> |
| </copy> |
| </target> |
| |
| <target name="docs" depends="init,javadoc,forrest-docs" description="Generate javadoc, and release notes." if="forrest.home"> |
| <copy todir="${build.docs}"> |
| <fileset dir="${docs.src}/build/site/" /> |
| </copy> |
| <copy file="${docs.src}/src/documentation/resources/images/chukwa_logo_small.jpg" todir="${build.docs}/images" /> |
| <antcall target="changes-to-html" /> |
| </target> |
| |
| <target name="javadoc-uptodate" depends="compile, ivy-retrieve-javadoc"> |
| <uptodate property="javadoc.is.uptodate"> |
| <srcfiles dir="${src.dir}/java"> |
| <include name="**/*.java" /> |
| <exclude name="org/apache/hadoop/chukwa/inputtools/ChukwaTTInstru.java" /> |
| <include name="**/*.html" /> |
| </srcfiles> |
| <mapper type="merge" to="${build.javadoc.timestamp}" /> |
| </uptodate> |
| </target> |
| |
| <target name="javadoc" description="Generate javadoc" depends="javadoc-uptodate" unless="javadoc.is.uptodate"> |
| <mkdir dir="${build.javadoc}" /> |
| <javadoc overview="${src.dir}/docs/overview.html" packagenames="org.apache.hadoop.chukwa.*" destdir="${build.javadoc}" author="true" version="true" use="true" windowtitle="${name} ${chukwaVersion} API" doctitle="${name} ${chukwaVersion} API" bottom="Copyright &copy; ${year} The Apache Software Foundation" maxmemory="${javadoc.maxmemory}"> |
| <packageset dir="${src.dir}/java"> |
| <exclude name="org/apache/hadoop/mapred/**" /> |
| <exclude name="org/apache/hadoop/chukwa/inputtools/ChukwaTTInstru" /> |
| </packageset> |
| |
| <link href="${javadoc.link.java}" /> |
| |
| <classpath> |
| <path refid="classpath" /> |
| <path refid="javadoc-classpath" /> |
| <pathelement path="${java.class.path}" /> |
| <pathelement location="${build.tools}" /> |
| </classpath> |
| |
| <group title="Chukwa" packages="org.apache.*" /> |
| </javadoc> |
| </target> |
| |
| <target name="api-xml" depends="ivy-retrieve-jdiff,javadoc,write-null"> |
| <mkdir dir="${jdiff.build.dir}" /> |
| <javadoc maxmemory="${javadoc.maxmemory}"> |
| <doclet name="jdiff.JDiff" path="${jdiff.jar}:${xerces.jar}"> |
| <param name="-apidir" value="${jdiff.xml.dir}" /> |
| <param name="-apiname" value="${name} ${chukwaVersion}" /> |
| </doclet> |
| <packageset dir="${src.dir}/java"> |
| <exclude name="org/apache/hadoop/mapred/**" /> |
| </packageset> |
| <classpath> |
| <path refid="classpath" /> |
| <path refid="jdiff-classpath" /> |
| <pathelement path="${java.class.path}" /> |
| </classpath> |
| </javadoc> |
| </target> |
| |
| <target name="write-null"> |
| <exec executable="touch"> |
| <arg value="${jdiff.home}/Null.java" /> |
| </exec> |
| </target> |
| |
| <target name="api-report" depends="ivy-retrieve-jdiff,api-xml"> |
| <mkdir dir="${jdiff.build.dir}" /> |
| <javadoc sourcepath="src/core,src/hdfs,src,mapred,src/tools" destdir="${jdiff.build.dir}" sourceFiles="${jdiff.home}/Null.java" maxmemory="${javadoc.maxmemory}"> |
| <doclet name="jdiff.JDiff" path="${jdiff.jar}:${xerces.jar}"> |
| <param name="-oldapi" value="chukwa ${jdiff.stable}" /> |
| <param name="-newapi" value="chukwa ${chukwaVersion}" /> |
| <param name="-oldapidir" value="${jdiff.xml.dir}" /> |
| <param name="-newapidir" value="${jdiff.xml.dir}" /> |
| <param name="-javadocold" value="${jdiff.stable.javadoc}" /> |
| <param name="-javadocnew" value="../../api/" /> |
| <param name="-stats" /> |
| </doclet> |
| <classpath> |
| <path refid="classpath" /> |
| <path refid="jdiff-classpath" /> |
| <pathelement path="${java.class.path}" /> |
| </classpath> |
| </javadoc> |
| </target> |
| |
| <target name="changes-to-html" description="Convert CHANGES.txt into an html file"> |
| <mkdir dir="${build.docs}" /> |
| <exec executable="perl" input="CHANGES.txt" output="${build.docs}/changes.html" failonerror="true"> |
| <arg value="${changes.src}/changes2html.pl" /> |
| </exec> |
| <copy todir="${build.docs}"> |
| <fileset dir="${changes.src}" includes="*.css" /> |
| </copy> |
| </target> |
| |
| <!-- ================================================================== --> |
| <!-- Clean. Delete the build files, and their directories --> |
| <!-- ================================================================== --> |
| <target name="clean" depends="init,clean-contrib" description="Clean. Delete the build files, and their directories"> |
| <delete dir="${build.dir}" /> |
| <delete dir="${build.ivy.lib.dir}/${ant.project.home}" /> |
| <delete dir="build" /> |
| <delete file="${ivy.jar}" /> |
| <delete dir="${docs.src}/build" /> |
| </target> |
| |
| <!-- ================================================================== --> |
| <!-- Clean contrib target. For now, must be called explicitly --> |
| <!-- Using subant instead of ant as a workaround for 30569 --> |
| <!-- ================================================================== --> |
| <target name="clean-contrib"> |
| <subant target="clean"> |
| <fileset file="${contrib.dir}/build.xml"/> |
| </subant> |
| </target> |
| |
| <!-- ====================================================== --> |
| <!-- Macro definitions --> |
| <!-- ====================================================== --> |
| <macrodef name="macro_tar" description="Worker Macro for tar"> |
| <attribute name="param.destfile" /> |
| <element name="param.listofitems" /> |
| <sequential> |
| <tar compression="gzip" longfile="gnu" destfile="@{param.destfile}"> |
| <param.listofitems /> |
| </tar> |
| </sequential> |
| </macrodef> |
| |
| <!-- ================================================================== --> |
| <!-- D I S T R I B U T I O N --> |
| <!-- ================================================================== --> |
| <!-- --> |
| <!-- ================================================================== --> |
| |
| <target name="package-hadoop" description="package hadoop from hadoop source" if="hadoopMode"> |
| <mkdir dir="${build.dir}/${final.name}/hadoopjars" /> |
| <copy toDir="${build.dir}/${final.name}/hadoopjars"> |
| <fileset dir="${hadoop.root}/build"> |
| <include name="hadoop-*-core.jar" /> |
| </fileset> |
| <fileset dir="${build.ivy.lib.dir}\Hadoop\common"> |
| |
| <include name="jetty-*.jar" /> |
| <include name="commons-httpclient-*.jar" /> |
| <include name="commons-logging-*.jar" /> |
| <include name="commons-net-*.jar" /> |
| <include name="jasper-*.jar" /> |
| <include name="commons-el.jar" /> |
| <include name="commons-codec-*.jar" /> |
| </fileset> |
| <fileset dir="lib"> |
| <include name="jsp-api.jar" /> |
| </fileset> |
| <fileset dir="${hadoop.root}/lib"> |
| <include name="commons-cli-*.jar" /> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="package-standalone" description="package hadoop from hadoop source" if="standaloneMode"> |
| <mkdir dir="${build.dir}/${final.name}/hadoopjars" /> |
| <copy todir="${build.dir}/${final.name}/hadoopjars" includeEmptyDirs="false"> |
| <fileset dir="${basedir}/hadoopjars"> |
| <include name="**/*.jar" /> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="chukwa-config" description="create real files based on templates" depends="init"> |
| <mkdir dir="${build.dir}/conf" /> |
| <copy todir="${build.dir}/conf"> |
| <fileset dir="${basedir}/conf"> |
| <!-- <exclude name="*.template" /> --> |
| </fileset> |
| </copy> |
| |
| <copy file="${basedir}/conf/jdbc.conf.template" tofile="${build.dir}/conf/jdbc.conf.template"> |
| </copy> |
| |
| <copy file="${conf.dir}/chukwa-common.xml.template" tofile="${build.dir}/conf/chukwa-common.xml"> |
| <filterchain> |
| <replacetokens> |
| <token key="CHUKWA_DIR" value="/chukwa" /> |
| </replacetokens> |
| </filterchain> |
| </copy> |
| |
| <copy file="${basedir}/conf/alert.template" tofile="${build.dir}/conf/alert"> |
| <filterchain> |
| <replacetokens> |
| <token key="TODO-ALERT-EMAIL" value="${TODO-ALERT-EMAIL}" /> |
| </replacetokens> |
| </filterchain> |
| </copy> |
| |
| <copy file="${basedir}/conf/hadoop-metrics.properties.template" tofile="${build.dir}/conf/hadoop-metrics.properties"> |
| <filterchain> |
| <replacetokens> |
| <token key="TODO-CHUKWA_LOG_DIR" value="${TODO-CHUKWA_LOG_DIR}" /> |
| </replacetokens> |
| </filterchain> |
| </copy> |
| <copy file="${basedir}/conf/chukwa-agent-conf.xml.template" tofile="${build.dir}/conf/chukwa-agent-conf.xml"> |
| <filterchain> |
| <replacetokens> |
| <token key="TODO-CLUSTER-NAME" value="${TODO-CLUSTER-NAME}" /> |
| </replacetokens> |
| </filterchain> |
| </copy> |
| <copy file="${basedir}/conf/nagios.properties.template" tofile="${build.dir}/conf/nagios.properties"> |
| <filterchain> |
| <replacetokens> |
| <token key="TODO-NAGIOS-SERVER" value="${TODO-NAGIOS-SERVER}" /> |
| <token key="TODO_CHUKWA_CONF_DIR" value="${rpm.conf.dir}" /> |
| </replacetokens> |
| </filterchain> |
| </copy> |
| |
| <copy file="${basedir}/conf/chukwa-collector-conf.xml.template" tofile="${build.dir}/conf/chukwa-collector-conf.xml"> |
| <filterchain> |
| |
| <replacetokens> |
| <token key="TODO-COLLECTORS-LOCAL-OUTPUT-DIR" value="${TODO-COLLECTORS-LOCAL-OUTPUT-DIR}" /> |
| </replacetokens> |
| <replacetokens> |
| <token key="TODO-COLLECTORS-NAMENODE" value="${TODO-COLLECTORS-NAMENODE}" /> |
| </replacetokens> |
| <replacetokens> |
| <token key="TODO-COLLECTORS-ROTATEINTERVAL" value="${TODO-COLLECTORS-ROTATEINTERVAL}" /> |
| </replacetokens> |
| <replacetokens> |
| <token key="TODO-COLLECTORS-PORT" value="${TODO-COLLECTORS-PORT}" /> |
| </replacetokens> |
| |
| </filterchain> |
| </copy> |
| |
| <copy file="${basedir}/conf/chukwa-demux-conf.xml.template" tofile="${build.dir}/conf/chukwa-demux-conf.xml"> |
| <filterchain> |
| |
| <replacetokens> |
| <token key="TODO-DEMUX-IO-SORT-MB" value="${TODO-DEMUX-IO-SORT-MB}" /> |
| </replacetokens> |
| <replacetokens> |
| <token key="TODO-DEMUX-FS-INMEMORY-SIZE_MB" value="${TODO-DEMUX-FS-INMEMORY-SIZE_MB}" /> |
| </replacetokens> |
| <replacetokens> |
| <token key="TODO-DEMUX-IO-SORT-FACTOR" value="${TODO-DEMUX-IO-SORT-FACTOR}" /> |
| </replacetokens> |
| |
| </filterchain> |
| </copy> |
| |
| <copy file="${basedir}/conf/chukwa-env.sh.template" tofile="${build.dir}/conf/chukwa-env.sh"> |
| <filterchain> |
| <replacetokens> |
| <token key="TODO-JAVA-HOME" value="${TODO-JAVA-HOME}" /> |
| </replacetokens> |
| <replacetokens> |
| <token key="TODO-HADOOP-HOME" value="${TODO-HADOOP-HOME}" /> |
| </replacetokens> |
| <replacetokens> |
| <token key="TODO-HADOOP-CONF-DIR" value="${TODO-HADOOP-CONF-DIR}" /> |
| </replacetokens> |
| <replacetokens> |
| <token key="TODO-CHUKWA_PID_DIR" value="${TODO-CHUKWA_PID_DIR}" /> |
| </replacetokens> |
| <replacetokens> |
| <token key="TODO-CHUKWA_LOG_DIR" value="${TODO-CHUKWA_LOG_DIR}" /> |
| </replacetokens> |
| <replacetokens> |
| <token key="TODO-AGENTS-INSTANCE-NAME" value="${TODO-AGENTS-INSTANCE-NAME}" /> |
| </replacetokens> |
| <replacetokens> |
| <token key="TODO_CHUKWA_JDBC_DRIVER" value="${TODO_CHUKWA_JDBC_DRIVER}" /> |
| </replacetokens> |
| <replacetokens> |
| <token key="TODO_CHUKWA_JDBC_URL_PREFIX" value="${TODO_CHUKWA_JDBC_URL_PREFIX}" /> |
| </replacetokens> |
| |
| </filterchain> |
| </copy> |
| |
| </target> |
| |
| <target name="package" depends="compress,docs,chukwa-config,package-hadoop,package-standalone" description="Build distribution"> |
| <mkdir dir="${build.dir}/${final.name}" /> |
| <mkdir dir="${build.dir}/${final.name}/lib" /> |
| <mkdir dir="${build.dir}/${final.name}/bin" /> |
| <mkdir dir="${build.dir}/${final.name}/script" /> |
| <mkdir dir="${build.dir}/${final.name}/script/pig" /> |
| <mkdir dir="${build.dir}/${final.name}/docs" /> |
| <mkdir dir="${build.dir}/${final.name}/ivy" /> |
| <mkdir dir="${build.dir}/${final.name}/logs" /> |
| <mkdir dir="${build.dir}/${final.name}/opt" /> |
| <mkdir dir="${build.dir}/${final.name}/test" /> |
| <mkdir dir="${build.dir}/${final.name}/tools" /> |
| <mkdir dir="${build.dir}/${final.name}/var" /> |
| <mkdir dir="${build.dir}/${final.name}/var/run" /> |
| <mkdir dir="${build.dir}/${final.name}/webapps" /> |
| <mkdir dir="${build.dir}/${final.name}/webapps/sandbox" /> |
| |
| <copy todir="${build.dir}/${final.name}" includeEmptyDirs="false"> |
| <fileset dir="${build.dir}"> |
| <include name="*.jar" /> |
| <include name="collector*.war" /> |
| </fileset> |
| </copy> |
| |
| <copy todir="${build.dir}/${final.name}/webapps" includeEmptyDirs="false"> |
| <fileset dir="${build.dir}"> |
| <include name="hicc*.war" /> |
| <include name="chukwa*.war" /> |
| </fileset> |
| </copy> |
| |
| <copy todir="${build.dir}/${final.name}/lib" includeEmptyDirs="false"> |
| <fileset dir="lib"> |
| <exclude name="**/native/**" /> |
| </fileset> |
| <fileset dir="${common.ivy.lib.dir}"> |
| <include name="*.jar" /> |
| </fileset> |
| </copy> |
| |
| <copy todir="${build.dir}/${final.name}/bin"> |
| <fileset dir="${basedir}/bin" /> |
| </copy> |
| |
| <copy todir="${build.dir}/${final.name}/script/pig"> |
| <fileset dir="${basedir}/script/pig" /> |
| </copy> |
| |
| <copy todir="${build.dir}/${final.name}/conf"> |
| <fileset dir="${build.dir}/conf"> |
| <exclude name="hadoop-metrics.properties" /> |
| </fileset> |
| </copy> |
| |
| <copy todir="${build.dir}/${final.name}/opt" failonerror="false"> |
| <fileset dir="${opt.dir}" /> |
| </copy> |
| |
| <copy todir="${build.dir}/${final.name}/contrib/chukwa-pig" failonerror="false"> |
| <fileset dir="${basedir}/contrib/chukwa-pig" /> |
| </copy> |
| |
| <copy todir="${build.dir}/${final.name}/contrib/xtrace" failonerror="false"> |
| <fileset dir="${basedir}/contrib/xtrace" /> |
| </copy> |
| |
| <copy todir="${build.dir}/${final.name}/tools"> |
| <fileset dir="${tools.dir}" /> |
| </copy> |
| |
| <copy todir="${build.dir}/${final.name}/var/descriptors"> |
| <fileset dir="${basedir}/src/web/hicc/descriptors" /> |
| </copy> |
| |
| <copy todir="${build.dir}/${final.name}/var/views"> |
| <fileset dir="${basedir}/src/web/hicc/views" /> |
| </copy> |
| |
| <chmod perm="ugo+x" type="file" parallel="false"> |
| <fileset dir="${build.dir}/${final.name}/tools"> |
| <include name="**" /> |
| </fileset> |
| </chmod> |
| |
| <chmod perm="ugo+x" type="file" parallel="false"> |
| <fileset dir="${build.dir}/${final.name}/bin"> |
| <include name="**" /> |
| </fileset> |
| </chmod> |
| |
| <copy todir="${build.dir}/${final.name}"> |
| <fileset dir="."> |
| <include name="*.txt" /> |
| </fileset> |
| </copy> |
| |
| <copy todir="${build.dir}/${final.name}/src" includeEmptyDirs="true"> |
| <fileset dir="src" excludes="**/*.template **/docs/build/**/*" /> |
| </copy> |
| |
| <copy todir="${build.dir}/${final.name}/docs" includeEmptyDirs="true"> |
| <fileset dir="${build.docs}" excludes="**/*.template **/docs/build/**/*" /> |
| </copy> |
| |
| <copy todir="${build.dir}/${final.name}" file="build.xml" /> |
| <copy todir="${build.dir}/${final.name}" file="ivy.xml" /> |
| <copy todir="${build.dir}/${final.name}" file="default.properties" /> |
| <copy todir="${build.dir}/${final.name}/ivy"> |
| <fileset dir="ivy"/> |
| </copy> |
| <copy todir="${build.dir}/${final.name}/test"> |
| <fileset dir="test"/> |
| </copy> |
| |
| </target> |
| |
| <!-- ================================================================== --> |
| <!-- Make release tarball --> |
| <!-- ================================================================== --> |
| <target name="tar" depends="package" description="Make release tarball"> |
| <macro_tar param.destfile="${build.dir}/${final.name}.tar.gz"> |
| <param.listofitems> |
| <tarfileset dir="${build.dir}" mode="664"> |
| <exclude name="${final.name}/bin/*" /> |
| <exclude name="${final.name}/org/*" /> |
| <exclude name="${final.name}/collector/**" /> |
| <exclude name="${final.name}/${final.name}/**" /> |
| <exclude name="${final.name}/tools/**" /> |
| <exclude name="${final.name}/hicc/*" /> |
| <include name="${final.name}/**" /> |
| </tarfileset> |
| <tarfileset dir="${build.dir}" mode="755"> |
| <include name="${final.name}/bin/*" /> |
| <include name="${final.name}/tools/**" /> |
| </tarfileset> |
| </param.listofitems> |
| </macro_tar> |
| </target> |
| |
| <target name="binary" depends="package" description="Make tarball without source and documentation"> |
| <macro_tar param.destfile="${build.dir}/${final.name}-bin.tar.gz"> |
| <param.listofitems> |
| <tarfileset dir="${build.dir}" mode="664"> |
| <exclude name="${final.name}/bin/*" /> |
| <exclude name="${final.name}/org/*" /> |
| <exclude name="${final.name}/collector/**" /> |
| <exclude name="${final.name}/${final.name}/**" /> |
| <exclude name="${final.name}/tools/**" /> |
| <exclude name="${final.name}/hicc/*" /> |
| <exclude name="${final.name}/src/**" /> |
| <exclude name="${final.name}/docs/**" /> |
| <include name="${final.name}/**" /> |
| </tarfileset> |
| <tarfileset dir="${build.dir}" mode="755"> |
| <include name="${final.name}/bin/*" /> |
| <include name="${final.name}/tools/**" /> |
| </tarfileset> |
| </param.listofitems> |
| </macro_tar> |
| </target> |
| |
| <target name="rpm" depends="tar" description="Make release rpm"> |
| <mkdir dir="${build.dir}/BUILD" /> |
| <mkdir dir="${build.dir}/RPMS" /> |
| <mkdir dir="${build.dir}/SOURCES" /> |
| <mkdir dir="${build.dir}/SPECS" /> |
| <copy todir="${build.dir}/SOURCES"> |
| <fileset dir="${build.dir}"> |
| <include name="${final.name}.tar.gz" /> |
| </fileset> |
| </copy> |
| <copy file="${basedir}/tools/specs/chukwa.spec" tofile="${build.dir}/SPECS/chukwa.spec"> |
| <filterchain> |
| <replacetokens> |
| <token key="chukwaVersion" value="${chukwaVersion}" /> |
| <token key="chukwaRelease" value="${chukwaRelease}" /> |
| <token key="build.dir" value="${build.dir}" /> |
| <token key="rpm.prefix" value="${rpm.prefix}" /> |
| <token key="rpm.conf.dir" value="${rpm.conf.dir}" /> |
| <token key="rpm.uid" value="${rpm.uid}" /> |
| <token key="rpm.hdfsusage.uid" value="${rpm.hdfsusage.uid}" /> |
| <token key="rpm.gid" value="${rpm.gid}" /> |
| </replacetokens> |
| </filterchain> |
| </copy> |
| <rpm specFile="chukwa.spec" topDir="${build.dir}" cleanBuildDir="true" failOnError="true" /> |
| </target> |
| |
| <!-- ================================================================== --> |
| <!-- Perform audit activities for the release --> |
| <!-- ================================================================== --> |
| <target name="releaseaudit" depends="package,ivy-retrieve-releaseaudit" description="Release Audit activities"> |
| <java classname="${rat.reporting.classname}" fork="true"> |
| <classpath refid="releaseaudit-classpath" /> |
| <arg value="${build.dir}/${final.name}" /> |
| </java> |
| </target> |
| |
| <target name="ivy-retrieve-releaseaudit" depends="ivy-resolve-releaseaudit" description="Retrieve Ivy-managed artifacts for the compile configurations"> |
| <ivy:retrieve settingsRef="${ant.project.name}.ivy.settings" pattern="${build.ivy.lib.dir}/${ivy.artifact.retrieve.pattern}" /> |
| <ivy:cachepath pathid="releaseaudit-classpath" conf="releaseaudit" /> |
| </target> |
| |
| <target name="ivy-resolve-releaseaudit" depends="ivy-init-local"> |
| <ivy:resolve settingsRef="${ant.project.name}.ivy.settings" conf="releaseaudit" /> |
| </target> |
| </project> |