Skip to content

Commit

Permalink
Update to Gradle 8.10, really emphasize USE 17.
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyettinger committed Aug 15, 2024
1 parent 2f34479 commit ccaebb0
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ used to avoid vulnerable log4j versions, now that Gradle has updated and conside
libGDX 1.10.0 to improve behavior on iOS, and gdx-liftoff may need to apply some changes to template code
for iOS projects to work more cleanly with libGDX 1.10.0.
- Android should only be checked if you've set up your computer for Android development. Since gdx-liftoff uses
Gradle 8.5, having an Android project present shouldn't interfere with other platforms or IDE integration, as
long as your IDE supports Gradle 8.5 (current Android Studio and IDEA both support it).
Gradle 8.10, having an Android project present shouldn't interfere with other platforms or IDE integration, as
long as your IDE supports Gradle 8.10 (current Android Studio and IDEA both support it).
- **You must set your project's JDK to a version 17 or higher** to use Android, due to a new requirement of the
Android Gradle Plugin used by Android Studio and IDEA. JDK 17 is the most versatile option right now, because
it can be used with gdx-setup projects and Android projects. JDK 17 or 18 will work. You could have to
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ To generate a project, [download](https://github.com/libgdx/gdx-liftoff/releases
java -jar gdx-liftoff-VERSION.jar
```

**You must build with Java 17 or newer!** Android tools now require your installed JDK to be version 17 or higher.
Even if you target only desktop, the included [Construo](https://github.com/fourlastor-alexandria/construo) plugin needs
**You must build with Java 17 or newer!** Gradle's current version, as well as current Android tools, now require your
installed JDK to be version 17 or higher. Regardless of what platforms you target, Gradle 8.10 needs
a JDK with a version at least 17! You can still target other releases, as low as 8 typically, while building with any of
the JDK versions 17 and up. All stable target releases of Java from 8 to 22 work here now.
the JDK versions 17 and up. All stable target releases of Java from 8 to 23 work here now. We use Gradle 8.10 because it
will work out-of-the-box with Java 23 even before it has a final release (which will be soon, if not already complete).

If you have any trouble, you can try our [🐛Troubleshooting Guide🐛](Troubleshooting.md).

Expand Down Expand Up @@ -75,10 +76,13 @@ Gdx-Liftoff is a relatively straightforward GUI application.
- Click Generate, and let the magic happen.

After that you can open the project in the path you specified, or open it more quickly in IDEA if it's installed how
Liftoff can see it (using [JetBrains Toolbox](https://www.jetbrains.com/toolbox-app/), most likely).
Liftoff can see it (using [JetBrains Toolbox](https://www.jetbrains.com/toolbox-app/), most likely, though a manually installed IDEA can also be used).

If you want to use Kotlin, a Kotlin template is recommended (such as `Kotlin Logo`). The KTX libraries are all available
as third-party extensions; these aren't required for Kotlin projects, but they can be helpful.
If you want to use Kotlin, a Kotlin template is recommended (such as `Kotlin Logo`); these mention that they use "Kotlin
launchers" in their descriptions. The KTX libraries are all available as third-party extensions; these aren't required
for Kotlin projects, but they can be helpful. KTX and other Kotlin-based libraries need Kotlin enabled. Currently,
projects generated here default to using Kotlin 1.9.25, and not the newer, incompatible 2.x line. When more libraries
have had time to update to 2.x compatibility, Liftoff will update as well.

Some things are structured differently in Liftoff projects, compared to gdx-setup projects. Where gdx-setup puts almost
all configuration in `/build.gradle` (in the project root), including for subprojects like `android` or `html`, Liftoff
Expand Down
17 changes: 15 additions & 2 deletions Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ followed by any ways that help resolve those problems.

This guide is brand new, and will be added to as new solutions are found for problems.

### First things first, make sure you're using Java 17 or newer.

Seriously. Do this first. Many parts of a Gradle project will fail now if you are using too old of a JDK.
You can check this version in IntelliJ IDEA under File -> Project Structure. If you don't have any
JDKs that are version 17 or newer, go into SDKs in the sidebar, and click the `+` at the very top of the window. You can
then download a JDK, such as `Version: 17`, `Vendor: Eclipse Temurin`, which is a solid choice. You can also download a
GraalVM JDK if you want in this way, which enables using LWJGL3's native-image configuration much later on. You can have
many JDKs installed if you want, of various versions.

### Some older docs mention Gradle tasks using a "desktop" module.

This would include docs telling you to run a Gradle task like `desktop:run` or `desktop:dist`.
Expand Down Expand Up @@ -59,6 +68,8 @@ Well, install Java 17 or higher and try again. You may need to set your JDK in y
and then `Download JDK`. Android Studio doesn't provide as many ways to configure the JDK because it should include one
that works with the latest Android tools already.

I feel like I covered this one already...

### A Kotlin project that contains an Android module gives the message `jvm target compatibility should be set to the same Java version.`

This should be fixed in 1.12.0.1 by using toolchains, or in 1.12.1.7 using Kotlin's `jvmTarget` option; if that doesn't
Expand Down Expand Up @@ -149,7 +160,9 @@ 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`.
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
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
Expand Down Expand Up @@ -221,7 +234,7 @@ The iOS backend using Multi-OS Engine (MOE) seems to have some incompatibility w
goes back almost to 8.3. I'm not exactly clear on the nature of the incompatibility, other than it's supposed to be
fixed in the next major Gradle release (8.8 or 9.0). Because that won't release for some time, MOE has been temporarily
removed from Liftoff 1.12.1.7; it won't work in earlier versions unless you go back to 1.12.0.4 or downgrade Gradle
yourself to 8.3. This isn't an outcome I'm happy with, but it should get resolved eventually.
yourself to 8.3. This isn't an outcome I'm happy with, but it should get resolved eventually.

### In 1.12.1.8 and later, the default icons for Android projects look terrible!

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gdx/liftoff/Listing.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private Listing() {
new GWT(),
new Headless(),
new IOS(),
new IOSMOE(),
// new IOSMOE(),
new Lwjgl2(),
new Lwjgl3(),
new Server(),
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/gdx/liftoff/ui/dialogs/PlatformsDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private void populate(Table contentTable) {
table.defaults().left().spaceLeft(SPACE_LARGE);
addPlatform(table, ("headless"), prop.getProperty("headlessTip"));
addPlatform(table, ("teavm"), prop.getProperty("teavmTip"));
addPlatform(table, ("ios-moe"), prop.getProperty("ios-moeTip"));
// addPlatform(table, ("ios-moe"), prop.getProperty("ios-moeTip"));
addPlatform(table, ("lwjgl2"), prop.getProperty("lwjgl2Tip"));
addPlatform(table, ("server"), prop.getProperty("serverTip"));
addPlatform(table, ("shared"), prop.getProperty("sharedTip"));
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/gdx/liftoff/data/languages/Kotlin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import gdx.liftoff.views.JvmLanguage
@Suppress("unused") // Class accessed via reflection.
class Kotlin : Language {
override val id = "kotlin"
override val version = "1.9.22"
override val version = "1.9.25"

override fun initiate(project: Project) {
project.rootGradle.buildDependencies.add("\"org.jetbrains.kotlin:kotlin-gradle-plugin:\$kotlinVersion\"")
Expand Down
Binary file modified src/main/resources/generator/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/ui-data/defaults.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extensionsDefaultNames=
thirdPartyDefaultNames=
templateDefaultName=classic
groovyDefaultVersion=4.0.22
kotlinDefaultVersion=1.9.22
kotlinDefaultVersion=1.9.25
scalaDefaultVersion=2.13.8
libgdxDefaultVersion=1.12.1
javaDefaultVersion=11
Expand Down

0 comments on commit ccaebb0

Please sign in to comment.