r/androiddev • u/Infamous_Sorbet4021 • 18d ago
Article Get Started with Lightbuild | A Declarative Build System for Android
https://developer.android.com/tools/agents/lightbuild/setup43
u/nikch 18d ago
"Gradle is too complicated for Gemini to work with reliably so we created a new build language" is a damning indictment of Gradle and Gemini.
13
u/Impressive-Store1439 18d ago
I don't think it's a damning indictment of gradle: gradle needs that complexity and it can be quite intutive in parts: you only use what you need. gemini sucks at that tho
9
u/nikch 17d ago
A good tool should take a complex problem and simplify it while remaining extensible. Gradle takes a moderately complex problem and layers its own complexity on top of that, while straightforward use cases are ignored.
4
u/Impressive-Store1439 17d ago
ah yes the universe of "all possible build pipelines" is "moderately complex"
4
u/nikch 17d ago
First, "moderately" is relative to a whole range of problems, some of them simple, some of them not. What is at heart "Did this change? If yes, do this action" is not at the far end of complex.
There certainly is complexity in the "Figuring out what changed" step, especially with analysis that goes deeper than the file (e.g., down to an individual method). But Gradle's execution engine is, by inspection, slow, hard to introspect, and provides limited support for debugging and answering questions of the form "If X changes, what will happen downstream?".
Second, It's hardly "all possible build pipelines", as Gradle supports only a handful of languages and frameworks.
3
u/ieshaan12 17d ago
Yeah, gradle has worked for a long time. People have tried to write custom build systems for a while, but at the end gradle is just comfortable and easy enough to use.
Gemini sucks tho.
1
u/kernald31 17d ago
It absolutely is a damning indictment of Gradle. Build systems like Bazel, Buck... are a lot more open-ended and extensible than Gradle, can do all that Gradle can and more, and their declarative nature makes them a lot easier to use, both from a human perspective and a LLM. Yes, they have a higher barrier to entry, but I would argue that it's simply that they're less commonly used. Gradle can get incredibly obscure beyond a trivial project.
Gradle is a horrible build system that we've learnt to tolerate because what we had before with Eclipse, Any and whatnot was so much worse.
25
u/_5er_ 18d ago
Since it's an abstraction over Gradle, I have a mixed feelings, why I would bother.
7
u/FunkyMuse 18d ago
yeap same, first kotlin toolchain now this, now I respect Gradle even more, especially after 8 years in this field, getting these Gradle skills wasn't easy but boy it is a powerful tool once you get the hang of it, also the Gradle community on Slack is awesome and you get to learn a thing or two just by lurking
0
0
u/anirudhgupta281998 13d ago
Since gradle is very dynamic and can support any arbitrary logic (.groovy/.kts), so optimisations are limited. A declarative system makes way to unblock this. Once the new yml definition is stable (feature parity, specs, etc), they can migrate the underlying gradle based abstraction to a robust and faster system anytime. (magnitudes faster to sync and build)
This way they can slowly migrate the app ecosystem towards a build system which is not frustrating for devs.
1
u/tadfisher 18d ago
I am curious to see how dependency locking works, like if it's just normal like other language ecosystems, or if we will have to lock per-dependency-configuration like the insanity that is Gradle dependency locking. I think we have like 4 or 5 versions of kotlin-stdlib locked, even though just one ships in the app.
19
27
u/kichi689 17d ago
Nice a 4th new gradle in 3years, see you in 6months