Slackbot
12/15/2022, 8:36 PMVampire
12/15/2022, 8:52 PMEric Kolotyluk
12/15/2022, 9:44 PMinclude ':observability:bundle'
project(':observability').projectDir = file('../observability')
project(':observability:bundle').projectDir = file('../observability/bundle')
and defined in build.gradle
dependencies {
implementation project(':observability:bundle')
}
Recursively building includes running the assemble
and check
tasks... consequently running tests.
This is the behaviour I have always seen in Gradle.
I assumed this was normal as that is similar to the behaviour of Maven.
I am considering simply making observability-bundle a library and pushing it to an artifact repository, decoupling it from settings.gradle
but was wondering if there was something more simple.Vampire
12/15/2022, 9:53 PMbuild
task of the root project like ./gradlew :build
, then only the tests of the root project are executed unless you configure it differently. If you on the other hand do ./gradlew build
you are telling Gradle to run the build
task in all projects that have it, whether there is a dependency or not is irrelevant.Eric Kolotyluk
12/15/2022, 9:55 PM./gradlew build
I assure you, it is recursive.Vampire
12/15/2022, 9:58 PMbuild
task in all projects that have one, as you don't specify which one you want to run explicitly. This is independent from any dependency declarations and there is no recursiveness.Eric Kolotyluk
12/15/2022, 10:08 PMEric Haag
12/15/2022, 10:13 PM./gradlew build
and ./gradlew :build
. The former runs the build
task of every project (not necessarily recursively) while the latter runs build
only for the root project. It sounds like you're expecting only the build
task of the root project to run, so you should be using ./gradlew :build
.Eric Kolotyluk
12/15/2022, 10:14 PM./gradlew build
or ./gradlew clean build
Eric Kolotyluk
12/15/2022, 10:16 PM./gradlew clean build
If you suggest we change that, then I will run it by the team.Eric Kolotyluk
12/15/2022, 10:18 PMEric Haag
12/15/2022, 10:35 PMOur team are not at all Gradle experts... so things are not usually done well...Understood. I think you've come to the right place for help. š
If you suggest we change that, then I will run it by the team.I am not suggesting anything. I just wanted to see if I could help explain the subtle difference between
./gradlew <task>
and ./gradlew :<task>
.Eric Haag
12/15/2022, 10:36 PMEric Kolotyluk
12/15/2022, 10:42 PMEric Haag
12/15/2022, 10:48 PMEric Kolotyluk
12/15/2022, 10:50 PMVampire
12/15/2022, 10:53 PMGradle Wrapper introduces problems I have never encountered in Maven cause there is no Maven Wrapper.Well, that's not fully correct. They copied the concept from Gradle like they copied some other concepts. You don't need to use the wrapper, but imho any project should use it. Without the wrapper you have the problem you have with Maven, that using different versions of Maven to run the build can produce different results or even break. While with the wrapper the version of Gradle used to run the build is specified explicitly, so the build behaves reproducibly and well defined. š
The worse problem is trying to upgrade Gradle wrapper.I never had problems with that, and I use Gradle since pre 1.0. I'm curious, what problems did you have specifically?
It fails to upgrade if the configuration files do not conform to what the new version wantsUnless I get you wrong, that sounds very unlikely. If you call the wrapper task, the configuration file is simply overwritten. And the format didn't change as long as I can remember, just 2 or 3 possible keys added, but nothing incompatible. š
Vampire
12/15/2022, 10:54 PMEric Kolotyluk
12/15/2022, 10:55 PMI never had problems with that
Eric Haag
12/15/2022, 10:58 PMEric Haag
12/15/2022, 10:59 PMThe build scripts do have to be valid before performing an upgrade of the wrapperI should say, to perform an automated wrapper upgrade (e.g. using Gradle). You always have the option of doing a manual upgrade of the wrapper yourself.
Vampire
12/15/2022, 11:01 PMThe second problem with Gradle is people telling me
> I never had problems with thatThat's probably more a sign that you need to provide more information or an MCVE, so that your problem can be reproduced. š
Eric Kolotyluk
12/15/2022, 11:01 PMEric Kolotyluk
12/15/2022, 11:02 PMVampire
12/15/2022, 11:03 PMVampire
12/15/2022, 11:04 PMVampire
12/15/2022, 11:06 PMEric Kolotyluk
12/15/2022, 11:08 PMBtw. if you are unhappy with what I say or how I say it, just tell me and I'll just stop answering your questions if you prefer.
Would also be fine with me.is not effective.
Vampire
12/15/2022, 11:13 PMEric Kolotyluk
12/15/2022, 11:15 PMEli Graber
12/16/2022, 2:19 AMJavi
12/16/2022, 1:29 PMtony
12/16/2022, 5:56 PMAmanda
Eric Kolotyluk
12/16/2022, 6:45 PMVampire
12/17/2022, 3:43 AMWhen someone at work finds a problem in my code, writing, etc., I thank them, "Good catch. Thanks." I never see that in forums such as this.Well, I see it regularly and also say it regularly. That you don't see it does not mean it is not there.
I see the value in Gradle, but I also notice it is still an immature product with many rough edges. People only want to talk about how wonderful Gradle is, and they get offended when someone suggests Gradle could be improved. I would like to see Gradle improve, and I have many insights into how it could be improved.I never said anything different. Of course Gradle has still problems - like any software does. I'm also the author of many Gradle issues and Gradle PRs, so I obviously know very well that Gradle has much room and need for improvement still. If someone is offended by the suggestion that Gradle could be improved, that's just ridiculous. That doesn't change that in my opinion Gradle is the best build tool available even in its current state. But that does by no means mean that it cannot or does not have to improve.
tomas-mrkvicka
12/18/2022, 9:06 AM