Skip to content
Permalink
Browse files
Fix sample a bit - clean up readme and use environment variable to av…
…oid editing build.xml
  • Loading branch information
Glen Daniels committed Aug 20, 2008
1 parent 5fdea3c commit 86d903e6dd8146406efc50e872b802480e915d02
Showing 2 changed files with 141 additions and 126 deletions.
@@ -1,103 +1,115 @@
<project default="build.sample">
<property name="axis2.home" value="c:/temp/axis2-1.4"/>

<target name="build.sample">
<property name="axis2.home" value="/mnt/win_d/projects/axis/Axis2-1.3/axis2-1.3"/>
<property name="eventing.temp.dir" value="build/temp"/>
<property name="listener1.temp.dir" value="${eventing.temp.dir}/listener1"/>
<property name="listener2.temp.dir" value="${eventing.temp.dir}/listener2"/>
<property name="publisher.temp.dir" value="${eventing.temp.dir}/publisher"/>


<mkdir dir="${listener1.temp.dir}"/>
<mkdir dir="${listener1.temp.dir}/META-INF"/>
<mkdir dir="${listener2.temp.dir}"/>
<mkdir dir="${listener2.temp.dir}/META-INF"/>
<mkdir dir="${publisher.temp.dir}"/>
<mkdir dir="${publisher.temp.dir}/META-INF"/>

<mkdir dir="build/classes"/>
<mkdir dir="build/lib"/>

<javac srcdir="src" destdir="build/classes">
<classpath>
<fileset dir="../../core/target">
<include name="*.jar"/>
</fileset>
<fileset dir="${axis2.home}/lib">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>

<copy toFile="${listener1.temp.dir}/META-INF/services.xml" file="listener1.services.xml"/>
<copy toFile="${listener2.temp.dir}/META-INF/services.xml" file="listener2.services.xml"/>
<copy toFile="${publisher.temp.dir}/META-INF/services.xml" file="publisher.services.xml"/>

<jar destfile="build/ListenerService1.aar">
<fileset dir="build/classes">
<include name="sample/eventing/**/**/*ListenerService1*"/>
</fileset>
<fileset dir="${listener1.temp.dir}">
<include name="META-INF/**"/>
</fileset>
</jar>

<jar destfile="build/ListenerService2.aar">
<fileset dir="build/classes">
<include name="sample/eventing/**/**/*ListenerService2*"/>
</fileset>
<fileset dir="${listener2.temp.dir}">
<include name="META-INF/**"/>
</fileset>
</jar>

<jar destfile="build/PublisherService.aar">
<fileset dir="build/classes">
<include name="sample/eventing/**/**/*PublisherService*"/>
</fileset>
<fileset dir="${publisher.temp.dir}">
<include name="META-INF/**"/>
</fileset>
</jar>

<jar destfile="build/ListenerService1.aar">
<fileset dir="build/classes">
<include name="sample/eventing/**/**/*ListenerService1*"/>
</fileset>
<fileset dir="${listener1.temp.dir}">
<include name="META-INF/**"/>
</fileset>
</jar>

<jar destfile="build/EventingSample.jar">
<fileset dir="build/classes">
<include name="sample/eventing/**"/>
</fileset>
</jar>

<copy todir="build">
<fileset dir=".">
<include name="*.sh"/>
<include name="*.bat"/>
</fileset>
</copy>
</target>

<target name="clean">
<delete dir="build"/>
</target>

<target name="deploy">
<!-- deploy savan module to axis2 -->
<copy todir="${axis2.home}/repository/modules">
<fileset dir="../../mar/target" includes="savan-*.mar"/>
</copy>

<!-- deploy samples -->
<copy todir="${axis2.home}/repository/services">
<fileset dir="build" includes="*.aar"/>
</copy>
</target>

</project>
<project default="build.sample">
<property environment="env"/>
<fail message="You must set the AXIS2_HOME environment variable to a valid Axis2 installation.">
<condition>
<not>
<isset property="env.AXIS2_HOME"/>
</not>
</condition>
</fail>
<echo message="${env.AXIS2_HOME}"/>

<target name="build.sample">
<property name="eventing.temp.dir" value="build/temp"/>
<property name="listener1.temp.dir" value="${eventing.temp.dir}/listener1"/>
<property name="listener2.temp.dir" value="${eventing.temp.dir}/listener2"/>
<property name="publisher.temp.dir" value="${eventing.temp.dir}/publisher"/>


