bigbluebutton-Github/bigbluebutton-AppShare-server/build.xml

1034 lines
40 KiB
XML

<?xml version="1.0" ?>
<project name="Red5" basedir="." default="dist" xmlns:ivy="antlib:org.apache.ivy.ant">
<!-- This build file requires Apache Ant >= 1.7 -->
<condition property="ant-at-least-7">
<antversion atleast="1.7.0"/>
</condition>
<!-- project properties -->
<property environment="env"/>
<property name="java.home" value="${env.JDK_HOME}"/>
<property name="src.dir" value="src"/>
<property name="dist.dir" value="dist"/>
<property name="cluster.dir" value="cluster"/>
<property name="origindist.dir" value="${cluster.dir}/origin"/>
<property name="edgedist.dir" value="${cluster.dir}/edge"/>
<property name="log.dir" value="log"/>
<property name="lib.dir" value="lib"/>
<property name="classes.dir" value="bin"/>
<property name="webapps.dir" value="webapps"/>
<property name="webapps.build.dir" value="${dist.dir}/webapps"/>
<property name="debug.state" value="true"/>
<property name="config.dir" value="conf"/>
<property name="javadoc.dir" value="doc/api"/>
<!-- base project properties -->
<property file="build.properties"/>
<!-- user overides for project properties -->
<property file="${user.home}/build.properties"/>
<!-- Special directory destination for build war - unused in normal server build -->
<property name="tmp.war.dir" value=""/>
<!--
Ivy tasks and lib directory
http://ant.apache.org/ivy
http://testearly.com/2007/06/24/ivy-in-42-steps
-->
<taskdef uri="antlib:org.apache.ivy.ant" resource="org/apache/ivy/ant/antlib.xml" classpath="${lib.dir}/${ivy.version}.jar"/>
<property name="ivy.lib.dir" value="${lib.dir}"/>
<tstamp prefix="build">
<format property="TODAY" pattern="d-MMMM-yyyy" locale="en"/>
</tstamp>
<!-- JUNIT TESTING -->
<property name="test.dir" value="test"/>
<property name="testclass.dir" value="bin/testcases"/>
<property name="testreports.dir" value="${testclass.dir}/testreports"/>
<property name="testdoc.dir" value="doc/test"/>
<path id="project.classpath">
<fileset dir="${lib.dir}"/>
</path>
<path id="script.classpath">
<fileset dir="${lib.dir}"/>
<pathelement location="${classes.dir}"/>
</path>
<path id="full.classpath">
<fileset dir="${lib.dir}"/>
<fileset dir="./">
<filename name="red5.jar"/>
</fileset>
</path>
<path id="runtime.classpath">
<fileset dir="${lib.dir}">
<exclude name="Grobo*.jar"/>
<exclude name="grobo*.jar"/>
<exclude name="junit*.jar"/>
<exclude name="ivy*.jar"/>
</fileset>
</path>
<!-- Build Targets -->
<target name="-java6.check">
<condition property="java6.installed" value="true">
<and>
<equals arg1="${java.target_version}" arg2="1.6"/>
<available property="java6.installed" classname="javax.script.Bindings"/>
</and>
</condition>
<condition property="java6.using" value="1.6" else="${java.target_version}">
<isset property="java6.installed"/>
</condition>
<echo message="Using Java ${java6.using}"/>
</target>
<!-- Check for the main libraries -->
<target name="-library.check">
<echo message='Java: java.home is ${java.home} and the target version is ${java.target_version}'/>
<echo message='Ant: ant.home is ${ant.home} and the target version is ${ant.version}'/>
<condition property="library.installed" value="true">
<and>
<or>
<and>
<available property="spring.installed" classpathref="project.classpath" classname="org.springframework.core.SpringVersion"/>
<available property="log4j.installed" classpathref="project.classpath" classname="org.apache.log4j.Logger"/>
<available property="logging.installed" classpathref="project.classpath" classname="org.slf4j.Logger"/>
<available property="catalina.installed" classpathref="project.classpath" classname="org.apache.catalina.Server"/>
<available property="mina.installed" classpathref="project.classpath" classname="org.apache.mina.filter.codec.ProtocolEncoder"/>
<available property="minajmx.installed" classpathref="project.classpath" classname="org.apache.mina.integration.jmx.IoServiceManager"/>
<available property="acegi.installed" classpathref="project.classpath" classname="org.acegisecurity.SecurityConfig"/>
<equals arg1="${java.target_version}" arg2="1.6"/>
</and>
<and>
<available property="spring.installed" classpathref="project.classpath" classname="org.springframework.core.SpringVersion"/>
<available property="log4j.installed" classpathref="project.classpath" classname="org.apache.log4j.Logger"/>
<available property="logging.installed" classpathref="project.classpath" classname="org.slf4j.Logger"/>
<available property="catalina.installed" classpathref="project.classpath" classname="org.apache.catalina.Server"/>
<available property="mina.installed" classpathref="project.classpath" classname="org.apache.mina.filter.codec.ProtocolEncoder"/>
<available property="minajmx.installed" classpathref="project.classpath" classname="org.apache.mina.integration.jmx.IoServiceManager"/>
<available property="acegi.installed" classpathref="project.classpath" classname="org.acegisecurity.SecurityConfig"/>
<available property="script.installed" classpathref="project.classpath" classname="com.sun.phobos.script.javascript.RhinoScriptEngine"/>
<available property="groovy.script.installed" classpathref="project.classpath" classname="com.sun.script.groovy.GroovyScriptEngine"/>
<available property="jython.script.installed" classpathref="project.classpath" classname="com.sun.script.jython.JythonScriptEngine"/>
<equals arg1="${java.target_version}" arg2="1.5"/>
</and>
</or>
<!-- check for the test jars -->
<and>
<available property="junit.installed" classpathref="project.classpath" classname="org.junit.Test"/>
<available property="groboutils.installed" classpathref="project.classpath" classname="net.sourceforge.groboutils.junit.v1.TestRunnable"/>
<available property="spring-mock.installed" classpathref="project.classpath" classname="org.springframework.mock.web.MockServletConfig"/>
<equals arg1="ivy.conf.name" arg2="test"/>
</and>
</and>
</condition>
</target>
<target name="prepare" description="Setup the directories for building">
<mkdir dir="${classes.dir}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${log.dir}"/>
<mkdir dir="${cluster.dir}"/>
<mkdir dir="${origindist.dir}"/>
<mkdir dir="${edgedist.dir}"/>
<mkdir dir="${testclass.dir}"/>
<mkdir dir="${testreports.dir}"/>
</target>
<target name="clean" description="Clean the directories for building">
<delete dir="${classes.dir}"/>
<delete dir="${dist.dir}"/>
<delete dir="${cluster.dir}"/>
<delete dir="${javadoc.dir}"/>
<delete dir="${testdoc.dir}"/>
<delete includeemptydirs="true">
<fileset dir="${webapps.dir}/" includes="**/*.class"/>
</delete>
<delete includeemptydirs="true">
<fileset dir="${webapps.dir}/" includes="**/*.jar"/>
</delete>
</target>
<target name="retrieve" unless="library.installed" description="Retrieves the libraries if needed">
<!-- Ivy configuration -->
<ivy:settings file="ivysettings.xml"/>
<condition property="ivy.conf.name" value="default">
<not>
<isset property="ivy.conf.name"/>
</not>
</condition>
<echo message="Ivy conf name: ${ivy.conf.name}"/>
<ivy:resolve conf="${ivy.conf.name}"/>
<ivy:retrieve conf="${ivy.conf.name}"/>
</target>
<target name="ivyclear" description="Clears out the Ivy cache">
<delete dir="${user.home}/.ivy/cache"/>
<delete includeemptydirs="true">
<fileset dir="${lib.dir}" excludes="**/ivy*.jar"/>
</delete>
</target>
<target name="compile" depends="-library.check, -java6.check, prepare" description="Compiles the server">
<!-- token replacement filers -->
<property name="filter.file" value="conf/build_standalone.properties"/>
<condition property="java.target_version" value="1.5">
<not>
<isset property="java.target_version"/>
</not>
</condition>
<echo message="javac version: ${java.target_version}"/>
<condition property="eclipse.using" value="Using" else="Not using">
<isset property="eclipse.running"/>
</condition>
<echo message="${eclipse.using} the Eclipse IDE"/>
<condition property="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter">
<isset property="eclipse.running"/>
</condition>
<condition property="compiler" value="${build.compiler}${java.target_version}">
<equals arg1="${build.compiler}" arg2="javac"/>
</condition>
<property name="compiler" value="${build.compiler}"/>
<echo message="Compiler adapter name: ${compiler}"/>
<!-- destination for compiled classes -->
<property name="dest.dir" value="${classes.dir}"/>
<!-- standard excludes for compile -->
<property name="std_excludes" value="**/*.jsp,org/red5/server/script/**"/>
<antcall target="compile_core" inheritAll="true" inheritRefs="true"/>
<antcall target="compile_core_compatibility" inheritAll="true" inheritRefs="true"/>
<!-- libraries and classes needed for building the demos -->
<path id="webapps.classpath">
<fileset dir="${lib.dir}">
<filename name="*.jar"/>
</fileset>
<pathelement location="${classes.dir}"/>
</path>
<antcall target="compile_demos" inheritAll="true" inheritRefs="true"/>
<antcall target="compile_script" inheritAll="true" inheritRefs="true"/>
</target>
<!-- Core -->
<target name="compile_core" if="java6.installed" description="Build server core">
<antcall target="retrieve" inheritAll="true" inheritRefs="true">
<param name="ivy.conf.name" value="default"/>
</antcall>
<javac sourcepath="" srcdir="${src.dir}" destdir="${dest.dir}" classpathref="project.classpath"
optimize="${build.optimize}" verbose="${build.verbose}" fork="${build.fork}" nowarn="${build.nowarn}"
deprecation="${build.deprecation}" debug="${debug.state}" compiler="${compiler}"
source="${java.target_version}" target="${java.target_version}" memoryMaximumSize="${memory.maximum}"
excludes="${std_excludes}" listfiles="false"/>
</target>
<target name="compile_core_compatibility" unless="java6.installed">
<antcall target="retrieve" inheritAll="true" inheritRefs="true">
<param name="ivy.conf.name" value="java5"/>
</antcall>
<javac sourcepath="" srcdir="${src.dir}" destdir="${dest.dir}" classpathref="project.classpath"
optimize="${build.optimize}" verbose="${build.verbose}" fork="${build.fork}" nowarn="${build.nowarn}"
deprecation="${build.deprecation}" debug="${debug.state}" compiler="${compiler}"
source="${java.target_version}" target="${java.target_version}" memoryMaximumSize="${memory.maximum}"
excludes="${std_excludes}" listfiles="false"/>
</target>
<macrodef name="build-demo">
<attribute name="name"/>
<element name="copy-assets" optional="yes"/>
<sequential>
<mkdir dir="${webapps.build.dir}/@{name}/WEB-INF/classes"/>
<mkdir dir="${webapps.build.dir}/@{name}/WEB-INF/lib"/>
<javac sourcepath="" srcdir="${webapps.dir}/@{name}/WEB-INF/src" destdir="${webapps.build.dir}/@{name}/WEB-INF/classes"
classpathref="webapps.classpath" optimize="${build.optimize}" verbose="${build.verbose}"
fork="${build.fork}" nowarn="${build.nowarn}" deprecation="${build.deprecation}"
debug="${debug.state}" compiler="${compiler}" source="${java.target_version}" target="${java.target_version}"/>
<copy todir="${webapps.build.dir}/@{name}" filtering="true">
<fileset dir="webapps/@{name}">
<exclude name="**/src/**"/>
<exclude name="**/*.flv"/>
<exclude name="**/*.meta"/>
</fileset>
</copy>
<!-- copy other demo files (optional) -->
<copy-assets/>
</sequential>
</macrodef>
<macrodef name="logback">
<attribute name="webapp"/>
<sequential>
<!-- copy the logback config per webapp and associated jars -->
<copy todir="${webapps.build.dir}/@{webapp}/WEB-INF/classes" file="webapps/@{webapp}/WEB-INF/src/logback.xml" overwrite="true"/>
<copy todir="${webapps.build.dir}/@{webapp}/WEB-INF/lib">
<fileset dir="${lib.dir}">
<include name="slf4j-api-1.4.3.jar"/>
<include name="logback-core-0.9.8.jar"/>
<include name="logback-classic-0.9.8.jar"/>
</fileset>
</copy>
</sequential>
</macrodef>
<!-- Demos -->
<target name="compile_demos" description="Build demo apps">
<echo message="Webapps dir: ${webapps.dir}"/>
<echo message="Webapps build dir: ${webapps.build.dir}"/>
<!-- load token replacement filters -->
<filter filtersfile="${filter.file}"/>
<copy todir="${webapps.build.dir}/root" filtering="true">
<fileset dir="webapps/root">
<exclude name="**/src/**"/>
<exclude name="**/*.swf"/>
</fileset>
</copy>
<!-- copy SWF without filtering as it causes corruption -->
<copy todir="${webapps.build.dir}/root">
<fileset dir="webapps/root">
<include name="**/*.swf"/>
</fileset>
</copy>
<!-- build demos -->
<build-demo name="admin">
<copy-assets>
<logback webapp="admin"/>
<!-- copy assets -->
<copy todir="${webapps.build.dir}/admin/assets">
<fileset dir="swf/DEV_Deploy/assets"/>
<fileset file="swf/DEV_Deploy/adminPanel.swf"/>
</copy>
<!-- copy libs -->
<copy todir="${webapps.build.dir}/admin/WEB-INF/lib">
<fileset dir="${lib.dir}">
<include name="standard-*.jar"/>
<include name="spring-web-*.jar"/>
<include name="spring-webmvc-*.jar"/>
</fileset>
</copy>
</copy-assets>
</build-demo>
<build-demo name="astmeetme">
<copy-assets>
<logback webapp="astmeetme"/>
</copy-assets>
</build-demo>
<build-demo name="bwcheck">
<copy-assets>
<logback webapp="bwcheck"/>
</copy-assets>
</build-demo>
<build-demo name="conference">
<copy-assets>
<logback webapp="conference"/>
</copy-assets>
</build-demo>
<build-demo name="echo">
<copy-assets>
<logback webapp="echo"/>
</copy-assets>
</build-demo>
<build-demo name="fitcDemo">
<copy-assets>
<logback webapp="fitcDemo"/>
</copy-assets>
</build-demo>
<build-demo name="chatServer">
<copy-assets>
<logback webapp="chatServer"/>
</copy-assets>
</build-demo>
<build-demo name="appshare">
<copy-assets>
<logback webapp="appshare"/>
</copy-assets>
</build-demo>
<build-demo name="midiDemo">
<copy-assets>
<logback webapp="midiDemo"/>
</copy-assets>
</build-demo>
<build-demo name="presentation">
<copy-assets>
<logback webapp="presentation"/>
</copy-assets>
</build-demo>
<build-demo name="oflaDemo">
<copy-assets>
<logback webapp="oflaDemo"/>
<!-- copy FLV files without filtering as it causes corruption -->
<copy todir="${webapps.build.dir}/oflaDemo/">
<fileset dir="webapps/oflaDemo/">
<include name="**/*.flv"/>
</fileset>
</copy>
<!-- copy javascript/python/ruby source for oflaDemo -->
<mkdir dir="${webapps.build.dir}/oflaDemo/WEB-INF/classes/applications"/>
<copy todir="${webapps.build.dir}/oflaDemo/WEB-INF/classes/applications">
<fileset dir="${webapps.dir}/oflaDemo/WEB-INF/src/applications"/>
</copy>
</copy-assets>
</build-demo>
<build-demo name="tutorial">
<copy-assets>
<logback webapp="tutorial"/>
</copy-assets>
</build-demo>
<build-demo name="test"/>
<!-- no Java source for the messageRecorder and SOSample app -->
<copy todir="${webapps.build.dir}/messageRecorder" filtering="true">
<fileset dir="webapps/messageRecorder"/>
</copy>
<copy todir="${webapps.build.dir}/SOSample" filtering="true">
<fileset dir="webapps/SOSample"/>
</copy>
</target>
<!-- Scripting -->
<target name="compile_script" depends="prepare">
<available property="scripting_compatibility" classpathref="project.classpath" classname="javax.script.ScriptEngineManager"/>
<condition property="scripting.using" value="Scripting compatibility is available."
else="No compatibility for scripting available">
<istrue value="${scripting_compatibility}"/>
</condition>
<javac sourcepath="" srcdir="${src.dir}" destdir="${dest.dir}" classpathref="script.classpath"
optimize="${build.optimize}" verbose="${build.verbose}" fork="${build.fork}" nowarn="${build.nowarn}"
deprecation="${build.deprecation}" debug="${debug.state}" compiler="${compiler}"
source="${java.target_version}" target="${java.target_version}" memoryMaximumSize="${memory.maximum}"
includes="org/red5/server/script/**" listfiles="false"/>
<echo message="${scripting.using}"/>
</target>
<target name="compile_war" depends="-library.check, -java6.check, clean, prepare">
<!-- token replacement filers -->
<property name="filter.file" value="conf/war/build_war.properties"/>
<condition property="java.target_version" value="1.6">
<not>
<isset property="java.target_version"/>
</not>
</condition>
<echo message="javac version: ${java.target_version}"/>
<condition property="compiler" value="${build.compiler}${java.target_version}">
<equals arg1="${build.compiler}" arg2="javac"/>
</condition>
<property name="compiler" value="${build.compiler}"/>
<echo message="Compiler adapter name: ${compiler}"/>
<mkdir dir="${classes.dir}/WEB-INF/classes"/>
<property name="dest.dir" value="${classes.dir}/WEB-INF/classes"/>
<property name="std_excludes" value="**/*.jsp,org/red5/server/script/**,org/red5/server/jetty/**,org/red5/server/tomcat/**,org/red5/server/midi/**,org/red5/server/net/rtmpt/*Loader.java,org/red5/server/net/servlet/RTMPTServlet.java,org/red5/server/net/servlet/StatisticsServlet.java,org/red5/server/net/servlet/ZAMFGatewayServlet.java,org/red5/server/ContextLoader.java,org/red5/server/DebugPooledByteBufferAllocator.java,org/red5/server/Standalone.java"/>
<antcall target="compile_core" inheritAll="true" inheritRefs="true"/>
<antcall target="compile_core_compatibility" inheritAll="true" inheritRefs="true"/>
<!-- libraries and classes needed for building the demos -->
<path id="webapps.classpath">
<fileset dir="${lib.dir}">
<filename name="*.jar"/>
</fileset>
<pathelement location="${dest.dir}"/>
</path>
<antcall target="compile_demos" inheritAll="true" inheritRefs="true"/>
<!-- only certain classes from selected demos are copied to the war -->
<copy todir="${classes.dir}/WEB-INF/classes">
<fileset dir="${webapps.build.dir}/admin/WEB-INF/classes"/>
<fileset dir="${webapps.build.dir}/bwcheck/WEB-INF/classes"/>
<fileset dir="${webapps.build.dir}/echo/WEB-INF/classes"/>
<fileset dir="${webapps.build.dir}/fitcDemo/WEB-INF/classes"/>
<fileset dir="${webapps.build.dir}/chatServer/WEB-INF/classes"/>
<fileset dir="${webapps.build.dir}/appshare/WEB-INF/classes"/>
<fileset dir="${webapps.build.dir}/oflaDemo/WEB-INF/classes"/>
<fileset dir="${webapps.build.dir}/tutorial/WEB-INF/classes"/>
</copy>
<antcall target="compile_script" inheritAll="true" inheritRefs="true">
<param name="dest.dir" value="${classes.dir}/WEB-INF/classes"/>
</antcall>
</target>
<macrodef name="compile-wardemo">
<attribute name="name"/>
<sequential>
<war destfile="${dist.dir}/@{name}.war" webxml="${webapps.build.dir}/@{name}/WEB-INF/web.xml">
<fileset dir="${webapps.build.dir}/@{name}">
<exclude name="WEB-INF"/>
<exclude name="**/src/**"/>
</fileset>
<manifest>
<attribute name="Built-By" value="${red5.fullname}"/>
<attribute name="Built-On" value="${build.TODAY}"/>
</manifest>
</war>
</sequential>
</macrodef>
<target name="war_demos" description="Build wars for demo apps" depends="compile_demos">
<!-- war up root -->
<war destfile="${dist.dir}/ROOT.war" webxml="${webapps.build.dir}/root/WEB-INF/web.xml">
<fileset dir="${webapps.build.dir}/root"/>
<manifest>
<attribute name="Built-By" value="${red5.fullname}"/>
<attribute name="Built-On" value="${build.TODAY}"/>
</manifest>
</war>
<!-- war up demos -->
<compile-wardemo name="admin"/>
<compile-wardemo name="bwcheck"/>
<compile-wardemo name="fitcDemo"/>
<compile-wardemo name="chatServer"/>
<compile-wardemo name="appshare"/>
<compile-wardemo name="echo"/>
<compile-wardemo name="oflaDemo"/>
<compile-wardemo name="SOSample"/>
<compile-wardemo name="tutorial"/>
<compile-wardemo name="test"/>
<compile-wardemo name="messageRecorder"/>
</target>
<target name="javadoc" description="Generate JavaDoc">
<condition property="available.envpath" value="Path: ${env.Path}"
else="Not using env.Path">
<isset property="env.Path"/>
</condition>
<echo message="${available.envpath}"/>
<!-- Determine the location of Sun's API docs -->
<condition property="javadoc.loc" value="javase/6">
<equals arg1="${java6.installed}" arg2="true"/>
</condition>
<condition property="javadoc.loc" value="j2se/1.5.0">
<not>
<equals arg1="${java6.installed}" arg2="true"/>
</not>
</condition>
<echo message="Javadoc API stub: ${javadoc.loc}"/>
<javadoc useexternalfile="true" failonerror="false" verbose="false" classpathref="full.classpath"
destdir="${javadoc.dir}" author="true" version="true" use="true" splitindex="true"
windowtitle="${documentation.title}">
<fileset dir="${src.dir}" defaultexcludes="yes">
<include name="org/red5/**"/>
<exclude name="**/*.xml"/>
<exclude name="**/*.xsd"/>
</fileset>
<doctitle><![CDATA[<h1>${documentation.title}</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright &#169; ${red5.age} <a href="${red5.url}" target="_blank">${red5.name}</a></i>]]></bottom>
<tag name="todo" scope="all" description="To do:"/>
<group title="Public API" packages="org.red5.server.api:org.red5.server.api.*"/>
<group title="Network Protocols" packages="org.red5.server.net:org.red5.server.net.*"/>
<group title="Streaming" packages="org.red5.server.stream:org.red5.server.stream.*"/>
<group title="IO Packages" packages="org.red5.io:org.red5.io.*"/>
<group title="Scripting" packages="org.red5.server.script:org.red5.server.script.*"/>
<link href="http://java.sun.com/${javadoc.loc}/docs/api"/>
<link href="http://jetty.mortbay.org/apidocs"/>
<link href="http://mina.apache.org/report/1.1/apidocs"/>
<link href="http://static.springframework.org/spring/docs/2.0.x/api"/>
<link href="http://www.opensymphony.com/quartz/api"/>
<link href="http://www.slf4j.org/api"/>
<link href="http://logging.apache.org/log4j/1.2/apidocs"/>
<link href="http://www.beanshell.org/javadoc"/>
<link href="http://groovy.codehaus.org/api"/>
<link href="http://tomcat.apache.org/tomcat-6.0-doc/api"/>
<link href="http://ehcache.sourceforge.net/javadoc"/>
<link href="https://whirlycache.dev.java.net/nonav/api"/>
</javadoc>
</target>
<macrodef name="compile-jardemo">
<attribute name="name"/>
<element name="copy-assets" optional="yes"/>
<sequential>
<jar destfile="${webapps.build.dir}/@{name}/WEB-INF/lib/@{name}.jar">
<fileset dir="${webapps.build.dir}/@{name}/WEB-INF/classes">
<include name="**"/>
</fileset>
</jar>
<!-- copy files (optional) -->
<copy-assets/>
</sequential>
</macrodef>
<target name="jar" description="Make Archive" depends="compile">
<mkdir dir="${classes.dir}/conf"/>
<copy todir="${classes.dir}/conf">
<fileset dir="${config.dir}">
<exclude name="**/war/**"/>
<exclude name="**/jboss/**"/>
</fileset>
</copy>
<manifestclasspath property="jar.classpath" jarfile="${red5.filename}.jar">
<classpath refid="runtime.classpath"/>
</manifestclasspath>
<jar destfile="${red5.filename}.jar">
<fileset dir="${classes.dir}">
<include name="**"/>
<exclude name="testcases/**"/>
</fileset>
<manifest>
<attribute name="Built-By" value="${red5.fullname}"/>
<attribute name="Built-On" value="${build.TODAY}"/>
<attribute name="Main-Class" value="org.red5.server.Standalone"/>
<attribute name="Class-Path" value="conf/ ${jar.classpath}"/>
</manifest>
<metainf dir="${src.dir}/META-INF">
<include name="**"/>
</metainf>
</jar>
<!-- create jar files for demos -->
<compile-jardemo name="astmeetme"/>
<compile-jardemo name="bwcheck"/>
<compile-jardemo name="conference"/>
<compile-jardemo name="echo"/>
<compile-jardemo name="fitcDemo"/>
<compile-jardemo name="chatServer"/>
<compile-jardemo name="appshare"/>
<compile-jardemo name="midiDemo"/>
<compile-jardemo name="oflaDemo">
<copy-assets>
<!-- copy scripts -->
<mkdir dir="${webapps.build.dir}/oflaDemo/WEB-INF/classes/applications"/>
<copy todir="${webapps.build.dir}/oflaDemo/WEB-INF/classes/applications">
<fileset dir="webapps/oflaDemo/WEB-INF/src/applications"/>
</copy>
</copy-assets>
</compile-jardemo>
<compile-jardemo name="presentation"/>
<compile-jardemo name="test"/>
<compile-jardemo name="tutorial"/>
<!-- exclude logback.xml for admin -->
<jar destfile="${webapps.build.dir}/admin/WEB-INF/lib/admin.jar">
<fileset dir="${webapps.build.dir}/admin/WEB-INF/classes">
<include name="**"/>
<exclude name="logback.xml"/>
</fileset>
</jar>
</target>
<target name="dist" description="Make Binary distribution" depends="clean, jar">
<copy todir="${dist.dir}/lib">
<fileset dir="lib"/>
</copy>
<copy todir="${dist.dir}/conf">
<fileset dir="${config.dir}">
<!-- exclude war config files -->
<exclude name="**/war/**"/>
<exclude name="**/jboss/**"/>
</fileset>
</copy>
<copy todir="${dist.dir}/webapps" file="webapps\red5-default.xml"/>
<copy todir="${dist.dir}">
<fileset dir="./">
<include name="ivy.xml"/>
<include name="ivyconfig.xml"/>
<include name="${red5.filename}.jar"/>
<include name="red5.bat"/>
<include name="red5-shutdown.bat"/>
<include name="red5.sh"/>
<include name="red5-shutdown.sh"/>
<include name="license.txt"/>
</fileset>
</copy>
<chmod file="${dist.dir}/red5.sh" perm="755"/>
<chmod file="${dist.dir}/red5-shutdown.sh" perm="755"/>
</target>
<target name="dist-installer" description="Make Installer distribution" depends="ivyclear, dist, javadoc">
<copy todir="${dist.dir}/doc">
<fileset dir="doc"/>
</copy>
<copy todir="${dist.dir}">
<fileset dir="./">
<include name=".classpath"/>
<include name=".project"/>
<include name=".springBeans"/>
<include name="build.xml"/>
<include name="build.properties"/>
<include name="Makefile"/>
<include name="red5-debug.bat"/>
<include name="red5-debug.sh"/>
</fileset>
</copy>
<chmod file="${dist.dir}/red5-debug.sh" perm="755"/>
<!-- include war config files -->
<copy todir="${dist.dir}/conf">
<fileset dir="${config.dir}">
<include name="**/war/**"/>
<include name="**/jboss/**"/>
</fileset>
</copy>
<copy todir="${dist.dir}/src">
<fileset dir="src"/>
</copy>
<copy todir="${dist.dir}/swf">
<fileset dir="swf"/>
</copy>
<copy todir="${webapps.build.dir}">
<fileset dir="webapps">
<include name="**/src/**"/>
</fileset>
</copy>
</target>
<target name="dist-archive" depends="dist-installer" description="Create archive file for distribution">
<touch>
<fileset dir="${dist.dir}"/>
</touch>
<tar destfile="${red5.archive}" basedir="${dist.dir}" compression="gzip"
longfile="gnu">
<tarfileset dir="${dist.dir}" mode="755">
<include name="${dist.dir}/red5.sh"/>
<include name="${dist.dir}/red5-shutdown.sh"/>
<include name="${dist.dir}/red5-debug.sh"/>
</tarfileset>
<tarfileset dir="${dist.dir}">
<include name="${dist.dir}/**"/>
<exclude name="${dist.dir}/*.sh"/>
</tarfileset>
</tar>
</target>
<target name="dist-edge" depends="dist-origin">
<!-- Copies edge build and then puts config into place. -->
<copy todir="${edgedist.dir}/">
<fileset dir="${dist.dir}">
<exclude name="**/build.properties"/>
<exclude name="**/build.xml"/>
<exclude name="**/Makefile"/>
<exclude name="**/doc/**"/>
<exclude name="**/conf/red5-origin.xml"/>
<exclude name="**/conf/red5-origin-core.xml"/>
<exclude name="**/conf/red5.xml"/>
<exclude name="**/docs/**"/>
<exclude name="**/dumps/**"/>
<exclude name="**/src/**"/>
<exclude name="**/swf/**"/>
<exclude name="**/webapps/**"/>
</fileset>
</copy>
<move tofile="${edgedist.dir}/conf/red5.xml" file="${edgedist.dir}/conf/red5-edge.xml" overwrite="true"/>
</target>
<target name="dist-origin" depends="dist-installer">
<!-- Copies dist build and then puts config into place. -->
<copy todir="${origindist.dir}/">
<fileset dir="${dist.dir}">
<exclude name="**/conf/red5.xml"/>
</fileset>
</copy>
<move tofile="${origindist.dir}/conf/red5.xml" file="${dist.dir}/conf/red5-origin.xml" overwrite="true"/>
</target>
<target name="dist-cluster" description="Create Edge/Origin distribution" depends="dist-edge">
<copy tofile="${cluster.dir}/Readme.txt" file="${dist.dir}/doc/HOWTO-Clustering.txt" overwrite="true"/>
<echo>Edge configured in: ${edgedist.dir}</echo>
<echo>Origin configured in: ${origindist.dir}</echo>
</target>
<target name="dist-macosx" description="Create Mac OSX installer">
<ant antfile="install/macosx/build.xml" inheritAll="false"/>
</target>
<target name="dist-windows" description="Create Windows installer">
<ant antfile="install/windows/build.xml" inheritAll="false"/>
</target>
<target name="dist-debian" description="Create Debian package" depends="dist-installer">
<!-- 1. update "debian/changelog" and add an entry for the new version you are
building. Note that the syntax must match the previous entries!
2. Update the filename in "debian/files" to match the version you are
building.
3. Run this task from the Red5 root -->
<mkdir name="${dist.dir}/debian"/>
<!-- Copies debian files to dist -->
<copy todir="${dist.dir}/debian/">
<fileset dir="${basedir}/install/debian"/>
</copy>
<exec executable="dpkg-buildpackage" dir="${dist.dir}" failonerror="true">
<arg line="-uc -b -rfakeroot"/>
</exec>
</target>
<target name="dist-redhat" description="Create Redhat installer" depends="dist-installer">
<exec executable="rpm" failonerror="true">
<arg line="-ba install/redhat/red5.spec"/>
</exec>
</target>
<target name="server" depends="compile" description="Compile and start the server">
<mkdir dir="${dist.dir}/conf"/>
<copy todir="${dist.dir}/conf">
<fileset dir="${config.dir}">
<exclude name="**/war/**"/>
<exclude name="**/jboss/**"/>
</fileset>
</copy>
<mkdir dir="${dist.dir}/${log.dir}"/>
<copy todir="${dist.dir}/webapps" file="webapps\red5-default.xml"/>
<java classname="org.red5.server.Standalone" fork="true">
<classpath>
<pathelement location="${dist.dir}/conf"/>
<pathelement location="${classes.dir}"/>
<path refid="full.classpath"/>
</classpath>
<jvmarg value="-Djava.security.manager"/>
<jvmarg value="-Djava.security.policy=${dist.dir}/conf/red5.policy"/>
<jvmarg value="-Dred5.root=${dist.dir}"/>
<!-- enable the following 2 lines if your using JMX with SSL -->
<!--
<jvmarg value="-Djavax.net.ssl.keyStore=${config.dir}/keystore.jmx"/>
<jvmarg value="-Djavax.net.ssl.keyStorePassword=password"/>
-->
</java>
</target>
<target name="shutdown">
<java classname="org.red5.server.Shutdown" fork="true">
<classpath>
<pathelement location="${dist.dir}/conf"/>
<pathelement location="${classes.dir}"/>
<path refid="full.classpath"/>
</classpath>
<jvmarg value="-Djava.security.manager"/>
<jvmarg value="-Djava.security.policy=${dist.dir}/conf/red5.policy"/>
<jvmarg value="-Dred5.root=${dist.dir}"/>
<!-- enable the following 2 lines if your using JMX with SSL and auth -->
<!--
<jvmarg value="-Djavax.net.ssl.trustStore=${config.dir}/truststore.jmx"/>
<jvmarg value="-Djavax.net.ssl.trustStorePassword=trustword"/>
-->
<arg value="9999"/>
<arg value="red5user"/>
<arg value="changeme"/>
</java>
</target>
<target name="udp_server" depends="compile" description="Compile and start experimental UDP server">
<java classname="org.red5.server.net.udp.Standalone" fork="true">
<classpath>
<pathelement location="${config.dir}"/>
<pathelement location="${classes.dir}"/>
<path refid="full.classpath"/>
</classpath>
<jvmarg value="-Djava.security.manager"/>
<jvmarg value="-Djava.security.policy=${config.dir}/red5.policy"/>
</java>
</target>
<target name="run-tests" depends="compile_tests" description="Run JUnit tests and generate HTML reports">
<junit fork="true" haltonfailure="no" printsummary="no" showoutput="no" dir="${testreports.dir}">
<classpath>
<path refid="full.classpath"/>
<pathelement location="${testclass.dir}"/>
</classpath>
<formatter type="xml"/>
<batchtest todir="${testreports.dir}">
<fileset dir="${testclass.dir}">
<include name="**/*Test.class"/>
<exclude name="**/Abstract*Test.class"/>
<exclude name="**/*AbstractTest.class"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${test.dir}">
<fileset dir="${testreports.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${testdoc.dir}"/>
</junitreport>
</target>
<target name="compile_tests" description="Compiles junit test classes">
<echo>Libraries checked: ${library.installed}</echo>
<antcall target="retrieve" inheritAll="true" inheritRefs="true">
<param name="ivy.conf.name" value="test"/>
</antcall>
<available property="junit.installed" classname="junit.framework.TestCase"/>
<javac srcdir="${test.dir}" destdir="${testclass.dir}">
<classpath>
<path refid="full.classpath"/>
</classpath>
<include name="**/*.java"/>
</javac>
</target>
<target name="webwar" description="Make Web Archive" depends="compile_war">
<!-- token replacement filers -->
<filter filtersfile="${config.dir}/war/build_war.properties"/>
<copy todir="${classes.dir}">
<fileset dir=".">
<include name="license.txt"/>
</fileset>
</copy>
<!-- remove directories we dont want -->
<delete dir="${classes.dir}/testcases"/>
<!-- cleanup "standalone" red5-web files -->
<delete>
<fileset dir="${webapps.build.dir}" includes="**/red5-web.*"/>
</delete>
<!-- add the configs to the root war -->
<filter token="display.name" value=""/>
<filter token="webapp.root.key" value="/"/>
<filter token="context.path" value="/"/>
<copy tofile="${webapps.build.dir}/root/META-INF/context.xml" overwrite="true" filtering="true"
file="${config.dir}/war/root-context.xml"/>
<copy todir="${webapps.build.dir}/root/WEB-INF" overwrite="true" filtering="true">
<fileset dir="${config.dir}/war">
<include name="web.xml"/>
</fileset>
</copy>
<copy todir="${webapps.build.dir}/root/WEB-INF/classes" overwrite="true" filtering="true">
<fileset dir="${config.dir}">
<include name="*.jmx"/>
<include name="access.properties"/>
<include name="password.properties"/>
</fileset>
<fileset dir="${config.dir}/war">
<include name="logback.xml"/>
<include name="beanRefContext.xml"/>
<include name="defaultContext.xml"/>
<include name="red5-common.xml"/>
<include name="red5-core.xml"/>
<include name="*-web.xml"/>
</fileset>
</copy>
<!-- copy the demo streams -->
<copy todir="${webapps.build.dir}/root">
<fileset dir="${webapps.build.dir}/oflaDemo">
<include name="streams/*.flv"/>
<exclude name="**/logback.xml"/>
</fileset>
</copy>
<!-- war up root -->
<war destfile="${dist.dir}/ROOT.war" webxml="${webapps.build.dir}/root/WEB-INF/web.xml">
<fileset dir="${webapps.build.dir}/root"/>
<fileset dir="${classes.dir}">
<exclude name="**/logback.xml"/>
</fileset>
<lib dir="${lib.dir}">
<exclude name="*.properties"/>
<exclude name="jsp*.jar"/>
<exclude name="servlet*.jar"/>
<exclude name="catalina*.jar"/>
<exclude name="tomcat*.jar"/>
<exclude name="annotations-api*.jar"/>
<exclude name="el-api*.jar"/>
<exclude name="jetty*.jar"/>
<exclude name="jasper*.jar"/>
<exclude name="ehcache*.jar"/>
<exclude name="whirly*.jar"/>
<exclude name="Grobo*.jar"/>
<exclude name="grobo*.jar"/>
<exclude name="junit*.jar"/>
<exclude name="ivy*.jar"/>
</lib>
<manifest>
<attribute name="Built-By" value="${red5.fullname}"/>
<attribute name="Built-On" value="${build.TODAY}"/>
</manifest>
</war>
<!-- Demo applications (Admin and Echo use AMF and therefore need wars) -->
<filter token="context.path" value="/admin"/>
<copy tofile="${webapps.build.dir}/admin/META-INF/context.xml" overwrite="true" filtering="true"
file="${config.dir}/war/context.xml"/>
<copy todir="${webapps.build.dir}/admin/WEB-INF" overwrite="true" verbose="true">
<fileset dir="${config.dir}/war/admin">
<include name="web.xml"/>
</fileset>
</copy>
<war destfile="${dist.dir}/admin.war" webxml="${webapps.build.dir}/admin/WEB-INF/web.xml">
<fileset dir="${webapps.build.dir}/admin"/>
<fileset dir="${classes.dir}">
<include name="**/AMFTunnelServlet.class"/>
<include name="**/ServletUtils.class"/>
</fileset>
<lib dir="${lib.dir}">
<include name="commons-codec-*.jar"/>
<include name="commons-httpclient-*.jar"/>
<include name="*-over-slf4j-*.jar"/>
<include name="mina-core-*.jar"/>
<exclude name="slf4j-*.jar"/>
<exclude name="logback-*.jar"/>
</lib>
<manifest>
<attribute name="Built-By" value="${red5.fullname}"/>
<attribute name="Built-On" value="${build.TODAY}"/>
</manifest>
</war>
<filter token="context.path" value="/echo"/>
<copy tofile="${webapps.build.dir}/echo/META-INF/context.xml" overwrite="true" filtering="true"
file="${config.dir}/war/context.xml"/>
<copy todir="${webapps.build.dir}/echo/WEB-INF" overwrite="true" verbose="true">
<fileset dir="${config.dir}/war/echo">
<include name="web.xml"/>
</fileset>
</copy>
<war destfile="${dist.dir}/echo.war" webxml="${webapps.build.dir}/echo/WEB-INF/web.xml">
<fileset dir="${webapps.build.dir}/echo"/>
<fileset dir="${classes.dir}">
<include name="**/AMFTunnelServlet.class"/>
<include name="**/ServletUtils.class"/>
</fileset>
<lib dir="${lib.dir}">
<include name="commons-codec-*.jar"/>
<include name="commons-httpclient-*.jar"/>
<include name="*-over-slf4j-*.jar"/>
<include name="mina-core-*.jar"/>
<exclude name="slf4j-*.jar"/>
<exclude name="logback-*.jar"/>
</lib>
<manifest>
<attribute name="Built-By" value="${red5.fullname}"/>
<attribute name="Built-On" value="${build.TODAY}"/>
</manifest>
</war>
<!-- cleanup -->
<delete dir="${dist.dir}/webapps"/>
</target>
<target name="remotejar" description="Creates a jar that may be deployed with remote applications" depends="compile">
<mkdir dir="${classes.dir}/conf"/>
<copy todir="${classes.dir}/conf">
<fileset dir="${config.dir}">
<exclude name="**/war/**"/>
<exclude name="**/jboss/**"/>
</fileset>
</copy>
<jar destfile="${dist.dir}/red5-remoting.jar">
<fileset dir="${classes.dir}">
<include name="**/AMFTunnelServlet.class"/>
<include name="**/ServletUtils.class"/>
</fileset>
<manifest>
<attribute name="Built-By" value="${red5.fullname}"/>
<attribute name="Built-On" value="${build.TODAY}"/>
</manifest>
</jar>
</target>
<target name="all" depends="clean, prepare, compile, jar, javadoc" description="Run all server tasks"/>
<target name="usage">
<echo message="Type ant -p for available targets"/>
</target>
</project>