forked from bb4/bb4-games
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
231 lines (196 loc) · 8.08 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
// Copyright by Barry G. Becker, 2013. Licensed under MIT License: http://www.opensource.org/licenses/MIT
description = 'A game playing framework and a collection of two-player and multi-player games. ' +
'In all games, one or more intelligent computer opponents are allowed to play.'
group = 'com.barrybecker4'
version = '1.2-SNAPSHOT'
apply from: 'https://raw.github.com/barrybecker4/bb4-common/master/bb4.gradle'
project.archivesBaseName = 'bb4-game'
mainClassName = "com.barrybecker4.game.common.ui.GameApp"
ext.gameApp = 'com.barrybecker4.game.common.ui.GameApp'
dependencies {
compile 'com.barrybecker4:bb4-sound:1.2-SNAPSHOT'
compile 'com.barrybecker4:bb4-optimization:1.2-SNAPSHOT'
compile 'com.barrybecker4:bb4-sgf:1.1'
// jars needed for go
compile fileTree(dir: 'lib', include: '*.jar')
}
task runGalactic(type: JavaExec) {
main = gameApp
args = ["-name", "galactic", "-locale", "ENGLISH"]
classpath = sourceSets.main.runtimeClasspath
}
task runGoMoku(type: JavaExec) {
main = gameApp
args = ["-name", "gomoku", "-locale", "ENGLISH"]
classpath = sourceSets.main.runtimeClasspath
}
task runTicTacToe(type: JavaExec) {
main = gameApp
args = ["-name", "tictactoe", "-locale", "ENGLISH"]
classpath = sourceSets.main.runtimeClasspath
}
task runMancala(type: JavaExec) {
main = gameApp
args = ["-name", "mancala", "-locale", "ENGLISH"]
jvmArgs = ["-ea"]
classpath = sourceSets.main.runtimeClasspath
}
task runBlockade(type: JavaExec) {
main = gameApp
args = ["-name", "blockade", "-locale", "ENGLISH"]
classpath = sourceSets.main.runtimeClasspath
}
task runCheckers(type: JavaExec) {
main = gameApp
args = ["-name", "checkers", "-locale", "ENGLISH"]
classpath = sourceSets.main.runtimeClasspath
}
task runChess(type: JavaExec) {
main = gameApp
args = ["-name", "chess", "-locale", "ENGLISH"]
classpath = sourceSets.main.runtimeClasspath
}
task runSet(type: JavaExec) {
main = gameApp
args = ["-name", "set", "-locale", "ENGLISH"]
classpath = sourceSets.main.runtimeClasspath
}
task runGo(type: JavaExec) {
main = gameApp
args = ["-name", "go", "-locale", "ENGLISH"]
classpath = sourceSets.main.runtimeClasspath
}
task runGoJapanese(type: JavaExec) {
main = gameApp
args = ["-name", "go", "-locale", "JAPANESE"]
classpath = sourceSets.main.runtimeClasspath
jvmArgs = ["-ea"] // in gradle 1.7 default jvmArgs can be set with applicationDefaultJvmArgs
}
task runKgsTesujisoftGoClient(type: JavaExec) {
main = 'com.barrybecker4.game.twoplayer.go.GtpKgsTesujisoftGoClient'
classpath = sourceSets.main.runtimeClasspath
}
/*
task runGoGui(type: JavaExec) {
main = 'gogui.Main'
args = ["arg1", "-program", "arg2", "${java_compiler} -ea -classpath ${classesDir};${libDir}/gogui7.1.jar com.barrybecker4.game.twoplayer.go.server.GtpTesujisoftGoServer"]
classpath = sourceSets.main.runtimeClasspath
} */
task runTrivial(type: JavaExec) {
main = gameApp
args = ["-name", "trivial", "-locale", "ENGLISH"]
classpath = sourceSets.main.runtimeClasspath
}
task runTrivialServer(type: JavaExec) {
main = 'com.barrybecker4.game.common.online.ui.OnlineGameServerFrame'
args = ["-game", "trivial"]
classpath = sourceSets.main.runtimeClasspath
}
/*
task runTrivialServerAndClients(type: JavaExec) {
tasks.runTrivialServer.execute()
tasks.runTrivial.execute()
tasks.runTrivial.execute()
tasks.runTrivial.execute()
} */
task runPoker(type: JavaExec) {
main = 'com.barrybecker4.game.common.ui.GameApp'
args = ["-name", "poker", "-locale", "ENGLISH"]
classpath = sourceSets.main.runtimeClasspath
}
task runPokerServer(type: JavaExec) {
main = 'com.barrybecker4.game.common.online.ui.OnlineGameServerFrame'
args = ["-game", "poker", "-locale", "ENGLISH"]
classpath = sourceSets.main.runtimeClasspath
}
task runGameComparisons(type: JavaExec) {
main = "com.barrybecker4.game.twoplayer.comparison.GameComparisonApp"
args = ["-name", "gomoku", "-locale", "ENGLISH"]
classpath = sourceSets.main.runtimeClasspath
}
/*
task runPokerServerAndClients(type: JavaExec) {
tasks.runPokerServer.execute()
tasks.runPoker.execute()
tasks.runPoker.execute()
tasks.runPoker.execute()
} */
/*
<target name="executeTrivialServerAndClients" depends="compile" description="Run online trivial server and several clients">
<parallel>
<antcall target="executeTrivialServer"/>
<sequential>
<sleep seconds="1" />
<antcall target="executeTrivial"/>
</sequential>
<!--
<sequential>
<sleep seconds="2"/>
<antcall target="executeTrivial"/>
</sequential-->
<!--sequential>
<sleep seconds="3"/>
<antcall target="executeTrivial"/>
</sequential-->
</parallel>
</target>
<target name="executePoker" depends="compile" description="Run poker card game app">
<antcall target="executeProgram">
<param name="className" value="${gameAppClass}"/>
<param name="libPath" value="${libDir}/jai-codec-1.1.3.jar;"/>
<param name="args" value="-name poker -locale ENGLISH"/>
</antcall>
</target>
<target name="executePokerServer" depends="compile" description="Run online poker server">
<antcall target="executeProgram">
<param name="className" value="com.barrybecker4.game.common.online.ui.OnlineGameServerFrame"/>
<param name="libPath" value="${libDir}/jai-codec-1.1.3.jar;"/>
<param name="args" value="-game poker -locale ENGLISH"/>
</antcall>
</target>
<target name="executePokerServerAndClients" depends="compile" description="Run online poker server and several clients">
<parallel>
<antcall target="executePokerServer"/>
<sequential>
<sleep seconds="1" />
<antcall target="executePoker"/>
</sequential>
<sequential>
<sleep seconds="2"/>
<antcall target="executePoker"/>
</sequential>
<!--sequential>
<sleep seconds="3"/>
<antcall target="executePoker"/>
</sequential-->
</parallel>
</target>
<target name="kgsTesujisoftGoClient" depends="compile" description="run the Tesujisoft Go engine on KGS.">
<antcall target="executeProgram">
<param name="className" value="com.barrybecker4.game.twoplayer.go.GtpKgsTesujisoftGoClient"/>
<param name="libPath" value="${libDir}/kgsGtp.jar;${libDir}/gogui7.1.jar"/>
</antcall>
</target>
<target name="GoGui" depends="compile">
<antcall target="executeProgram2">
<param name="className" value="gogui.Main"/>
<param name="libPath" value="${libDir}/gogui7.1.jar"/>
<param name="arg1" value="-program"/>
<param name="arg2" value="${java_compiler} -ea -classpath ${classesDir};${libDir}/gogui7.1.jar com.barrybecker4.game.twoplayer.go.server.GtpTesujisoftGoServer"/>
</antcall>
</target>
*/
ext.appMap = new LinkedHashMap()
appMap.put('game',
[include:['com/barrybecker4/game/common/**', 'com/barrybecker4/game/card/**', 'com/barrybecker4/game/*.xml']])
appMap.put('twoplayer', [include:['com/barrybecker4/game/twoplayer/common/**']])
appMap.put('multiplayer',[include:['com/barrybecker4/game/multiplayer/common/**']])
appMap.put('blockade', [include:['com/barrybecker4/game/twoplayer/blockade/**']])
appMap.put('chess', [include:['com/barrybecker4/game/twoplayer/chess/**', 'com/barrybecker4/game/twoplayer/checkers/**']])
appMap.put('go', [include:['com/barrybecker4/game/twoplayer/go/**']])
appMap.put('gomoku', [include:['com/barrybecker4/game/twoplayer/gomoku/**']])
appMap.put('tictactoe', [include:['com/barrybecker4/game/twoplayer/tictactoe/**']])
appMap.put('galactic', [include:['com/barrybecker4/game/multiplayer/galactic/**']])
appMap.put('poker', [include:['com/barrybecker4/game/multiplayer/poker/**']])
appMap.put('set', [include:['com/barrybecker4/game/multiplayer/set/**']])
apply from: 'https://raw.github.com/barrybecker4/bb4-common/master/bb4-publish.gradle'