<mkdir dir="${listener1.temp.dir}"/>
<mkdir dir="${listener1.temp.dir}/META-INF"/>
<mkdir dir="${listener2.temp.dir}"/>
<mkdir dir="${listener2.temp.dir}/META-INF"/>
<mkdir dir="${publisher.temp.dir}"/>
<mkdir dir="${publisher.temp.dir}/META-INF"/>

<mkdir dir="build/classes"/>
<mkdir dir="build/lib"/>

<javac srcdir="src" destdir="build/classes">
<classpath>
<fileset dir="../../core/target">
<include name="*.jar"/>
</fileset>
<fileset dir="${env.AXIS2_HOME}/lib">
<include name="*.jar"/>
</fileset>
</classpath>
</javac>

<copy toFile="${listener1.temp.dir}/META-INF/services.xml" file="listener1.services.xml"/>
<copy toFile="${listener2.temp.dir}/META-INF/services.xml" file="listener2.services.xml"/>
<copy toFile="${publisher.temp.dir}/META-INF/services.xml" file="publisher.services.xml"/>

<jar destfile="build/ListenerService1.aar">
<fileset dir="build/classes">
<include name="sample/eventing/**/**/*ListenerService1*"/>
</fileset>
<fileset dir="${listener1.temp.dir}">
<include name="META-INF/**"/>
</fileset>
</jar>

<jar destfile="build/ListenerService2.aar">
<fileset dir="build/classes">
<include name="sample/eventing/**/**/*ListenerService2*"/>
</fileset>
<fileset dir="${listener2.temp.dir}">
<include name="META-INF/**"/>
</fileset>
</jar>

<jar destfile="build/PublisherService.aar">
<fileset dir="build/classes">
<include name="sample/eventing/**/**/*PublisherService*"/>
</fileset>
<fileset dir="${publisher.temp.dir}">
<include name="META-INF/**"/>
</fileset>
</jar>

<jar destfile="build/ListenerService1.aar">
<fileset dir="build/classes">
<include name="sample/eventing/**/**/*ListenerService1*"/>
</fileset>
<fileset dir="${listener1.temp.dir}">
<include name="META-INF/**"/>
</fileset>
</jar>

<jar destfile="build/EventingSample.jar">
<fileset dir="build/classes">
<include name="sample/eventing/**"/>
</fileset>
</jar>

<copy todir="build">
<fileset dir=".">
<include name="*.sh"/>
<include name="*.bat"/>
</fileset>
</copy>
</target>

<target name="clean">
<delete dir="build"/>
</target>

<target name="deploy">
<!-- deploy savan module to axis2 -->
<copy todir="${env.AXIS2_HOME}/repository/modules">
<fileset dir="../../mar/target" includes="savan-*.mar"/>
</copy>

<!-- copy core jar (used by the PublisherService) -->
<copy todir="${env.AXIS2_HOME}/lib">
<fileset dir="../../core/target" includes="savan-core-*.jar"/>
</copy>

<!-- deploy samples -->
<copy todir="${env.AXIS2_HOME}/repository/services">
<fileset dir="build" includes="*.aar"/>
</copy>
</target>

</project>
@@ -1,23 +1,26 @@
Steps to build and run the Savan-Eventing sample
------------------------------------------------

To build
--------
1. Open build.xml
2. Change value of 'axis2.home' property to a valid Axis2 home
3. Run 'ant' to build the sample.

To clean
--------
1. Run 'ant clean'

To deploy
---------
1. Run 'ant deploy'
(This will copy sample services to ${axis2.home}/repository/services & savan module into ${axis2.home}/repository/modules)

To run
------
1. Make sure addressing module is inside ${axis2.home}/repository/modules
2. Start Axis2 server.
3. Run the 'samples.eventing.Client' class, you can pass the repository with a '-r' parameter and the server port with a '-p' parameter.
Steps to build and run the Savan-Eventing sample
------------------------------------------------

First, you must set the AXIS2_HOME environment variable to point to a valid Axis2
installation (it should point to a directory which contains "repository/", "conf/",
etc.).

To build and deploy
-------------------

From this directory, run "ant deploy" to build the sample and automatically
copy the service archives, module archive, and supporting classes into your Axis2
installation.

Note that "ant" with no argument will simply build the sample, and "ant clean" will
remove the built artifacts and clean up.

To run
------

1. Make sure addressing module is inside $AXIS2_HOME/repository/modules
2. Start Axis2 server.
3. Run the 'samples.eventing.Client' class
(you can pass the repository with a '-r' parameter and the server
port with a '-p' parameter if you wish)

0 comments on commit 86d903e

Please sign in to comment.