r25762 - Directly upload Mac / Windows executables. ([URL='https://github.com/kolmafia/kolmafia/pull/93']#93[/URL]) * Add bin task to Gradle. This c

Github Bot

Poster of Commits
Directly upload Mac / Windows executables. (#93)

* Add bin task to Gradle.

This creates a binary in build/KoLmafia/bin/KoLmafia.

This change also adds a pruneBin task which is always run. I tried to
figure out how to set up inputs / outputs, but jpackage insists on
creating the output directory itself and will generate an error if
said directory already exists.

Follow-up changes will involve tinkering with a build matrix and
looking at the resulting artifacts.

* Copy-paste build to run ./gradlew bin.

I'm not actually sure what the resulting files will look like on
Windows / Mac, so here's to hoping I can actually see the artifacts
before trying to publish them.

* Run build for the jpackage branch.

This will allow for more experimentation without pushing to main.

* List created artifacts.

Hopefully Mac artifacts end in dmg, and Windows artifacts end in
exe. But maybe not...

* Inspect parent directory.

Apparently Mac didn't create build/KoLmafia/bin.

* Install binaries into dist/.

Still not seeing the output of Mac builds, although I now see:

- Linux: ${dist}/KoLmafia/bin/KoLmafia
- Windows: ${dist}/KoLmafia/KoLmafia.exe

Perhaps if I'm lucky, Mac is directly in ${dist}/KoLmafia.dmg?

If I'm unlucky, it won't be present at all. :(

* Move files back into build/.

This caused a nasty bit of infinite recursion. Whoops.

Let's instead move things into build/bin.

* Upload all artifacts, then download them.

This allows us to get all of the artifacts in one single container so
we can theoretically publish them all at once later.

* Add name, runs-on to release job.

* Bundle artifacts as zips.

We actually need everything in the generated directory, not just the
runner binary.

* M-x untabify

* Move code into build/releases, stop using wildcard.

This attempted to save maybe one level of directory nesting, which I
don't think actually matters in practice.

* Stitch everything together.

This splits the existing daily job into two targets: jar and
release. `release` in turn depends on both `jar` and `bin`.

'bin' generates files Windows.zip, Linux.zip, and macOS.zip.

* Remove extra newline.

* Use jpackage-gradle-plugin instead of exec task.

It doesn't feel appreciably different, but maybe it's more readable.

* Improve portability of jpackage task.

Mac creates the directory `build/releases/KoLmafia.app`, whereas Linux
/ Windows create `build/releases/KoLmafia`. jpackage will create all
prerequisite directories, so it's fine with either deleting the inner
directory, or its parent.

* added appVersion, mac and windows package types, and mac icon

* Add Windows icon for binary release.

This uses the existing martini glass that was the KoLmelion icon once
upon a time.

* Directly upload Mac, Windows executables.

Currently, we're generating macOS.zip, Windows.zip which each only
contain a single file.

This change also cleans up jarbundler / jsmooth utils now that we're
using + relying on jpackage for creating platform-specific builds.

We also reuse the Windows icon for Linux (and rename it to get rid of
the legacy KoLmelion name), which is copied into util/linux to preempt
confusion along the lines of "why are we using this windows/ file in
the linux build".

* Try to target deb or rpm on Linux if available.

This detects the existence of commands in the $PATH using the Bash
`which` command.

This also bumps our required version to Java 11 because I didn't want
to pollute the build output, or roll my own NullOutputStream.

* Add revision info to appName, appVersion.

This might be redundant, but it seemed okay in Linux.

This change also replaces instances of " with ' for strings that
didn't use templating.

* This change adds the Windows DirChooser, Shortcut, and useCWDasROOT flag and also the Mac switches from pkg to dmg.

* set to upload mac DMGs

Co-authored-by: BadHorseMonkey <58645293+BadHorseMonkey@users.noreply.github.com>

View on Github
 
Top