JOverseer / joverseer

JOverseer is a desktop application which aims to assist players of the Middle Earth PBM game.
BSD 3-Clause "New" or "Revised" License
3 stars 5 forks source link

Build Instructions for OSX #648

Closed randybias closed 1 year ago

randybias commented 7 years ago

It would be nice to have build instructions for OSX. Some of us are not Java experts, but clueful enough on general coding and building of apps that we could contribute on certain bits, but I'm no expert on ant builds for example. I need something to start with.

randybias commented 7 years ago

Well, I have something that is close to working. I had to reverse engineer a fair bit since Releasing.txt isn't accurate.

Here is the script (it's hackey):

#!/usr/bin/env bash
#

# FIX
brew install launch4j
brew cask install packages

export PATH="/usr/local/bin:$PATH"

if [ ! -h ../../launch4j ]; then
        echo "Linking ../../launch4j to brew installation"
        (cd ../../ ;ln -s /usr/local/opt/launch4j/libexec launch4j )
fi

for i in txt2xmljar orderchecker joverseerupdaterjar joverseerjar; do
        (cd ../../$i; ant -f build.xml )
done

(cd ../../jOverseerRelease; ant -f build.xml MacOSInstaller)

The problem that is still there is that the package build process doesn't handle the CSV files for orders, rulesets, etc. So when you install the OSX package you can't run orderchecker, probably jOverseer's most important feature. Similarly, if you run it straight out of jOverseerRelease/dist, the paths aren't configured correctly to find it.

This is all with 1.16.2.

GnarlyDave commented 7 years ago

thanks for the contribution.

I've only got access to an old Mac laptop, and although I'm familiiar with *nix development, I'm not familiar with the MacOS ecosystem. So I was happy just to make an installer work - I did the jar builds on linux or windows, and copied them across. I develop under eclipse on windows, with the various build.xml used directly for packaging. The longer term aim, was to use linux as a continuous integration server...but that means expending a fair bit of effort in writing some tests.

Hmm, perhaps the first tests should be to make sure that the paths to resources are accessable.

As for Releasing.txt....that as more of an aide-memoire...I'm glad it was of some use to others :)

GnarlyDave commented 7 years ago

Just a thought....are you trying to run orderchecker.jar on it's own? The original orderchecker had it's own metadata, but with the advent of Kinstrife which can change the setup information, I think I switched it so that it used joverseer resources.

randybias commented 7 years ago

Here's a slightly updated version of something that works sans packaging (must be run from ./joverseerjar/resources):

#!/usr/bin/env bash
#
# buildjarmac.sh

# FIX
brew install launch4j
brew cask install packages

export PATH="/usr/local/bin:$PATH"

if [ ! -h ../../launch4j ]; then
        echo "Linking ../../launch4j to brew installation"
        (cd ../../ ;ln -s /usr/local/opt/launch4j/libexec launch4j )
fi

for i in txt2xmljar orderchecker joverseerupdaterjar joverseerjar; do
        (cd ../../$i; ant )
done

(cd ../../jOverseerRelease; ant -f build.xml MacOSInstaller)

mkdir ../../jOverseerRelease/dist/bin

cp -R ./metadata ../../jOverseerRelease/dist/bin

The change is the last line. If you run this to completion on a modern Mac and then run joverseer.jar from that directory:

java -Xmx4096M -jar joverseer.jar -Djava.net.preferIPv4Stack=true

The right thing happens, orderchecker works, etc.

I'll try and see if I can figure out how to fix the package tool you are using, but it might be a while. Is there a way to specify where the metadata directory is relative to the installation or jar file?

GnarlyDave commented 6 years ago

commit faf43d76599ef1eec03773ac9d30c7ff93a00203 solves this by loading the csv(s) from the orderchecker jar file.

GnarlyDave commented 1 year ago

We now have Continuous Integration set up for mac builds, so this is obsolete.