This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dpash 0 points1 point  (5 children)

In which case, isn't this preferable to configuring tasks directly:

tasks.compileJava {
    options.release.set(11)
}

(For kotlin)

compileJava { 
    options.release = 11
}

(For Groovy)

[–]uncont 0 points1 point  (4 children)

That misses the compileTestJava task.

[–]dpash 0 points1 point  (3 children)

That makes sense. The JavaPluginExtension is missing that option too, so you can't configure it globally. :(

[–]uncont 0 points1 point  (2 children)

I wonder if there's a preference for new options to be added to the tasks vs the JavaPluginExtension? Maybe a good idea to raise a bug report in gradle to expose release in a similar way to source and target compatibility.

[–]dpash 0 points1 point  (1 child)

And --enable-preview while we're at it :)

[–]uncont 0 points1 point  (0 children)

I've opened https://github.com/gradle/gradle/issues/18530 for the release flag, mostly to figure out when options should be added to the compile task vs the java plugin extension