25

So I've decided to go about converting a Java project that I've been working on to Kotlin a little bit at a time. I started out with basic entity classes converting them to simple `data class`es in Kotlin.

Eventually, I got to my first beast of a class to refactor. This class had over 40 service classes depending on it, so even a little hiccup would throw everything into chaos.

I finish all of the changes on all of the dependent classes, update the tests, and the configurations (as necessary), and I was finally ready to spin up the app to test for any breaking changes I may have introduced...

Well - I broke everything! But I was sure I couldn't have! So what the hell happened?

Turns out that as I was building my project with a Gradle watch, at one point something failed to compile, which threw an unhandled exception in the gradle daemon that was never reported.

So when I tried to run my app, gradle would continually re-throw the error in the app I asked it to run...

After turning the daemon off and on again, the app worked like a charm.

Comments
  • 2
    Just don't use Gradle. If you want dependencies, just stick to Maven.
  • 0
    @Gatgeagent it was actually a build process in a multi-project build that I had on a watch to auto-compile when I had saved changes to any file throughout the project. Not sure if maven has watchers, but that's one of the big reasons we use Gradle
  • 1
    Sounds like your codebase needs refactoring.
  • 0
    @Gatgeagent

    Why not? I guess gradle can have hiccups once in a while but its so powerful and flexible. Why the gradle hate?
  • 1
    @affanshahid Because the whole piece of software is a big hiccup.
  • 0
    @Gatgeagent

    How specifically? Genuinely curious since I havent had a lot of trouble... yet
  • 1
    @affanshahid Extremly slow, extremly unstable, hell on earth to configure, it's not even able to run without all the dependencies, even if they're unused or something like that. The only reason why this bullshit still exists, is because it's used as dependency management in the Android App Development examples. Come on, Gradle locks every second file you have, compilation time is incredible slow, it compiles everytime you run something, compiles wheter you make changes or not, and when you generate a signed Android app, you need to wait for it to (slowly) compile everything, just to tell you that the password doesn't match. The so-called "build configuration" is not fucking declarative, it's a plain freaking program. You will probably be able to configure that in the non-configurarion configuration, but I do write Java/Python/Kotlin, not fucking Gradle build scripts which just don't care what shit you write in there, it will always do something different than what it's supposed to do.
  • 1
    @affanshahid personally, Gradle is built on great intentions and over-engineering. When you have it doing only a couple of things, it's the greatest thing since Maven. When you start mashing plug-ins together to lint your code, check for bugs, update your changelog , and things like that, that's when Gradle starts to get irritating.

    That said - I still love Gradle more than Maven!
  • 0
    @thatadamedwards

    Makes sense 👍🏻
    Though do you have the option of another tool for all the things you mentioned?
  • 1
    @affanshahid honestly, the number of times that I run into issues with gradle are so few, I wouldn't bother. This is the biggest issue I've had with it in the 4 years I've been using it. I'm not that upset with it.
Add Comment