-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from JavaBWAPI/linux-support
Linux support
- Loading branch information
Showing
14 changed files
with
464 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Test Linux | ||
|
||
on: | ||
- pull_request | ||
|
||
jobs: | ||
e2e: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml | ||
|
||
- name: Setup and launch openbw | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install cmake libsdl2-dev libsdl2-mixer-dev | ||
|
||
git clone https://github.com/basil-ladder/openbw | ||
git clone -b linux-client-support https://github.com/basil-ladder/bwapi | ||
cd bwapi | ||
mkdir build | ||
cd build | ||
cmake .. -DCMAKE_BUILD_TYPE=Release -DOPENBW_DIR=../../openbw -DOPENBW_ENABLE_UI=1 | ||
make -j4 | ||
|
||
curl http://www.cs.mun.ca/~dchurchill/starcraftaicomp/files/Starcraft_1161.zip -o starcraft.zip | ||
unzip starcraft.zip patch_rt.mpq BROODAT.MPQ STARDAT.MPQ | ||
mv patch_rt.mpq Patch_rt.mpq && mv BROODAT.MPQ BrooDat.mpq && mv STARDAT.MPQ StarDat.mpq | ||
unzip starcraft.zip "maps/BroodWar/ICCup/ICCup Destination 1.1.scx" | ||
|
||
BWAPI_CONFIG_AUTO_MENU__RACE=Terran BWAPI_CONFIG_AUTO_MENU__MAP="maps/BroodWar/ICCup/ICCup Destination 1.1.scx" ./bin/BWAPILauncher& | ||
BWAPI_CONFIG_AUTO_MENU__RACE=Terran BWAPI_CONFIG_AUTO_MENU__MAP="maps/BroodWar/ICCup/ICCup Destination 1.1.scx" ./bin/BWAPILauncher& | ||
|
||
- name: Build & Run test bots | ||
run: | | ||
mvn install -DskipTests | ||
mvn -f it/bots/pom.xml package | ||
|
||
java -jar it/bots/SittingDuck/target/SittingDuck-*-jar-with-dependencies.jar & | ||
sleep 3 | ||
java -jar it/bots/jbwapibot/target/MarineHell-*-jar-with-dependencies.jar | grep "Hello from JBWAPI!" || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Test Wine | ||
|
||
on: | ||
- pull_request | ||
|
||
jobs: | ||
e2e: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '8' | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Set up Python 3.6 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.6' | ||
|
||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml | ||
- name: Show versions | ||
run: | | ||
uname -a | ||
python3 --version | ||
java -version | ||
- name: Setup e2e-windows environment | ||
run: | | ||
git clone https://github.com/Bytekeeper/sc-docker.git | ||
cp it/sc-docker-support/*.dockerfile sc-docker/docker/dockerfiles | ||
pushd sc-docker | ||
pip3 install numpy==1.16.6 wheel | ||
python3 setup.py bdist_wheel | ||
pip3 install dist/scbw*.whl | ||
cd docker | ||
./build_images.sh | ||
popd | ||
cp sc-docker/scbw/local_docker/starcraft.zip /tmp/sc-docker/starcraft.zip | ||
scbw.play --install | ||
|
||
- name: Test the e2e-windows environment | ||
run: | | ||
sh mvnw clean install | ||
sh mvnw -f it/bots/pom.xml package | ||
for bot in $(ls -d it/bots/*/); do BOTNAME=$(basename $bot); echo "Setting up $BOTNAME"; mkdir -p "$HOME/.scbw/bots/$BOTNAME/AI" "$HOME/.scbw/bots/$BOTNAME/read" "$HOME/.scbw/bots/$BOTNAME/write"; cp it/sc-docker-support/BWAPI.dll "$HOME/.scbw/bots/$BOTNAME"; cp "$bot/target/"*-with-dependencies.jar "$HOME/.scbw/bots/$BOTNAME/AI"; cp "$bot/bot.json" "$HOME/.scbw/bots/$BOTNAME"; done | ||
scbw.play --headless --bots jbwapibot SittingDuck --timeout 180 --docker_image starcraft:game 2>&1 | grep 'Winner is BotPlayer:jbwapibot:T' || (cat $HOME/.scbw/games/*/logs_0/* && false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | ||
|
||
name: Java CI with Maven | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
java: | ||
- '8' | ||
- '11' | ||
#- '17' | ||
name: Java ${{ matrix.Java }} sample | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup java | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: ${{ matrix.java }} | ||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Based on: #64 | ||
|
||
Compiling and running openbw on linux with client support: | ||
|
||
```bash | ||
# Download build deps | ||
sudo apt install cmake libsdl2-dev libsdl2-mixer-dev #for ubuntu | ||
|
||
# Build openbw with client support | ||
git clone https://github.com/basil-ladder/openbw | ||
git clone -b linux-client-support https://github.com/basil-ladder/bwapi | ||
cd bwapi | ||
mkdir build | ||
cd build | ||
cmake .. -DCMAKE_BUILD_TYPE=Release -DOPENBW_DIR=../../openbw -DOPENBW_ENABLE_UI=1 | ||
make -j4 | ||
|
||
# Download runtime deps | ||
curl http://www.cs.mun.ca/~dchurchill/starcraftaicomp/files/Starcraft_1161.zip -o starcraft.zip | ||
unzip starcraft.zip patch_rt.mpq BROODAT.MPQ STARDAT.MPQ | ||
mv patch_rt.mpq Patch_rt.mpq && mv BROODAT.MPQ BrooDat.mpq && mv STARDAT.MPQ StarDat.mpq | ||
|
||
# Run openbw using the map: Destination 1.1.scx | ||
unzip starcraft.zip "maps/BroodWar/ICCup/ICCup Destination 1.1.scx" | ||
|
||
BWAPI_CONFIG_AUTO_MENU__RACE=Terran BWAPI_CONFIG_AUTO_MENU__MAP="maps/BroodWar/ICCup/ICCup Destination 1.1.scx" ./bin/BWAPILauncher | ||
``` | ||
|
||
Compiling and running openbw on macos with client support (not working): | ||
|
||
```bash | ||
brew install cmake sdl2 sdl2_mixer gcc | ||
|
||
cmake .. -D CMAKE_C_COMPILER=gcc-11 -D CMAKE_CXX_COMPILER=g++-11 -DCMAKE_BUILD_TYPE=Release -DOPENBW_DIR=../../openbw -DOPENBW_ENABLE_UI=1 | ||
make -j4 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
import bwapi.BWClient; | ||
import bwapi.DefaultBWListener; | ||
|
||
public class SittingDuck extends DefaultBWListener { | ||
public static void main(String[] args) { | ||
new BWClient(new SittingDuck()).startGame(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
package bwapi; | ||
|
||
import com.sun.jna.platform.win32.Kernel32; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
|
Oops, something went wrong.