blob: 50dba729c856d6eca2fbdd40b25ac71a7acab8c4 [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one *
* or more contributor license agreements. See the NOTICE file *
* distributed with this work for additional information *
* regarding copyright ownership. The ASF licenses this file *
* to you under the Apache License, Version 2.0 (the *
* "License"); you may not use this file except in compliance *
* with the License. You may obtain a copy of the License at *
* *
* http://www.apache.org/licenses/LICENSE-2.0 *
* *
* Unless required by applicable law or agreed to in writing, *
* software distributed under the License is distributed on an *
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
* KIND, either express or implied. See the License for the *
* specific language governing permissions and limitations *
* under the License. *
-->
<project name="etch-perf-perf" basedir="." default="build">
<description>Perf Perf</description>
<property name="etch.home" location="${basedir}/../.."/>
<property name="etch.version" value="@EtchVersion@"/>
<property name="etch-java-runtime-name" value="etch-java-runtime-${etch.version}.jar"/>
<property name="etch-ant-plugin.jar" location="${etch.home}/lib/etch-ant-plugin-${etch.version}.jar"/>
<property name="etch-java-runtime.jar" location="${etch.home}/lib/${etch-java-runtime-name}"/>
<property name="etch.dll" location="${etch.home}/lib/Etch.dll"/>
<property name="src" location="${basedir}/src"/>
<property name="src-main-etch" location="${src}/main/etch"/>
<property name="src-main-java" location="${src}/main/java"/>
<property name="src-main-csharp" location="${src}/main/csharp"/>
<property name="target" location="${basedir}/target"/>
<property name="generated-sources" location="${target}/generated-sources"/>
<property name="gensrc-main-etch-java" location="${generated-sources}/main/etch/java"/>
<property name="gensrc-main-etch-csharp" location="${generated-sources}/main/etch/csharp"/>
<property name="classes" location="${target}/classes"/>
<property name="bin" location="${target}/bin"/>
<condition property="BUILD.csharp" >
<os family="windows" />
</condition>
<taskdef
resource="org/apache/etch/tools/ant/etch.xml"
classpath="${etch-ant-plugin.jar}"/>
<target name="build" depends="build-java, build-csharp, done"/>
<target name="build-java" depends="gensrc-java">
<javac destdir="${classes}" source="1.5" debug="true">
<classpath>
<pathelement location="${etch-java-runtime.jar}"/>
</classpath>
<src path="${src-main-java}"/>
<src path="${gensrc-main-etch-java}"/>
</javac>
<jar jarfile="${bin}/perf.jar">
<manifest>
<attribute name="Class-Path" value="${etch-java-runtime-name}"/>
</manifest>
<fileset dir="${classes}"/>
</jar>
<copy todir="${bin}" file="${etch-java-runtime.jar}"/>
</target>
<target name="done">
<echo>
To run java performance example, open a cmd window and run these
commands:
> cd target\bin
> start java -cp perf.jar etch.examples.perf.MainPerfListener
> start java -cp perf.jar etch.examples.perf.MainPerfClient
To run csharp example:
> cd target\bin
> start perfListener.exe
> start perfClient.exe
You can mix and match the various clients and listeners.
</echo>
</target>
<target name="build-csharp" depends="gensrc-csharp" if="BUILD.csharp" >
<csc
debug="true"
warnLevel="1"
unsafe="false"
targetType="exe"
incremental="false"
mainClass = "etch.examples.perf.MainPerfClient"
destFile="${bin}/perfClient.exe">
<src dir="${src-main-csharp}/perfClientProj" includes="**/*.cs"/>
<src dir="${src-main-csharp}/etch.examples.perf" includes="**/*.cs"/>
<src dir="${gensrc-main-etch-csharp}" includes="**/*.cs"/>
<reference file="${etch.dll}"/>
</csc>
<csc
debug="true"
warnLevel="1"
unsafe="false"
targetType="exe"
incremental="false"
mainClass = "etch.examples.perf.MainPerfListener"
destFile="${bin}/perfListener.exe">
<src dir="${src-main-csharp}/perfListenerProj" includes="**/*.cs"/>
<src dir="${src-main-csharp}/etch.examples.perf" includes="**/*.cs"/>
<src dir="${gensrc-main-etch-csharp}" includes="**/*.cs"/>
<reference file="${etch.dll}"/>
</csc>
<copy todir="${bin}" file="${etch.dll}"/>
</target>
<target name="gensrc" depends="gensrc-java, gensrc-csharp"/>
<target name="gensrc-java" depends="init">
<etch
home="${etch.home}"
binding="java"
quiet="true"
outputDir="${gensrc-main-etch-java}"
file="${src-main-etch}/Perf.etch"/>
</target>
<target name="gensrc-csharp" depends="init">
<etch
home="${etch.home}"
binding="csharp"
quiet="true"
outputDir="${gensrc-main-etch-csharp}"
file="${src-main-etch}/Perf.etch"/>
</target>
<target name="init">
<mkdir dir="${target}"/>
<mkdir dir="${generated-sources}"/>
<mkdir dir="${gensrc-main-etch-java}"/>
<mkdir dir="${gensrc-main-etch-csharp}"/>
<mkdir dir="${classes}"/>
<mkdir dir="${bin}"/>
</target>
<target name="clean">
<delete dir="${target}"/>
</target>
</project>