From 77ab43b4855a17162e9ff7a73710a986ac3fc5f6 Mon Sep 17 00:00:00 2001 From: JasperGeurtz Date: Fri, 3 Oct 2025 12:47:39 +0200 Subject: [PATCH 1/2] add working badges & reformat readme --- README.md | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 3ccc276..c3ee53a 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,39 @@ -[![Build Status](https://travis-ci.org/JavaBWAPI/JBWAPI.svg?branch=develop)](https://travis-ci.org/JavaBWAPI/JBWAPI)[![Total alerts](https://img.shields.io/lgtm/alerts/g/JavaBWAPI/JBWAPI.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/JavaBWAPI/JBWAPI/alerts/)[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/JavaBWAPI/JBWAPI.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/JavaBWAPI/JBWAPI/context:java) +[![Build Statues](https://github.com/JavaBWAPI/JBWAPI/actions/workflows/maven.yml/badge.svg)](https://github.com/JavaBWAPI/JBWAPI/actions/workflows/maven.yml) +[![CodeQL](https://github.com/JavaBWAPI/JBWAPI/actions/workflows/codeql.yml/badge.svg)](https://github.com/JavaBWAPI/JBWAPI/actions/workflows/codeql.yml) + # JBWAPI -Pure Java [bwapi](https://github.com/bwapi/bwapi) 4.4.0 client implementation backed by [N00byEdge](https://github.com/N00byEdge)'s [JavaBWAPIBackend](https://github.com/N00byEdge/JavaBWAPIBackend) idea and automated by [Bytekeeper](https://github.com/Bytekeeper). +Pure Java [bwapi](https://github.com/bwapi/bwapi) 4.4.0 client implementation backed by +[N00byEdge](https://github.com/N00byEdge)'s [JavaBWAPIBackend](https://github.com/N00byEdge/JavaBWAPIBackend) idea and +automated by [Bytekeeper](https://github.com/Bytekeeper). Also contains a modified version of the pure Java BWEM implementation from [BWAPI4J](https://github.com/OpenBW/BWAPI4J). ## Goals - - Have a similar (Java) interface to BWMirror to make porting BWMirror bots easy without all the DLL and JNI hassle and overhead. + - Have a similar (Java) interface to BWMirror to make porting BWMirror bots easy without all the DLL and JNI hassle and +overhead. - Stay as updated as possible with the BWAPI releases. ## Advantages - No dependency on external DLL's. - - At least [5x](https://github.com/JavaBWAPI/JBWAPI/issues/17) faster compared to BWMirror for primitives as it directly reads the memory mapped client file. Even faster for BWAPI objects as it also avoids type marshalling - - Supports both 32 and 64 bit Java (e.g. [deeplearning4j](https://deeplearning4j.org/) requires 64 bit Java which bwmirror doesn't support). + - At least [5x](https://github.com/JavaBWAPI/JBWAPI/issues/17) faster compared to BWMirror for primitives as it +directly reads the memory mapped client file. Even faster for BWAPI objects as it also avoids marshalling. + - Supports both 32-and 64-bit Java (e.g. [deeplearning4j](https://deeplearning4j.org/) requires 64-bit Java which +BWMirror doesn't support). - BWEM instead of BWTA as map analyser. - - Supports Linux "natively" using [openbw](https://github.com/JavaBWAPI/JBWAPI/pull/73), made possible by by [ByteKeeper](https://github.com/Bytekeeper) - - `Async` support for realtime tournament constraints, made possible by [dgant](https://github.com/dgant) + - Supports Linux "natively" using [openbw](https://github.com/JavaBWAPI/JBWAPI/pull/73), made possible by +[ByteKeeper](https://github.com/Bytekeeper). + - `Async` support for realtime tournament constraints, made possible by [dgant](https://github.com/dgant). ## Warnings - - A fake BWTA is provided for easier porting from BWMirror, but it translates BWTA calls to their respective BWEM calls, so specific Regions/Chokepoints etc. may differ. + - A fake BWTA is provided for an easier transition from BWMirror. However, it translates BWTA calls to their respective +BWEM calls, so specific Regions/Chokepoints etc. may differ. ## Usage -**Maven** +### Maven Add JitPack as a repository: ``` @@ -44,7 +53,7 @@ Add JBWAPI to your dependencies in ``: ``` -**Gradle** +### Gradle Add JitPack as a repository: ``` @@ -62,9 +71,10 @@ dependencies { } ``` -**Jar** +### Jar -Alternatively add the latest .jar from the [releases](https://github.com/JavaBWAPI/JBWAPI/releases) page to your project. +Alternatively add the latest `.jar` from the [releases](https://github.com/JavaBWAPI/JBWAPI/releases) page to your +project. ## Compilation @@ -76,9 +86,9 @@ or if you already have maven installed ## Example -A simple `Hello World` bot is as easy as +A simple `Hello World` bot is as easy as: -```Java +```java import bwapi.*; class HelloBot extends DefaultBWListener { @@ -106,12 +116,12 @@ You can also ask any further questions on the [SSCAIT Discord](https://discord.g ## Tutorial -If you are a just starting out with bot development, it might be helpful to follow the [tutorial](https://github.com/JavaBWAPI/Java-BWAPI-Tutorial/wiki)! - +If you are a just starting out with bot development, it might be helpful to follow the +[tutorial](https://github.com/JavaBWAPI/Java-BWAPI-Tutorial/wiki)! ## Bots -Some bots using [JBWAPI](https://github.com/JavaBWAPI/JBWAPI) (feel free to open a pullrequest to add yours!) +Some bots using [JBWAPI](https://github.com/JavaBWAPI/JBWAPI) (feel free to open a pull request to add yours!) - https://github.com/dgant/PurpleWave - https://github.com/Ravaelles/Atlantis @@ -119,5 +129,6 @@ Some bots using [JBWAPI](https://github.com/JavaBWAPI/JBWAPI) (feel free to open ## Linux -If you use Linux you can choose to develop normally and run the `jar` and `starcraft` using [wine](https://www.winehq.org/) -or try to use `openbw` by following the following [instructions](./build_with_openbw.md) +If you use Linux you can choose to develop normally and run the `jar` and `starcraft` using +[wine](https://www.winehq.org/) or try to use `openbw` by following the following +[instructions](./build_with_openbw.md). From 881d64d4d40da88699b79f5269d9d4a106a35719 Mon Sep 17 00:00:00 2001 From: JasperGeurtz Date: Fri, 3 Oct 2025 13:16:13 +0200 Subject: [PATCH 2/2] also run tests in github action --- .github/workflows/maven.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 7131c43..81e8782 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -26,3 +26,5 @@ jobs: java-version: ${{ matrix.java }} - name: Build with Maven run: mvn -B package --file pom.xml + - name: Test with Maven + run: mvn test