All Projects → dmccabe → gdx-deploy-sample

dmccabe / gdx-deploy-sample

Licence: MIT license
Sample Gradle configurations for LibGDX for preparing and deploying release builds

Projects that are alternatives of or similar to gdx-deploy-sample

Martianrun
An Open-Source Running Game with libGDX
Stars: ✭ 242 (+764.29%)
Mutual labels:  libgdx
kickoff
Open Kick-Off is a fun rewriting attempt of the cult football game Kick Off 2 designed by Dino Dini and released in 1990 by Anco for the Atari ST and the Commodore Amiga. It is written in Java with the help of libGDX.
Stars: ✭ 32 (+14.29%)
Mutual labels:  libgdx
gdx-sqlite
A cross-platform extension for database handling in Libgdx
Stars: ✭ 61 (+117.86%)
Mutual labels:  libgdx
DoubleHelix
A live wallpaper and daydream for Android featuring stylized glassy-looking DNA structures
Stars: ✭ 86 (+207.14%)
Mutual labels:  libgdx
Koru
A 2D multiplayer sandbox game.
Stars: ✭ 78 (+178.57%)
Mutual labels:  libgdx
gdx-gameanalytics
Gameanalytics.com client implementation for libGDX
Stars: ✭ 28 (+0%)
Mutual labels:  libgdx
Destinationsol
Official continuation of Destination Sol, the great fun little arcade space shooter from http://sourceforge.net/projects/destinationsol/ Modules live at https://github.com/DestinationSol/
Stars: ✭ 214 (+664.29%)
Mutual labels:  libgdx
omo
Kotlin port with changes and improvements for omo originally by ForeignGuyMike
Stars: ✭ 22 (-21.43%)
Mutual labels:  libgdx
tripeaks-gdx
A simple tri peaks solitaire game using libGDX.
Stars: ✭ 45 (+60.71%)
Mutual labels:  libgdx
springboot-tutorials
codehome出品SpringBoot2.x基础教程
Stars: ✭ 77 (+175%)
Mutual labels:  proguard
libgdx-transitions
libgdx screen transitions/fading
Stars: ✭ 43 (+53.57%)
Mutual labels:  libgdx
ForgE
Simple clone of RPG maker using LibGdx
Stars: ✭ 17 (-39.29%)
Mutual labels:  libgdx
GDX-lazy-font
auto self-generate BitmapFont for libgdx 1.5.0 +
Stars: ✭ 26 (-7.14%)
Mutual labels:  libgdx
EasyStage
A stage profile tool for libgdx
Stars: ✭ 17 (-39.29%)
Mutual labels:  libgdx
WurfelEngineSDK
Isometric game engine. Open world, block/voxel based and sprite rendering.
Stars: ✭ 96 (+242.86%)
Mutual labels:  libgdx
Gdx Rpg
java & libgdx制作的RPG游戏! an RPG by java and LibGDX
Stars: ✭ 239 (+753.57%)
Mutual labels:  libgdx
pixelwheels
A top-down retro racing game for PC (Linux, macOS, Windows) and Android.
Stars: ✭ 315 (+1025%)
Mutual labels:  libgdx
gdx-freetype-gwt
Freetype for gwt
Stars: ✭ 41 (+46.43%)
Mutual labels:  libgdx
pathfinding
Java pathfinding framework.
Stars: ✭ 94 (+235.71%)
Mutual labels:  libgdx
bialjam17
💫 The game that won the BialJam'17 event
Stars: ✭ 55 (+96.43%)
Mutual labels:  libgdx

gdx-deploy-sample

Sample Gradle configurations for LibGDX for preparing and deploying release builds

Overview

This project includes commands to obfuscate the source using Proguard, generate builds via Packr, set an icon on Windows executables (currently not supported by Packr), and push the builds to itch.io, all in a single command. It is currently setup to generate builds for Windows, Mac, and Linux, with 32-bit and 64-bit variants for Windows and Linux.

Setup

You'll need to download / install some files before getting started, if you don't have them already:

In your main build.gradle file, add this under buildscript -> dependencies:

classpath 'de.undercouch:gradle-download-task:3.1.1'
classpath 'org.mini2Dx:butler:1.0.1'

Then under project(:desktop), add:

apply plugin: "org.mini2Dx.butler"

