![]() ![]() These scripts use the same template that Gradle uses for gradlew, so they should be pretty robust. In addition to these jars, we have two shell scripts, one for *nix and one for Windows. We can see that it has gathered all of the jars that are on our runtime classpath, including the new jar we've just built, echo-1.0.jar. This post isn't about the app itself, but we need something to build, so … 3Įnter fullscreen mode Exit fullscreen mode ![]() This is important to keep in mind, as you would need to make some code changes if you were using Gradle 6.x. Mine differs in that I will be explaining, step by step, how to achieve similar results with Gradle.Īll the code for this is on Github. The upshot is we turn a 1.5M jar into a 12K "fat" jar, shaving 99.2% off the final binary.Īs soon as I saw that number, 99.2, I remembered that Jake Wharton had written about a very similar experience nearly a year ago. We'll learn how to use the application and distribution plugins to build the app and bundle a distribution how to use the shadow plugin to turn it into a fat jar and how to use Proguard to minify the whole thing. It is instead the story of how to build such a thing with Gradle. Since time is money, I've estimated this might recoup $100,000 in lost developer productivity over the next 12 months. The Kotlin app that replaces it takes about 300ms to complete and I project we'll spend the next month cumulatively waiting on it less than 8 minutes. 1 The Gradle task took an average of 2min per build, and my team cumulatively spent 43 hours over the past month waiting for it to complete. Recently I took it upon myself to replace an intelligent-but-expensive Gradle task with dumb-but-cheap JVM app. Sometimes you need to solve a problem, and you really don't feel like doing it with bash.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |