Skip to content

Commit

Permalink
Gelsemium (#4)
Browse files Browse the repository at this point in the history
* Consolidated hyperlinklisteners and added hyperlink features to expansion details panel.
* Debug OXP presence is detected or configurable
Start TCPServer only if we have a debug-capable Oolite
* Switch to OpenJDK 21
* Markup MacOS architecture in artifact name
* Mark Windows artifact
* Add frame callback later in life cycle.
* Make MQTT connections configurable and add documentation
* Improve documentation
* Add generic feedback channel so MQTT clients can control Oolite
* Better indicate what removing an installation means
* Validate installations on startup
* Add MQTT configuration UI
* Write test message on startup
* MQTT configuration per installation, user configurable and with configurable prefix.
* Show test button only in installation editor
* Show used topics at configuration screen
* Fix panel size
* Fix error when Flavors cannot be loaded
* Without internet at least the local expansions will be shown
* Allow tests to perform even if we are offline.
Humm, a test that _should_ run offline requires apple.com?
  • Loading branch information
oocube authored Jul 12, 2024
1 parent 64db3f9 commit 862a6ff
Show file tree
Hide file tree
Showing 53 changed files with 3,490 additions and 861 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ jobs:
with:
fetch-depth: 0

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'

- name: Build with Maven
Expand All @@ -92,10 +92,10 @@ jobs:
needs: [semver,build]
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'

- name: Checkout project
Expand Down Expand Up @@ -191,10 +191,10 @@ jobs:
needs: [semver,build]
runs-on: windows-latest
steps:
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'

- name: Checkout project
Expand All @@ -211,6 +211,7 @@ jobs:

- name: Check status 0
run: |
gci env:* | sort-object name
get-childitem . -Recurse | where {!$_.PSIsContainer} | select-object FullName
- name: Extract project
Expand Down Expand Up @@ -242,7 +243,10 @@ jobs:
- name: Rename result (target\OoliteStarter-0.1.16.0.exe)
run: |
ren "target\OoliteStarter-${{ needs.semver.outputs.GITVERSION_ASSEMBLYSEMVER }}.exe" OoliteStarter-${{ needs.semver.outputs.GITVERSION_SEMVER }}-Windows.exe
gci env:* | sort-object name
$SRC = "target\OoliteStarter-${{ needs.semver.outputs.GITVERSION_ASSEMBLYSEMVER }}.exe"
$DST = "OoliteStarter-${{ needs.semver.outputs.GITVERSION_SEMVER }}-Windows-%PROCESSOR_ARCHITECTURE%.exe"
ren $SRC $DST
- name: Check status 4
run: |
Expand All @@ -258,10 +262,10 @@ jobs:
runs-on: macos-latest

steps:
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'

- name: Checkout project
Expand Down Expand Up @@ -342,7 +346,7 @@ jobs:
- name: Create ZIP distribution
run: |
cd target/appimage
zip -r ../OoliteStarter-${{ needs.semver.outputs.GITVERSION_SEMVER }}-MacOS.zip *
zip -r ../OoliteStarter-${{ needs.semver.outputs.GITVERSION_SEMVER }}-MacOS-${HOSTTYPE}.zip *
- name: Check status 3
run: |
Expand All @@ -353,7 +357,7 @@ jobs:
- name: Rename result
run: |
mv ./target/OoliteStarter-${{ needs.semver.outputs.MACOS_MAJORMINORPATCH }}.pkg ./target/OoliteStarter-${{ needs.semver.outputs.GITVERSION_SEMVER }}-MacOS.pkg
mv ./target/OoliteStarter-${{ needs.semver.outputs.MACOS_MAJORMINORPATCH }}.pkg ./target/OoliteStarter-${{ needs.semver.outputs.GITVERSION_SEMVER }}-MacOS-${HOSTTYPE}.pkg
- name: Check status 4
run: |
Expand Down
2 changes: 1 addition & 1 deletion checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<!-- Checks for Size Violations. -->
<!-- See https://checkstyle.org/config_sizes.html -->
<module name="FileLength">
<property name="max" value="2600"/>
<property name="max" value="2700"/>
</module>
<!-- TODO: This is a lot of work, despite easy to resolve.
<module name="LineLength">
Expand Down
1 change: 0 additions & 1 deletion nb-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ You can copy and paste the single properties, into the pom.xml file and the IDE
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<netbeans.hint.jdkPlatform>JDK_17__System_</netbeans.hint.jdkPlatform>
<org-netbeans-modules-javascript2-requirejs.enabled>true</org-netbeans-modules-javascript2-requirejs.enabled>
</properties>
</project-shared-configuration>
52 changes: 43 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,24 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.20.0</version>
<version>2.23.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.20.0</version>
<version>2.23.1</version>
<scope>runtime</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-slf4j2-impl ->
Looks like with this dependency all our logging ends up on slf4j
-->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.23.1</version>
<scope>runtime</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/org.antlr/antlr4-runtime -->
<dependency>
<groupId>org.antlr</groupId>
Expand All @@ -282,19 +292,19 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.2</version>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.9.2</version>
<version>5.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.9.2</version>
<version>5.10.2</version>
<scope>test</scope>
</dependency>

Expand All @@ -307,21 +317,27 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<version>5.11.0</version>
<version>5.12.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.14.17</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>4.2.0</version>
<version>4.2.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.formdev</groupId>
<artifactId>flatlaf</artifactId>
<version>3.1.1</version>
<version>3.4.1</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.json/json -->
Expand All @@ -347,8 +363,26 @@
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.5.0</version>
<version>1.7.0</version>
</dependency>

<dependency>
<groupId>com.googlecode.plist</groupId>
<artifactId>dd-plist</artifactId>
<version>1.28</version>
</dependency>

<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-core</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.eclipse.paho</groupId>
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>1.2.5</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.json/json -->

</dependencies>
</project>
66 changes: 64 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ and manage save games.

## Requirements (generic package only)

* You need to have Java SDK 17 or newer installed.
* You need to have Java SDK 21 or newer installed.
If you are unfamiliar with installing Java on Linux, follow
https://www.youtube.com/watch?v=7lzIP-PvHoY
If you are unfamiliar with installing Java on MacOS, follow
Expand All @@ -28,7 +28,7 @@ To remove the software, just delete the directory you have created.

If, directly at startup, you see error messages like
java.lang.UnsupportedClassVersionError: oolite/starter/MainFrame has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to...
you are running a too old JVM. Not only check whether Java 17+ is installed, also
you are running a too old JVM. Not only check whether Java 21+ is installed, also
make sure it is used (there may be multiple Java installations on your system).

### Linux (.deb)
Expand Down Expand Up @@ -312,6 +312,68 @@ next time run OoliteStarter.

The configuration data is stored in $HOME/.oolite-starter.conf.

## MQTT Configuration

OoliteStarter can push Oolite into the world of IoT. Events from the game get
published via MQTT. Feel free to connect any amount and type of MQTT clients to
react to the published messages.

The current implementation will send messages as specified in
https://github.com/maikschulz/oolite-mqtt-bridge
which means the same NodeRed client setup can be used to visualize the data.

There are prerequisites that must be met for such messages to be published:
- You need to have an Oolite version that contains the DebugOXP (that is either
a test or development version)
- OoliteStarter must have detected the DebugOXP (a checkmark in the installation
settings)
- You must have configured MQTT broker details. This currently requires editing
the $HOME/.oolite-starter.conf file manually.

Add a section like this into your configuration file, then start up OoliteStarter:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<OoliteStarter>
...
<Installation ...>
...
<Mqtt>
<BrokerUrl>tcp://192.168.178.51:1883</BrokerUrl>
<User>artemis</User>
<Password>artemis</Password>
<Prefix>prefix</Prefix>
</Mqtt>
</Installation>
</OoliteStarter>

These events will be happening:

![](http://cdn-0.plantuml.com/plantuml/png/ZLFDJiCm3BxdAQpT4K9SfXtG9Cw88SO3PAdNMRH9oSyctfuutLX3aubBfSIV_VquNJilhGzz9wJoniA7Gok6U4MA1gazl9gEFBupgbZ9hZR6Uf0E5jldpNXuM2uV5uA7qr5wX9UtxVPwIcpykNlAU5QGP5s1kGhHMXE6_18SEaT62u3YG6NqdjfWyQAx1knaqEfmRz657g6LVO9E6ITKa8c8mzXV8jEeV0d0gPpjGKVEeoRT9k2lMOQKMiVZHM6IbZUEW4dhI5VLKt1_akI1DEoa-cJFkabD3LPM0P37k8AXaz-Ss2KpFaUBMMX_zJdKJUJOXHRw29CjkZEEwpEH5XNI4SiTLQ7LRUsDFKbR5d3RESPu2X5y1VA5BJJavekOcOkVddJaAmSlwXx_iLvtCATRhz8CsQFC-1bJVVAvkK8VPrNzvr9Wiy4CpVAeBqEawTNoEfP3t_q0)

If OoliteStarter cannot grab the TCP Port it will not complain. But at the same
time it will not be able to receive events to be forwarded to MQTT.

### Feedback Channel

OoliteStarter not only allows Oolite to publish messages to MQTT. It also allows
MQTT devices to respond and feeds these messages back into Oolite. All a client
has to do is to publish a JSON message on the oolite/input topic that looks like
this:

{ 'command': "somestring" }

While this may look like overhead it allows future extension of the messages.

Make sure 'somestring' is a valid Oolite command - or expect some Oolite complaints
and ranting in one of the other topics.


### OoliteStarter and Oolite Debug Console

As only one application can listen for connections on the TCP port 1883, you have
to choose which one gets the port. As long as you start the Oolite Debug Console
prior to launching the Oolite session you are good to go.

## Tuning

You can modify OoliteStarter's appearance as much as FlatLAF allows. This is done
Expand Down
Loading

0 comments on commit 862a6ff

Please sign in to comment.