Hi,

In response to Louie Penaflor, I'll write this small howto, coz it wasn't
very clear for me too.

Each time you create your own application, you have to rebuild it for red5
and then restart red5 (ie ./red5.sh or red5.bat or ant server) red5 and your
changes would now be reflected ie you can connect to your application
(provided there were no errors during wiring process).
The build.xml was made using the red5 default build.xml

HOWTO

1. The red5 webapps structure is like this:
/red5_server/webapps/name-of-your-application/WEB-INF

2. Put the build.xml file in your WEB-INF folder

3. Ensure that your source packages are in the folder WEB-INF:
ie /red5_server/webapps/name-of-your-application/WEB-INF/src

So your application structure would be:
/red5_server/webapps/name-of-your-application/WEB-INF/src/name/of/your/package

4. Throw in the build.xml attached with this mail message into the WEB-INF
folder ie:
/red5_server/webapps/name-of-your-application/WEB-INF/[Drop it here]

5. Edit the target property at the top of your build.xml file:
<property name="target.jar" value="nameofyourapp.jar"/>

6. Everytime you want to build your application:
#ant build
or
#ant
to build your application

You may also wish to make a jar of your application, run:
#ant jar

Now restart red5 once your build is ok and off you go.

I haven't tested it on jdk1.6 but you probably just need to change the
following under the target build from:
compiler="javac1.6"
source="1.6"
target="1.6"

to
compiler="javac1.6"
source="1.6"
target="1.6"

Hope this helps.
<?xml version="1.0"?>
<project name="Red5 Webapps Compile" basedir="." default="build">
	
	<!-- project properties -->
	<property name="root.dir" value="../../../"/>
	<property name="src.dir" value="src"/>
	<property name="classes.dir" value="classes"/>
	<property name="lib.dir" value="lib"/>
	<property name="dist.dir" value="dist"/>
	<property name="target.jar" value="nameofyourapplication.jar"/>
	<property name="root.bin.dir" value="../../../bin"/>
	<property name="root.conf.dir" value="../../../conf"/>
		
	<!-- Put you the location of the spring and red5.jar here (depending on where the call to red5 #ant jar), put it. -->
	<path id="full.classpath">
		<fileset dir="${root.dir}/lib" includesfile="${root.dir}/lib/library.properties" />
	    <fileset dir="${root.dir}/lib" includesfile="${root.dir}/lib/script.properties" />
		<fileset dir="${root.dir}">
			<filename name="red5.jar"/>
		</fileset>
	</path>
		
	<target name="build">
		<javac
			sourcepath=""
			srcdir="${src.dir}"
			destdir="${classes.dir}"
			classpathref="full.classpath"
		    optimize="true" 
		    verbose="false" 
		    fork="true" 
		    nowarn="true"
		    deprecation="false"
		    debug="true"
		    compiler="javac1.5"
		    source="1.5"
		    target="1.5" 
		/>
	</target>
	
	<target name="prepare">
		<mkdir dir="${classes.dir}"/>
		<mkdir dir="${lib.dir}"/>
	</target>

	<target name="clean">
		<delete dir="${classes.dir}"/>
		<delete dir="${lib.dir}"/>
	</target>
		
	<target name="jar" description="Make Archive" depends="build">
	   	
		<tstamp prefix="build">
	    	<format property="TODAY" pattern="d-MMMM-yyyy" locale="en" />
		</tstamp>

		<!-- Load the library props files to generate a class-path for the jar -->
		<loadfile
		    property="library.jars"
		    srcFile="${root.dir}/lib/library.properties">
		    <filterchain>
			    <tokenfilter>
		    		<trim/>
			    	<ignoreblank/>
			    </tokenfilter>
			    <striplinecomments>
			    	<comment value="#"/>
			    </striplinecomments>
		        <prefixlines prefix=" lib/"/>
	            <striplinebreaks/>
		    </filterchain>
		</loadfile>

		<loadfile
			property="script.jars"
			srcFile="${root.dir}/lib/script.properties">
	        <filterchain>
		        <tokenfilter>
		        	<trim/>
                    <ignoreblank/>
                </tokenfilter>
                <striplinecomments>
                    <comment value="#"/>
                </striplinecomments>
                <prefixlines prefix=" lib/"/>
	                <striplinebreaks/>
            </filterchain>
        </loadfile>

		<echo message="Jar launch classpath: conf/${library.jars} ${script.jars}" />   
		
		<mkdir dir="${root.bin.dir}/conf"/>  
        <mkdir dir="${root.bin.dir}/conf"/>   
	    <copy todir="${root.bin.dir}/conf">
	        <fileset dir="${root.conf.dir}"/>
	    </copy>        
			        
		<jar destfile="${lib.dir}/${target.jar}">
			<fileset dir="${classes.dir}">
				<include name="**"/>
			</fileset>
		</jar>
		
	</target>
		
</project>
_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to