首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Gradle + Kotlin = ⚡️

Gradle + Kotlin = ⚡️

作者头像
一个会写诗的程序员
发布2018-12-06 11:28:54
5030
发布2018-12-06 11:28:54
举报

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.
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018.11.05 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Gradle + Kotlin = ⚡️ ?️
    • Why Gradle is best for Kotlin development
      • Gradle Kotlin DSL: use the language you ❤️ for your build too
    • Keys to building happiness for Kotlin projects
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档