Gradle + Kotlin = ⚡️ 🚀️

Gradle + Kotlin = ⚡️ 🚀️

Kotlin + Gradle: a technology combination sure to foster developer happiness and productivity.

Why Gradle is best for Kotlin development

You can use the official Kotlin Gradle Plugin from JetBrains to compile your Kotlin code to target JVM, Android, and JS.

image.png

Gradle has features you cannot get from other build tools: A highly-customizable dependency resolution engine, visual build inspection and debugging tools, and many work avoidance mechanisms.

These and other reasons are why Kotlin itself is built with Gradle Kotlin DSL and Gradle is the official build tool for Android.

Gradle Kotlin DSL: use the language you ❤️ for your build too

You can bring the elegance and type-safety of Kotlin to your automation. Using Kotlin and a compatible IDE for your build scripts bestows quick documentation, completion, error highlighting, and refactoring.

Kotlin DSL v1.0 is available in the Gradle 5.0 milestone. Read the Gradle Kotlin DSL Primer and follow the guide to migrating build scripts to Kotlin.

Keys to building happiness for Kotlin projects

"With great power comes great responsibility." These guides and references help you have the best experience building your Kotlin libraries and applications with Gradle:

  • Adhere to performance best practices — Builds can be more than an order of magnitude faster when incremental build, Kotlin build caching, and incremental annotation processing are used properly. Spend 1 hour following the performance guide to reap many hours saved.
  • Organize your sources for success — Following best practices on organizing Gradle projects not only sets healthy standards for discoverability, but also lets Gradle, Android, and Kotlin toolchains do less work (read: go faster).
  • Explore your build effectivelyWhy is my Kotlin code recompiled even with no changes? Where are these deprecation warnings coming from? There is no better tool for answering these questions than build scans.
  • Get help — Search StackOverflow and Gradle docs at gradle.org/help and leverage the Gradle forums for community help.
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,994评论 0 10
  • 01 在感情里,有一种状态比失恋分手吵架撕逼还虐心,那就是独角戏。 明明感觉你喜欢我,可你总是不表白,我鼓起勇气说...
    远近先生阅读 1,845评论 2 18
  • 魏武扬鞭下江东,烈火一战赤壁城。 可怜曹公百万师,空添周郎英雄名。
    搜狗丶你搜索得到真爱么阅读 226评论 0 1
  • 在计算机程序设计与计算机技术的相关文档中,术语 foobar 是一个常见的无名氏化名,常被作为“伪变量”使用。 是...
    Restar阅读 749评论 0 0

友情链接更多精彩内容