Slackbot
12/01/2022, 11:38 PMChris Lee
12/01/2022, 11:40 PMEric Kolotyluk
12/01/2022, 11:42 PMjava {
toolchain {
languageVersion.set(JavaLanguageVersion.of(19))
}
}
Is there some option I can set there for --enable-preview
?Chris Lee
12/01/2022, 11:43 PMtasks.withType(JavaCompile).each {
it.options.compilerArgs.add('--enable-preview')
}
Eric Kolotyluk
12/01/2022, 11:44 PMChris Lee
12/01/2022, 11:44 PMtasks.withType<JavaCompile>().configureEach {
options.compilerArgs.add("--enable-preview")
}
Eric Kolotyluk
12/01/2022, 11:45 PMChris Lee
12/01/2022, 11:46 PMEric Kolotyluk
12/01/2022, 11:50 PMtasks.withType<JavaCompile>().configureEach {
options.compilerArgs.add("--enable-preview")
}
works, so does
tasks {
compileJava {
options.compilerArgs.add("--enable-preview")
}
}
I was close, but I used
options.allCompilerArgs += "--enable-preview"
instead of
options.compilerArgs.add("--enable-preview")
Chris Lee
12/01/2022, 11:50 PMEric Kolotyluk
12/01/2022, 11:51 PMChris Lee
12/01/2022, 11:51 PMEric Kolotyluk
12/01/2022, 11:52 PMEric Kolotyluk
12/01/2022, 11:53 PMChris Lee
12/01/2022, 11:53 PMEric Kolotyluk
12/01/2022, 11:55 PMman
pages.
Unless you commit to learning only the Gradle way, they have no use you.Eric Kolotyluk
12/01/2022, 11:56 PMEric Kolotyluk
12/01/2022, 11:57 PMEric Kolotyluk
12/02/2022, 12:00 AMChris Lee
12/02/2022, 12:01 AMEric Kolotyluk
12/02/2022, 12:02 AMChris Lee
12/02/2022, 12:04 AMEric Kolotyluk
12/02/2022, 12:05 AMVampire
12/02/2022, 12:43 AMinit
just follow the convention of having an empty root project and the logic in a subproject so you can easier just add a second subproject if you need it without having to shift things around.
The style of documentation is just terribleThat's a pretty harsh statement. In my opinion the docs are pretty great and useful and always help me finding what I need. They might be terrible for you though, and if you see room for improvement, don't hesitate to open improvement requests in the issue tracker. Gradle also recently hired a documentation engineer which focus is to improve the documentation experience, so maybe the docs get even better in the forseeable future. You should also fill in his questionaire about the docs to get your voice heard: https://gradle-community.slack.com/archives/CAHSN3LDN/p1669727966540559
Gradle doc'n is too abstract, and ignores people who learn by concrete...Are you aware that there is not only the userguide, but also example projects and tutorials that are more hands-on?
Eric Kolotyluk
12/02/2022, 1:05 AMVampire
12/02/2022, 1:31 AMPeople seem unable to acknowledge other people have trouble with Gradle.Sure I acknowledge that. Would be strange if I didn't, given the time I spend helping people with there problems here and in the forums every day. I just mentioned that you cannot call the docs terrible in general, when there are many people out there, that have the opposite experience. Of course they might be terrible for you and I acknowledged that too and suggested how you can get them improved. 🙂
I am aware that there are example projects, but they are hard to findAre they? There is a dedicated point for them in the left navigation bar, leading to https://docs.gradle.org/current/samples/index.html where they are all listed.
and generally pretty poorIf you think they are poor, again, please send improvement suggestions to the issue tracker so they can get improved. I cannot say anything about the quality as I never looked at the sample projects in detail.
One major problem with Gradle is there are two DSLsI do not fully disagree. In the beginning there was only Groovy as it was at the time most probably the best way to write a custom DSL. But it has major drawbacks and then Kotlin was invented and provided a way to write a much better DSL to use (imho). But you cannot simply switch over, or all existing builds would not work anymore, that would be fatal. Just always use Kotlin DSL and you will save a lot of headache.
and from project to project, document to document, typically, only one DSL is used.Well, in projects it is better if only one is used, except maybe for a transition phase, everything else would be just more confusing. Good documents - like the Gradle documentation (at least in that regard even if you otherwise disagree) - should simply show both variants, so that a reader does not have to translate. But if someone writes a blog or SO answer, he typically is too lazy to do that, or the document is simply too old to have Kotlin DSL, but then it is outdated and most probably not valid anymore anyway. Blame that to the individual author, not Gradle. 😄
Eric Kolotyluk
12/02/2022, 1:32 AMVampire
12/02/2022, 1:33 AM