butler {
  user = "your-itch-io-username"
  game = "your-itch-io-game"
}

After that, grab the build.gradle file from the desktop folder in this repository and put it in desktop/build.gradle. Once that's in place, you'll need to update the paths for dekstopWorkingDir and utilsDir, then put proguard.jar, packr.jar and ResourceHacker.exe into the utils folder specified. The JDKs you downloaded will need to go into a folder called "jre" folder in the the utils folder, and you may need to update the pack commands to use the correct JDK versions. You'll also want to replace the various references in this file to Questionable Markup, which was the name of my game.

Next, add a Proguard configuration file to your LibGDX project under desktop/proguard-project.txt. A sample is included in this repo, although you'll need to update the packages to correspond to class names for your game.

Then, add a configuration file for Packr in your LibGDX project under desktop/config/packr-minimize.json. There's also a sample of this in the repo files.

Finally, add the icons you want to use for your Windows / Mac builds to destkop/assets/icons/app-icon.ico and desktop/assets/icons/app-icon.icns, respectively.

Obfuscate Code (Proguard)

Proguard is used to obfuscate your game's source code, which should make it more difficult for others to decompile. To run Proguard and obfuscate your desktop build, execute:

gradlew desktop:obfuscate

This will invoke desktop:dist to ensure you have a build to obfuscate, then run Proguard to obfuscate it. Currently, this assumes that the file generated by desktop:dist will be called desktop-1.0.jar. If you changed the version number of your game in your main build.gradle file, you'll probably need to tweak this.

Generate Executables (Packr)

Packr is used to generate an executeable for the jar file. To generate all builds using Packr, execute:

gradlew desktop:pack

This will take the obfuscated build generated from the previous step as an input. Invoking pack will automatically run the obfuscate command, so you don't need to execute that separately. You can also run the process individually for each build:

gradlew desktop:packWindows32
gradlew desktop:packWindows64
gradlew desktop:packMac
gradlew desktop:packLinux32
gradlew desktop:packLinux64

Running the build-specific commands will NOT execute obfuscate first.

Set Executable Icons (Resource Hacker)

Packr doesn't currently have the ability to set icons on Windows builds, so we use Resource Hacker to fill that gap. Execute the following to set the icon on both Windows 32 and 64 bit builds:

gradlew desktop:setIcon

This will invoke all steps up to this point as well. Alternatively, you can also execute the command on each build separately:

gradelw desktop:setIconWindows32
gradlew desktop:setIconWindows64

Running the build-specific commands will NOT execute pack first.

Upload to itch.io (Butler)

Butler is a command-line tool that can be used to upload builds to itch.io. To upload all builds, execute:

gradlew desktop:push

This will invoke all prior steps as well, so you can use this command to run the entire process. Alternatively, you can also run the command individually for each build:

gradlew desktop:pushWindows32
gradlew desktop:pushWindows64
gradlew desktop:pushMac
gradlew desktop:pushLinux32
gradlew desktop:pushLinux64

As with the other build-specific commands, these commands will NOT execute any previous steps.

Other Output Options

If you're not using itch.io, you can use the release command to run all steps up until that point:

gradlew desktop:release

This command will essentially do the same thing as setIcon, it just puts a prettier name on it.

Caveats

  • These commands were put together with an extremely limited knowledge of Gradle. I know there's better ways to put together these commands and integrate them into a LibGDX project. This project mainly exists to demonstrate the set of commands I was using to generate and deploy builds, but any suggestions on how to improve things are greatly appreciated!

  • There currently isn't anything setup to check whether or not anything has changed since the last build, so unlike some other LibGDX Gradle commands, all of the commands included here will execute each time they're run, even if the inputs haven't changed. I did some quick research into how to fix this, but I haven't spent enough time with it yet. Any insight would be awesome.

  • I couldn't figure out how to properly re-use some pieces from the Butler plugin, so I threw my hands up and did some copy-pasta to get it working the way I wanted it to. Hopefully someone can come up with a better way to do that.

  • Resource Hacker can only be run from a Windows machine or VM, since it uses Windows APIs to set the icon on the executable. There may be other solutions out there to do this from Mac and Linux, however.

  • This was only built with desktop builds in mind, since that's what I was focused on for my project. Additional work would be needed to apply this to Android, iOS, or HTML builds.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].