I hope that this can change some defaults. I'm a f...
# declarative-gradle
c
I hope that this can change some defaults. I'm a firm believer that a framework should default to the most common, and safest options 1. withJavadoc/withSources this should be the default, I'd find it odd not to want this unless you're doing something proprietary on a public server (and the former would still be true) 2. test suits should throw an error if no tests are present, this isn't even easy to do in gradle now. This is the default in build tools in many other languages. 3. test suites should be more verbose by default, see other langauges, and maybe even maven and the general junit defaults (I think) 4. prerelease's aren't expected by anyone as a default, so it'll need a cleaner way to handle it (I really need to make comments on why I'm excluding spotbugs)
Copy code
resolutionStrategy {
    componentSelection {
      all {
        val spotbugs = Regex("^spotbugs.*")
        if (!name.matches(spotbugs) && !candidate.module.matches(spotbugs)) {
          val nonRelease = Regex("^[\\d.]+-(M|ea|beta|alpha).*$")
          if (candidate.version.matches(nonRelease)) reject("no pre-release")
        }
👍 1
v
For point 2, just wait for Gradle 9. 🙂 Current output:
> Task :test
No test executed. This behavior has been deprecated. This will fail with an error in Gradle 9.0. There are test sources present but no test was executed. Please check your test configuration. Consult the upgrading guide for further information: https://docs.gradle.org/8.6/userguide/upgrading_version_8.html#test_task_fail_on_no_test_executed
👍 1
c
I don't recall (no promises my recollection is bad here) seeing any movement on this bug
v
What do you mean with movement? The behavior is deprecated in 8 and scheduled to become an error in 9.
c
there's a bug to fix this behavior. I don't recall seeing any updates
but my memory could be gharbage
v
Still not getting what you mean. What fix do you expect? Or what updates? It cannot be made an error before Gradle 9. So it is deprecated currently and waits for Gradle 9 to come, where it can be made an error.
It likely just one line that needs to be changed from "complain about deprecation" to "explode"
c
... there is an issue on github. I do not recall anyone mentioning this is going to be fixed
v
Well, Gradle says it. 😄
c
I wouldn't magically notice such things
gradle also complains about me using deprecated features because the gradle publish plugin uses deprecated features
I tend to ignore its warnings and they usually go away on their own
v
You usually really shouldn't 😄
And there is not movement on the issue you probably meant because it is closed as fixed with that deprecation cylce being started: https://github.com/gradle/gradle/issues/7452