Skip to content

Commit

Permalink
Start updating to 1.13.0...
Browse files Browse the repository at this point in the history
GWT will need some work to stop using the custom backend.
  • Loading branch information
tommyettinger committed Oct 17, 2024
1 parent 9a76559 commit c11f7af
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 23 deletions.
16 changes: 10 additions & 6 deletions GWT.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ way to work around GWT's oddities, though.
- `String.format()`, and in fact anything that uses `Formatter`, is just not present.
- You can partly get around this by using the third-party extension Formic, which provides a `Stringf.format()`
function that acts exactly like `String.format()` on most platforms, or mostly like it on GWT.
- Formic may or may not work on TeaVM. It looks like most of the code for
Formatter has been present on TeaVM for a while, so you may be able to
directly use Formatter if String.format() doesn't work, but it might be
fine already. Formic could also just fail there, since it's meant for GWT.
- Regular expressions are poorly-supported by GWT out-of-the-box, though libGDX adds part of the `java.util.regex`
package to the standard library. When regular expressions are available, they use JS behavior on GWT, and regular
desktop-JVM behavior on desktop. [JS behavior is missing some key features.](https://www.regular-expressions.info/javascript.html)
Expand All @@ -72,11 +76,11 @@ way to work around GWT's oddities, though.
- `Integer.rotateRight(num, amt)` is equivalent to `(num << 32 - amt | num >>> amt)`.

GWT has had a few new releases since GDX-Liftoff's debut. For a very long time, libGDX used GWT 2.8.2, which was
compatible up to Java 8. This is what's used by libGDX 1.12.1, unless you use the alternative backend that Liftoff
defaults to. The alternative backend is built on MrStahlfelge's work isolating the libGDX backends for easier expansion,
and it currently can use GWT 2.10.0 or 2.11.0 with libGDX 1.12.1 . Both of these newer GWT versions are compatible with
Java 11 to some extent, allowing you to use `var` and parts of the new API in Java 11.

[The part of the standard library that GWT 2.8.2 emulates can be viewed here.](https://github.com/gwtproject/gwt-site/blob/44d0195c987929871fb4710337bae74d195be1e4/src/main/markdown/doc/latest/RefJreEmulation.md)
compatible up to Java 8. This is what's used by libGDX up to and including 1.12.1, unless you use the alternative backend that Liftoff
defaulted to. The alternative backend isn't needed or used as of libGDX 1.13.0, since this version is up-to-date on GWT 2.11.0. This newer GWT version is compatible with
Java 11 to some extent, allowing you to use `var` and parts of the new API in Java 11. If you're using an earlier version of Liftoff, such as 1.12.1.17 or earlier, then that uses libGDX 1.12.1 and the alternative backend to still use GWT 2.11.0 .

[The part of the standard library that GWT 2.11.0 emulates can be viewed here.](https://github.com/gwtproject/gwt-site/blob/becd13c39f53d45e55233ac29c8dfa7ebcf92dca/src/main/markdown/doc/latest/RefJreEmulation.md)

In case you need this information for compatibility with older libGDX versions,
[the part of the standard library that GWT 2.8.2 emulates can be viewed here.](https://github.com/gwtproject/gwt-site/blob/44d0195c987929871fb4710337bae74d195be1e4/src/main/markdown/doc/latest/RefJreEmulation.md)
13 changes: 5 additions & 8 deletions Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ code, which is built on [czyzby's code](https://github.com/czyzby/gdx-setup), gi
This allows new projects to "just work" on machines where Java 8 through 21 could be the default, and the moderate amount of configuration
changes needed for Gradle 8.x are all handled by gdx-liftoff. Thanks to the Gretty plugin's latest release, Gradle 8.x
now works well with the HTML platform, without additional quirky configuration (earlier versions of Liftoff needed that).
Currently, gdx-liftoff projects depend on libGDX 1.12.1 by default, and allow using earlier versions or snapshots as well.
The current version of libGDX is 1.12.1 . You can choose any released version of
Currently, gdx-liftoff projects depend on libGDX 1.13.0 by default, and allow using earlier versions or snapshots as well.
The current version of libGDX is 1.13.0 . 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. If you're updating from an older libGDX version, see
[the official migration guide](https://libgdx.com/news/2021/04/the-ultimate-migration-guide).
Expand Down Expand Up @@ -52,7 +52,7 @@ used to avoid vulnerable log4j versions, now that Gradle has updated and conside
- LWJGL3 is almost the same as LWJGL2, 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.12.1) also supports ARM Linux on desktop platforms.
1.13.0) also supports ARM Linux on desktop platforms.
- The new ARM Macs are now supported as of libGDX 1.11.0 or later when using the LWJGL3 backend.
LWJGL2 does appear to work via macOS "Rosetta" emulation, though.
- LWJGL2 should mostly be preferred if you need to also depend on gdx-tools, such as if you need to run the
Expand Down Expand Up @@ -116,10 +116,7 @@ used to avoid vulnerable log4j versions, now that Gradle has updated and conside
would on desktop, and `long` not being visible to reflection. See [this small guide to GWT](https://libgdx.com/wiki/html5-backend-and-gwt-specifics)
for more. It's very likely that you won't notice any difference unless you try to make behavior identical on GWT
and other platforms, and even then there may be nothing apparent.
- GWT 2.11.0 is available but doesn't integrate with libGDX by default; there's a third-party [replacement to the
official GWT backend](https://github.com/tommyettinger/gdx-backends#112101) that supports it with libGDX
1.12.1. Using GWT 2.11.0 allows Java 11's `var` keyword to be used, plus other Java 11 features, and
allows using a little of the standard library. The third-party 2.11.0 backend is currently used by default.
- GWT 2.11.0 is available and used by default with libGDX 1.13.0 .
- For dependencies, you don't need libGDX checked (the tool is ready to download libGDX and set it as a
dependency in all cases).
- There are lots of potential dependencies you can add, some official but most third-party (unofficial).
Expand All @@ -145,7 +142,7 @@ used to avoid vulnerable log4j versions, now that Gradle has updated and conside
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. 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.12.1, but can be set lower or higher) and
- In Advanced, you can set the libGDX version (it defaults to 1.13.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 LWJGL2/LWJGL3 and
Expand Down
4 changes: 2 additions & 2 deletions Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ likely grow.
Liftoff 1.12.1.6 is the first to use GWT 2.11.0, which is almost entirely backwards-compatible... at an API level,
at least. It has different dependencies for `gwt-user`, both because the version is newer, and that JAR is provided in
a different "group" -- `org.gwtproject:gwt-user:2.11.0` instead of the older `com.google.gwt:gwt-user:2.8.2`. This
shouldn't be a problem in the libGDX release after 1.12.1, since it should use GWT 2.11.0, but the fixes here won't
isn't a problem in libGDX 1.13.0, since it uses GWT 2.11.0, but the fixes here won't
cause problems if they remain in a project updated to a newer libGDX version.

Before I start with the general solution, there's often a much easier one: for libraries that Liftoff has in its
third-party extensions, any that need special treatment for GWT should already have that taken care of. The rest of this
is only needed if a library you want to use isn't known to Liftoff and depends on an older GWT version.

Any library dependencies, not installed via a checkbox in Liftoff, that have code specifically for GWT, and depend
either directly on gwt-user (or gwt-dev) or indirectly via any version of `com.badlogicgames.gdx:gdx-backend-gwt`, can
either directly on gwt-user (or gwt-dev) or indirectly via any version of `com.badlogicgames.gdx:gdx-backend-gwt` before 1.13.0, can
trigger version conflicts from two different releases of GWT. That means if you are trying to use 2.11.0, but 2.10.1,
2.10.0, 2.9.0, 2.8.2, or 2.8.0 gets into the dependencies, because the groups are different, the older version won't be
replaced by the newer one. The solution is to exclude gwt-user (or the gdx-backend-gwt in the `com.badlogicsgames.gdx`
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
org.gradle.daemon=false
org.gradle.jvmargs=-Xms512M -Xmx1G -Dfile.encoding=UTF-8 -Dconsole.encoding=UTF-8
liftoffVersion=1.12.1.17
liftoffVersion=1.13.0.0-SNAPSHOT
#kotlinVersion=1.9.25
kotlinVersion=2.0.20
gdxVersion=1.12.1
gdxVersion=1.13.0
lmlVersion=1.10.1.12.1
#visUiVersion=1.5.3
visUiVersion=1aef382077
commonsExecVersion=1.3
lwjgl3Version=3.3.3
lwjgl3Version=3.3.4
nfdVersion=3.3.4
iconizerVersion=0.1.0
2 changes: 1 addition & 1 deletion src/main/kotlin/gdx/liftoff/config/Configuration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import gdx.liftoff.views.widgets.ScrollableTextArea
@Suppress("unused") // Fields accessed via reflection.
class Configuration {
companion object {
const val VERSION = "1.12.1.17"
const val VERSION = "1.13.0.0-SNAPSHOT"
const val WIDTH = 600
const val HEIGHT = 700
const val PREFERENCES_PATH = "gdx-liftoff-prefs"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/templates/tabs/advanced.lml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<:column column="1" growX="true" minWidth="50"/>
<:column column="3" growX="true" minWidth="50"/>
@gdxVersion
<textField id="gdxVersion" tooltip="@gdxVersionTip|$gdxVersion">1.12.1</textField>
<textField id="gdxVersion" tooltip="@gdxVersionTip|$gdxVersion">1.13.0</textField>
@version
<textField id="version" tooltip="@versionTip" row="true">1.0.0</textField>
@javaVersion
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/ui-data/defaults.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
liftoffVersion=1.12.1.17
liftoffVersion=1.13.0.0-SNAPSHOT
projectNameDefault=YourProjectName
packageNameDefault=io.github.some_example_name
mainClassNameDefault=Main
Expand All @@ -12,7 +12,7 @@ templateDefaultName=classic
groovyDefaultVersion=4.0.22
kotlinDefaultVersion=2.0.20
scalaDefaultVersion=3.5.0
libgdxDefaultVersion=1.12.1
libgdxDefaultVersion=1.13.0
javaDefaultVersion=11
appDefaultVersion=1.0.0
androidPluginDefaultVersion=8.1.4
Expand Down

0 comments on commit c11f7af

Please sign in to comment.