add unix support

This commit is contained in:
James Ward 2015-12-16 16:16:15 -07:00
parent 2f45ee7f4a
commit 95f271f43d
10 changed files with 49 additions and 17 deletions

View File

@ -1,4 +1,4 @@
<project>
<project xmlns:if="ant:if" xmlns:unless="ant:unless">
<property name="chapter" value="CHAPTER?"/>
<property name="antoutput" value="../Ant-output.txt"/>
@ -80,6 +80,27 @@
</sequential>
</macrodef>
<macrodef name="execscript">
<attribute name="name"/>
<sequential>
<condition property="isWindows">
<os family="windows"/>
</condition>
<sequential if:true="isWindows">
<echo message="@{name}.bat"/>
<exec executable="cmd" dir=".">
<arg line="/c @{name}.bat"/>
</exec>
</sequential>
<sequential unless:true="isWindows">
<echo message="@{name}.sh"/>
<exec executable="sh" dir=".">
<arg line="@{name}.sh"/>
</exec>
</sequential>
</sequential>
</macrodef>
<!--===========================================================-->
<target name="base"

3
network/ChatterServer.sh Normal file
View File

@ -0,0 +1,3 @@
java -cp ..:. ChatterServer &
sleep 1
java -cp ..:. ChatterClient

View File

@ -0,0 +1,3 @@
java -cp ..:. MultiSimpleServer &
sleep 1
java -cp ..:. MultiSimpleClient

3
network/SimpleServer.sh Normal file
View File

@ -0,0 +1,3 @@
java SimpleServer &
sleep 1
java SimpleClient

View File

@ -3,24 +3,16 @@
<project default="run">
<property name="chapter" value="network"/>
<property name="excludedfiles" value=""/>
<import file="../Ant-Common.xml"/>
<import file="../Ant-Clean.xml"/>
<target name="run" description="Compile and run" depends="build">
<jrun cls="LocalHost" />
<jrun cls="WhoAmI" />
<echo message="SimpleServer.bat"/>
<exec executable="cmd" dir=".">
<arg line="/c SimpleServer.bat" />
</exec>
<echo message="ChatterServer.bat"/>
<exec executable="cmd" dir=".">
<arg line="/c ChatterServer.bat" />
</exec>
<echo message="MultiSimpleServer.bat"/>
<exec executable="cmd" dir=".">
<arg line="/c MultiSimpleServer.bat" />
</exec>
<execscript name="SimpleServer"/>
<execscript name="ChatterServer"/>
<execscript name="MultiSimpleServer"/>
</target>
</project>

View File

@ -7,10 +7,7 @@
<import file="../Ant-Clean.xml"/>
<target name="run" description="Compile and run" depends="build">
<echo message="go"/>
<exec executable="cmd" dir=".">
<arg line="/c go" />
</exec>
<execscript name="go"/>
</target>
</project>

1
remote/go.sh Normal file
View File

@ -0,0 +1 @@
sh ptime.sh

6
remote/ptime.sh Normal file
View File

@ -0,0 +1,6 @@
sh registry.sh 3 &
sleep 1
sh server.sh 3 &
sleep 1
java DisplayPerfectTime
sleep 3

3
remote/registry.sh Normal file
View File

@ -0,0 +1,3 @@
rmiregistry &
sleep $1
killall rmiregistry

3
remote/server.sh Normal file
View File

@ -0,0 +1,3 @@
java PerfectTimeServer &
sleep $1
killall java