This message was deleted.
# community-support
s
This message was deleted.
c
Use compileOnly
๐Ÿ™„ 1
e
Another problem with Gradle is that most internet documentation is out-of-date because Gradle keeps changing the names of things but cannot tell you that at run time...
j
compile was deprecated long time ago
I have checked, 2018
e
Yes, but the internet is full of examples still using it... Many internet articles have no date attached, so you cannot know how current they are... I guess there is no way for Gradle to emit a diagnostic: compile not supported, do you mean 'complileOnly'
c
Gradle did emit deprecation warnings for quite a few versions on this, before fully removing support.
e
That is not good enough. As I stated, there is abundant stale knowledge on the internet, and generally, Gradle has some of the poorest diagnostics I have ever seen in a tool. Also, the page https://docs.gradle.org/current/userguide/declaring_dependencies.html is horrible... just a mish-mash of random thoughts. Why is there no canonical list of examples?
As a rule, diagnostics should serve to guide people toward solutions and not simply make vague statements that lead to confusion. Another part of the problem is that Gradle is evolving too quickly, and the diagnostics and documentation do not consider this.
c
compile
was deprecated for years before being removed. At some point things move on.
The usage of the
compile
and
runtime
configurations in the Java ecosystem plugins has been discouraged since Gradle 3.4.
e
I think you are missing the point... the internet has much stale knowledge... A useful diagnostic would be "Do you mean 'compileOnly'?" Are you advocating that Gradle should have abstruse diagnostics?
On the page https://docs.gradle.org/current/userguide/declaring_dependencies.html the string
compileOnly
does not appear.
c
It had those diagnostic messages - for many years. Over time that baggage builds up, it cannot persist forever, becomes a drag on the code base. Using Kotlin DSL for scripts provides completion, error highlighting, deprecation warnings, etc.
that page is a general overview of declaring dependencies.
compileOnly
is a java-specific configuration, documented accordingly.
e
The bottom like is, Gradle is the most frustrating tool I use on a daily basis. I am trying to suggest ways of improving it, but there is always some reason not to improve it.
https://docs.gradle.org/current/userguide/java_plugin.html is very helpful, thank you... I would never have known about this using regular methods such as google search
c
np. itโ€™s helpful to wade through the entirety of the Gradle docs for awareness of what is there.
and ignore the ancient StackOverflow posts ๐Ÿ˜‰
๐Ÿคฃ 1
e
It would be helpful if the Gradle documentation were not so poorly written.
c
I actually find it generally useful for common cases. I know you have some specific, non-idiomatic needs that make it a bit challenging.
e
We may have to hire you to overhaul our Gradle usage... Once my boss agrees to the clean-up project, I will be searching for consultants to hire...
e
I think gradle documentation is excellent if you already know where to look and what you're looking for, but need to know how to do something. Discoverability is a big issue, though with enough experience you start to get a feel for where to look
โœ… 1
v
Btw.
compileOnly
is not really an appropriate replacement.
compile
was more like
implementation
or
api
.
compileOnly
means it is only available at compile time, but not at runtime except if someone else provides is.
a
For upgrades itโ€™s worth checking the upgrade guide, where is a list of changes. For removal of compile you can check here. I hope that helps a bit.
v
It was not about upgrading though @Anze Sodja. It is about following outdated tutorials or SO answers that contain things that are simply not present anymore as they finished the deprecation cylce like the "compile" configuration.
a
My bad then
e
Increasingly, Google Search turns up garbage, especially out-of-date garbage... Too bad they can't use some AI to filter the garbage better and return relevant information... but then they would lose ad revenue wouldn't they...
j
Filter by last year (or even 1 month) in Google.
๐Ÿ‘€ 1