Skip to content

Commit 2481e71

Browse files
committed
Add Gradle-based script for the command-line GameServerRunner.
1 parent 7ecd14d commit 2481e71

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

Diff for: PROGRAMS

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ Command-line player runner
2828
- Description: Runs the given gamer on the given port.
2929
- Note: A Windows script needs to be added for this.
3030

31+
Command-line server runner
32+
- Main class: org.ggp.base.apps.utilities.GameServerRunner
33+
- How to run: ./gameServerRunner <results directory> <game key> <start clock> <play clock> <player host 1> <player port 1> <player name 1> <player host 2> <player port 2> <player name 2> etc.
34+
- Example: ./gameServerRunner myTournament ticTacToe 60 15 127.0.0.1 9147 PlayerOne 127.0.0.1 9148 PlayerTwo
35+
- Description: Runs a match with the given game and player(s). Stores the
36+
results in a directory with the given name.
37+
3138
Clojure console
3239
- Main class: org.ggp.base.apps.consoles.ClojureConsole
3340
- How to run: ./gradlew -q clojureConsole

Diff for: build.gradle

+9
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,15 @@ task propNetAnnotater(type: JavaExec) {
142142
classpath = sourceSets.main.runtimeClasspath
143143
}
144144

145+
//See gameServerRunner.sh
146+
task gameServerRunner(type: JavaExec) {
147+
main = 'org.ggp.base.apps.utilities.GameServerRunner'
148+
classpath = sourceSets.main.runtimeClasspath
149+
doFirst {
150+
args = myargs.split().toList()
151+
}
152+
}
153+
145154
// This was used to generate the Gradle wrapper.
146155
task wrapper(type: Wrapper) {
147156
gradleVersion = '2.1'

Diff for: gameServerRunner.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
#This script allows the user to run the GameServerRunner app via Gradle.
3+
#Arguments: ./gameServerRunner <results directory> <game key> <start clock> <play clock> <player host 1> <player port 1> <player name 1> <player host 2> <player port 2> <player name 2> etc.
4+
#Sample usage: ./gameServerRunner myTournament ticTacToe 60 15 127.0.0.1 9147 PlayerOne 127.0.0.1 9148 PlayerTwo
5+
#For a GUI-based server, try: ./gradlew server
6+
7+
./gradlew gameServerRunner -Pmyargs="$*"

0 commit comments

Comments
 (0)