diff --git a/README.md b/README.md index bda8603a..d2cd8c18 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,16 @@ initially configured your project, and it is very far behind the times on its de The official setup may transition to a web-based tool soon, but any user of the Internet can recall times when formerly-reliable services went offline or had outages. This project provides another alternative setup tool based on [SquidSetup](https://github.com/tommyettinger/SquidSetup), but removing the close ties to the SquidLib libraries to make it more general-use. Using SquidSetup's -code, which is built on czyzby's code, gives us working projects that use Gradle 6.8.3, the same as the official setup, but ahead of 4.0.2 for czyzby's gdx-setup. -Currently, gdx-liftoff projects depend on libGDX 1.9.13 by default, and allow using snapshots as well. -The current version of libGDX is 1.9.14, but that particular release has some very problematic bugs, while 1.9.13 and -the current 1.9.15-SNAPSHOT nightly releases should work fine. You can choose any released version of libGDX (or a -nightly version) in the Advanced tab of the program window; it will be downloaded if needed when you import the Gradle -project into your IDE or run one of most Gradle tasks. +code, which is built on czyzby's code, gives us working projects that use Gradle 6.8.3, ahead of 6.7.1 for the official setup and 4.0.2 for czyzby's gdx-setup. +The current Gradle version is 7.0 at the time of writing, but it isn't fully compatible with all of the platforms gdx-liftoff +can target, so we're staying on 6.8.3 until it is compatible. This means you can't currently run gdx-liftoff-generated +projects on Java 16, because if Java 16 is your main Java installation, Gradle 6.x fails to run. Java 8 through 15 will all work, though, +and Java 16 should work soon. +Currently, gdx-liftoff projects depend on libGDX 1.10.0 by default, and allow using snapshots as well. +The current version of libGDX is 1.10.0, which had a longer release cycle because there was an emphasis on fixing bugs +in earlier releases. You can choose any released version of libGDX (or a nightly version) in the Advanced tab of the +program window; it will be downloaded if needed when you import the Gradle project into your IDE or run one of most +Gradle tasks. Projects default to using LWJGL3 instead of LWJGL2 (the old 'desktop' platform), since code tends to be very similar between the two, but LWJGL3 generally offers more features. This code is tested for compatibility with GWT, including the various changes that Gradle needs with this version. It is sometimes tested on Android, @@ -42,10 +46,10 @@ for new projects generated by gdx-liftoff. - LWJGL3 is almost the same as Desktop, but because it has better support for new hardware (such as high-DPI displays), it should probably be preferred. It also allows multiple windows and drag+drop. - LWJGL3 itself supports Linux on arm32 and arm64 hardware, and libGDX since version 1.9.13 (current is - 1.9.14) also supports ARM Linux on desktop platforms. + 1.10.0) also supports ARM Linux on desktop platforms. - The new ARM Macs are so-far unsupported by LWJGL, but work is underway to make LWJGL3 run on this newest type of hardware, as well as on ARM Windows machines. This will only be usable by LWJGL3, not the older - "legacy desktop" LWJGL2. + "legacy desktop" LWJGL2. LWJGL2 does appear to work via MacOS "Rosetta" emulation, though. - Desktop should mostly be preferred if you need to also depend on gdx-tools, such as if you need to run the texture packer at runtime. Some machines have issues with an inconsistent or very high framerate with LWJGL3, and using the "Legacy" desktop can fix that. This platform can also be less compatible with some JDKs, and @@ -54,11 +58,14 @@ for new projects generated by gdx-liftoff. 1.9.12 or higher. - The "less compatible" JDK issue manifests as a crash immediately at startup, with several warnings printed (which themselves don't matter), and a line right after them mentioning `ld.so` or a linking error. If you - encounter this, switch to AdoptOpenJDK or LWJGL3. + encounter this, switch to AdoptOpenJDK (bundling it with releases) or LWJGL3. - The warnings on startup when using (legacy) desktop are somewhat important to note; even though they say the application won't be allowed to start on future JDK versions, LWJGL 2 and 3 both will adapt to any inability to use certain internal APIs, and both should run perfectly fine on Java 16, even though it - defaults to blocking what the warnings mention. Actually, Java 16 shouldn't emit these warnings at all. + defaults to blocking what the warnings mention. Actually, Java 16 shouldn't emit these warnings at all. + - Even though you can't build a liftoff project currently with Java 16, you can still run the generated JAR + with Java 16, and this may be a good idea for distribution because of some speed and stability + improvements in that JVM release. - iOS should probably not be checked if you aren't running MacOS and don't intend to later build an iOS app on a Mac. It needs some large dependencies to be downloaded when you first import the project. - If you have a Mac that is set up for iOS development, please try to generate any project and see if it gets @@ -66,7 +73,10 @@ for new projects generated by gdx-liftoff. projects, but any extra usage info would help ensure that liftoff is ready for any libGDX usage. It isn't a typical usage for a [GitHub Issue](https://github.com/tommyettinger/gdx-liftoff/issues), but sending any feedback as an issue, whether it's "iOS projects work for me" or "iOS support is broken" would really help. - - Support for iOS should be better as of 1.9.14.3, but it could still use more testing. + - Support for iOS should be better as of 1.10.0, but it could still use more testing. There are changes in + libGDX 1.10.0 that should really help iOS projects out of the box; if you encounter screen trouble with any + template applications, first add a Viewport like you would for any other platform, and see if there is still + an issue. If you still have clipping or a smaller view area, post an issue. - Android should only be checked if you've set up your computer for Android development. Since gdx-liftoff uses Gradle 6.8.3, having an Android project present shouldn't interfere with other platforms or IDE integration, as long as your IDE supports Gradle 6.8.3 (Android Studio may in its most recent versions, but IntelliJ IDEA (and @@ -105,8 +115,9 @@ for new projects generated by gdx-liftoff. projects anyway; it has its own (excellent) project manager `lein` and a simple built-in manager. - In the Templates tab, you can select various sets of starting code that gdx-liftoff will generate in your new project. Classic will show a white screen with a pixel-style face when you run, so it can be good to verify that - a project works, while ApplicationAdapter is probably the easiest to bring an existing game into. - - In Advanced, you can set the libGDX version (it defaults to 1.9.14, but can be set lower or higher) and + a project works, while ApplicationAdapter is probably the easiest to bring an existing game into. The super-koalio + demo is from libGDX's tests, and may act as a good way to test input and basic graphics in a new project. + - In Advanced, you can set the libGDX version (it defaults to 1.10.0, but can be set lower or higher) and various other versions, including the default Java compatibility. Typically, `Java version` is the minimum across all platforms, and should be 7 or more (8 is generally safe). You can set `Desktop Java version` to any version at least equal to `Java version`, and similarly for `Server Java version`; these only affect the Desktop/LWJGL3 and @@ -174,6 +185,11 @@ other projects or older versions. - In earlier versions, jcenter() was last in the list because of a different flaw it had that allowed impersonation. You may have guessed that I am not sad to see it shut down in favor of better alternatives. It's still annoying to have to deal with it closing on short notice, though. + - Gradle 7.0 is in my sights for the next version, but I'm specifically waiting for the next version of the + [Gretty Gradle Plugin](https://github.com/gretty-gradle-plugin/gretty), which should have compatibility with Gradle + 7.0 and should also function correctly in a multi-module project. Gretty is only used by the HTML target, so if you + don't target HTML, you can change one version in `gradle/wrapper/gradle-wrapper.properties` from `6.8.3` to `7.0` + if you want to try out Gradle 7.0 and maybe build with Java 16. ## Known Issues @@ -183,13 +199,13 @@ other projects or older versions. - Consider adding the third-party extension Guacamole to handle a special MacOS/LWJGL3 requirement (it needs `-XstartOnFirstThread` to be passed to the `java` command, but Guacamole can handle this for you and your users). + - Apps for end-users have to include a bundled JRE to be distributed via the Mac App Store, and it's generally a + good idea to distribute your JRE of choice, so you know what bugs to expect. If you bundle a JRE, you can set the + launcher to use `-XstartOnFirstThread`, and so don't need Guacamole for that. - Android hasn't been tested enough, and the generated manifest is probably not very good. - You can modify the manifest, and probably need to do so if you want to submit an app to the Play store. - Android Studio should have better support for recent Gradle versions if you use a beta release. - Android Studio should be at least version 4.0, but 4.1 is untested so far. - - The default release is libGDX 1.9.14, but various parts of the 3D model code, framebuffer handling (which affects a - lot), and iOS support in that release don't work. You should probably stick with 1.9.13 for now. You can select the - libGDX version from the Advanced tab in the current gdx-liftoff release. ## Credits diff --git a/build.gradle b/build.gradle index fa635678..f23e4c89 100644 --- a/build.gradle +++ b/build.gradle @@ -13,14 +13,22 @@ buildscript { } } -version = "1.9.14.4-SNAPSHOT" +version = "1.10.0.0" mainClassName = 'com.github.czyzby.setup.MainKt' jar { manifest { attributes 'Main-Class': mainClassName } + duplicatesStrategy(DuplicatesStrategy.INCLUDE) from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } } + exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA') + dependencies { + exclude('META-INF/INDEX.LIST', 'META-INF/maven/**') + } + doLast { + file(archiveFile).setExecutable(true, false) + } } repositories { @@ -38,5 +46,5 @@ dependencies { api "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion" api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" api "io.github.lukehutch:fast-classpath-scanner:2.21" - api "com.kotcrab.vis:vis-ui:1.4.9" + api "com.kotcrab.vis:vis-ui:1.4.11" } diff --git a/gradle.properties b/gradle.properties index c03d2f80..9bda8413 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ kotlinVersion=1.4.10 commonsExecVersion=1.3 -gdxVersion=1.9.13 +gdxVersion=1.10.0 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 442d9132..f371643e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/com/github/czyzby/lml/parser/impl/attribute/image/ScalingLmlAttribute.java b/src/main/java/com/github/czyzby/lml/parser/impl/attribute/image/ScalingLmlAttribute.java index f171a19c..96a73f32 100644 --- a/src/main/java/com/github/czyzby/lml/parser/impl/attribute/image/ScalingLmlAttribute.java +++ b/src/main/java/com/github/czyzby/lml/parser/impl/attribute/image/ScalingLmlAttribute.java @@ -1,6 +1,7 @@ package com.github.czyzby.lml.parser.impl.attribute.image; import com.badlogic.gdx.scenes.scene2d.ui.Image; +import com.badlogic.gdx.utils.ObjectMap; import com.badlogic.gdx.utils.Scaling; import com.github.czyzby.kiwi.util.common.Exceptions; import com.github.czyzby.lml.parser.LmlParser; @@ -22,18 +23,29 @@ public void process(final LmlParser parser, final LmlTag tag, final Image actor, actor.setScaling(parseScaling(parser, parser.parseString(rawAttributeData, actor))); } + private static final ObjectMap scalingMap = new ObjectMap<>(); + static { + scalingMap.put("fit", Scaling.fit); + scalingMap.put("fill", Scaling.fill); + scalingMap.put("fillX", Scaling.fillX); + scalingMap.put("fillY", Scaling.fillY); + scalingMap.put("stretch", Scaling.stretch); + scalingMap.put("stretchX", Scaling.stretchX); + scalingMap.put("stretchY", Scaling.stretchY); + scalingMap.put("none", Scaling.none); + } private static Scaling parseScaling(final LmlParser parser, final String parsedData) { try { - final Scaling scaling = Scaling.valueOf(parsedData); + final Scaling scaling = scalingMap.get(parsedData, Scaling.none); if (scaling != null) { return scaling; } } catch (final Exception exception) { Exceptions.ignore(exception); // Somewhat expected. Invalid name. } - for (final Scaling scaling : Scaling.values()) { - if (parsedData.equalsIgnoreCase(scaling.name())) { - return scaling; + for (final ObjectMap.Entry entry : scalingMap.entries()) { + if (parsedData.equalsIgnoreCase(entry.key)) { + return entry.value; } } parser.throwErrorIfStrict("Unable to find Scaling enum constant with name: " + parsedData); diff --git a/src/main/kotlin/com/github/czyzby/setup/config/configuration.kt b/src/main/kotlin/com/github/czyzby/setup/config/configuration.kt index 904049ae..709c3a8c 100644 --- a/src/main/kotlin/com/github/czyzby/setup/config/configuration.kt +++ b/src/main/kotlin/com/github/czyzby/setup/config/configuration.kt @@ -28,7 +28,7 @@ import com.kotcrab.vis.ui.widget.file.FileChooser @Component class Configuration { companion object { - const val VERSION = "1.9.14.4-SNAPSHOT" + const val VERSION = "1.10.0.0" const val WIDTH = 600 const val HEIGHT = 700 const val PREFERENCES_PATH = "gdx-liftoff-prefs" diff --git a/src/main/kotlin/com/github/czyzby/setup/data/libs/unofficial/ktx.kt b/src/main/kotlin/com/github/czyzby/setup/data/libs/unofficial/ktx.kt index 0afa87a5..715bd15c 100644 --- a/src/main/kotlin/com/github/czyzby/setup/data/libs/unofficial/ktx.kt +++ b/src/main/kotlin/com/github/czyzby/setup/data/libs/unofficial/ktx.kt @@ -11,8 +11,8 @@ import com.github.czyzby.setup.views.Extension * Current version of KTX libraries. * @author MJ */ -// this is a version behind, because 1.9.14-b1 depends on libGDX 1.9.14... -const val KTX_VERSION = "1.9.13-b1" +// this will need updating when KTX uses 1.10.0 +const val KTX_VERSION = "1.9.14-b2" /** * Kotlin utilities for Scene2D actors API. diff --git a/src/main/kotlin/com/github/czyzby/setup/data/libs/unofficial/thirdPartyExtensions.kt b/src/main/kotlin/com/github/czyzby/setup/data/libs/unofficial/thirdPartyExtensions.kt index 963ea238..85d2d82e 100644 --- a/src/main/kotlin/com/github/czyzby/setup/data/libs/unofficial/thirdPartyExtensions.kt +++ b/src/main/kotlin/com/github/czyzby/setup/data/libs/unofficial/thirdPartyExtensions.kt @@ -543,15 +543,14 @@ class RegExodus : ThirdPartyExtension() { /** * UI toolkit with extra widgets and a different theme style. * Check the vis-ui changelog for what vis-ui versions are compatible - * with which libGDX versions; vis-ui 1.4.9 is the default, and is - * compatible with libGDX 1.9.12 and 1.9.13, but not 1.9.14 or higher. + * with which libGDX versions; vis-ui 1.4.11 is the default. * You may need to skip a check: VisUI.setSkipGdxVersionCheck(true); * @author Kotcrab */ @Extension class VisUI : ThirdPartyExtension() { override val id = "visUi" - override val defaultVersion = "1.4.9" + override val defaultVersion = "1.4.11" override val url = "https://github.com/kotcrab/vis-ui" override fun initiateDependencies(project: Project) { diff --git a/src/main/kotlin/com/github/czyzby/setup/data/platforms/desktop.kt b/src/main/kotlin/com/github/czyzby/setup/data/platforms/desktop.kt index a1f85a77..5f328e0c 100644 --- a/src/main/kotlin/com/github/czyzby/setup/data/platforms/desktop.kt +++ b/src/main/kotlin/com/github/czyzby/setup/data/platforms/desktop.kt @@ -57,11 +57,20 @@ ${joinDependencies(dependencies)}} jar { archiveBaseName.set(appName) +// the duplicatesStrategy will matter starting in Gradle 7.0; this setting works. + duplicatesStrategy(DuplicatesStrategy.INCLUDE) dependsOn configurations.runtimeClasspath from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } +// these "exclude" lines remove some unnecessary duplicate files in the output JAR. + exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA') + dependencies { + exclude('META-INF/INDEX.LIST', 'META-INF/maven/**') + } +// setting the manifest makes the JAR runnable. manifest { attributes 'Main-Class': project.mainClassName } +// this last step may help on some OSes that need extra instruction to make runnable JARs. doLast { file(archiveFile).setExecutable(true, false) } diff --git a/src/main/kotlin/com/github/czyzby/setup/data/platforms/lwjgl3.kt b/src/main/kotlin/com/github/czyzby/setup/data/platforms/lwjgl3.kt index 7f26f72c..d91225e9 100644 --- a/src/main/kotlin/com/github/czyzby/setup/data/platforms/lwjgl3.kt +++ b/src/main/kotlin/com/github/czyzby/setup/data/platforms/lwjgl3.kt @@ -69,11 +69,20 @@ run { jar { archiveBaseName.set(appName) +// the duplicatesStrategy will matter starting in Gradle 7.0; this setting works. + duplicatesStrategy(DuplicatesStrategy.INCLUDE) dependsOn configurations.runtimeClasspath from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } +// these "exclude" lines remove some unnecessary duplicate files in the output JAR. + exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA') + dependencies { + exclude('META-INF/INDEX.LIST', 'META-INF/maven/**') + } +// setting the manifest makes the JAR runnable. manifest { attributes 'Main-Class': project.mainClassName } +// this last step may help on some OSes that need extra instruction to make runnable JARs. doLast { file(archiveFile).setExecutable(true, false) } diff --git a/src/main/kotlin/com/github/czyzby/setup/data/platforms/server.kt b/src/main/kotlin/com/github/czyzby/setup/data/platforms/server.kt index 3572cf98..efc65e21 100644 --- a/src/main/kotlin/com/github/czyzby/setup/data/platforms/server.kt +++ b/src/main/kotlin/com/github/czyzby/setup/data/platforms/server.kt @@ -43,11 +43,20 @@ ${joinDependencies(dependencies)}} jar { archiveBaseName.set(appName) +// the duplicatesStrategy will matter starting in Gradle 7.0; this setting works. + duplicatesStrategy(DuplicatesStrategy.INCLUDE) dependsOn configurations.runtimeClasspath - from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } + from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } +// these "exclude" lines remove some unnecessary duplicate files in the output JAR. + exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA') + dependencies { + exclude('META-INF/INDEX.LIST', 'META-INF/maven/**') + } +// setting the manifest makes the JAR runnable. manifest { attributes 'Main-Class': project.mainClassName } +// this last step may help on some OSes that need extra instruction to make runnable JARs. doLast { file(archiveFile).setExecutable(true, false) } diff --git a/src/main/kotlin/com/github/czyzby/setup/data/templates/official/superKoalio.kt b/src/main/kotlin/com/github/czyzby/setup/data/templates/official/superKoalio.kt index 18eed8e7..7f1921d8 100644 --- a/src/main/kotlin/com/github/czyzby/setup/data/templates/official/superKoalio.kt +++ b/src/main/kotlin/com/github/czyzby/setup/data/templates/official/superKoalio.kt @@ -103,9 +103,9 @@ public class ${project.basic.mainClass} extends InputAdapter implements Applicat // load the koala frames, split them, and assign them to Animations koalaTexture = new Texture("koalio.png"); TextureRegion[] regions = TextureRegion.split(koalaTexture, 18, 26)[0]; - stand = new Animation(0, regions[0]); - jump = new Animation(0, regions[1]); - walk = new Animation(0.15f, regions[2], regions[3], regions[4]); + stand = new Animation(0, regions[0]); + jump = new Animation(0, regions[1]); + walk = new Animation(0.15f, regions[2], regions[3], regions[4]); walk.setPlayMode(Animation.PlayMode.LOOP_PINGPONG); // figure out the width and height of the koala for collision diff --git a/src/main/kotlin/com/github/czyzby/setup/prefs/sdkVersionPreference.kt b/src/main/kotlin/com/github/czyzby/setup/prefs/sdkVersionPreference.kt index bc1d2888..a6b3901b 100644 --- a/src/main/kotlin/com/github/czyzby/setup/prefs/sdkVersionPreference.kt +++ b/src/main/kotlin/com/github/czyzby/setup/prefs/sdkVersionPreference.kt @@ -8,5 +8,5 @@ import com.github.czyzby.autumn.mvc.stereotype.preference.Property */ @Property("SdkVersion") class SdkVersionPreference : AbstractStringPreference() { - override fun getDefault(): String = "29" + override fun getDefault(): String = "30" } diff --git a/src/main/resources/templates/tabs/advanced.lml b/src/main/resources/templates/tabs/advanced.lml index 420bd18e..7a15a3aa 100644 --- a/src/main/resources/templates/tabs/advanced.lml +++ b/src/main/resources/templates/tabs/advanced.lml @@ -4,22 +4,22 @@ <:column column="1" growX="true" minWidth="50"/> <:column column="3" growX="true" minWidth="50"/> @gdxVersion - 1.9.13 + 1.10.0 @version 0.0.1 @javaVersion - @serverJavaVersion - @androidPluginVersion - 4.0.2 + 4.1.3 @desktopJavaVersion - @sdkVersion - @robovmVersion 2.3.12 diff --git a/version.txt b/version.txt index 5a7a5c2d..81c871de 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.9.14.3 +1.10.0