Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update builds to Java 16 #1300

Closed
wants to merge 1 commit into from
Closed

Conversation

leonard84
Copy link
Member

No description provided.

@leonard84
Copy link
Member Author

Will require Gradle 7 gradle/gradle#13481 to work

@Vampire
Copy link
Member

Vampire commented Mar 18, 2021

Best would be to decouple the version you run Gradle with from the version you compile and run your sources with using the Java toolchains feature available since 6.7 or so.

@leonard84
Copy link
Member Author

Thought about that, but that requires installing multiple JDKs in the actions and that is why I didn't do it yet.
We should probably compile spock-core always with 8 and then run the other modules with JDK to test, the question is what to use for gradle itself? JUnit used latest (15) for gradle, but we can stay on 8.

@Vampire
Copy link
Member

Vampire commented Mar 18, 2021

but that requires installing multiple JDKs in the actions

Actually not, Gradle can auto provision what you request. But it might be faster if you use the setup-java action maybe, or not. Needs to be tested.

JUnit used latest (15) for gradle, but we can stay on 8.

Shouldn't matter too much, as long as it is compatible with the used Gradle version. But of course newer versions could be better or faster? But probably not too significant.

@szpak
Copy link
Member

szpak commented Mar 18, 2021

Using the Java toolchain available in Gradle is one option. However, with some tweaks (such as compile -> api) Spock's build configuration should (*) be compatible with Gradle 7, so we could use 7.0-M2 (which is still Java 8 compatible) and eventually switch to 7.0-final once available.

(*) - haven't tested, there could be some issues with plugins.

@Vampire
Copy link
Member

Vampire commented Mar 18, 2021

One has little to do with the other. compile is deprecated since many years and should be replaced with implementation for implementation dependencies and api for api dependencies.

Java Toolchains decouple the version you use to run Gradle from the version/s you use to compile and run your code and you can even use different versions for different tasks. This way you can always update to any Java version for your tests and so on independent from what Grale supports and can also update Gradle independent from its minimum version if you need a older one for your code. It's simply wrong to have to use the Java version you need for your project to be used to run the build tool and Java toolchains fix this.

Btw M3 is current, not M2. ;-)

@szpak
Copy link
Member

szpak commented Oct 6, 2021

Superseded by #1366.

@szpak szpak closed this Oct 6, 2021
@leonard84 leonard84 deleted the java-16 branch October 10, 2021 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants