Android N Java 8功能(Jack编译器)和Kotlin互操作 [英] Android N Java 8 features (Jack compiler) and Kotlin interop

查看:172
本文介绍了Android N Java 8功能(Jack编译器)和Kotlin互操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新3。
KOTLIN 现在正式支持ANDROID DEVELOPMENT 。通过GOOGLE。 YAAAAAAAAAS!

Update 3. KOTLIN IS NOW OFFICIALLY SUPPORTED FOR ANDROID DEVELOPMENT. BY GOOGLE. YAAAAAAAAS!

更新2 :它看起来像是从长远来看,JetBrains真的致力于支持Kotlin for Android 。我是一个快乐的kotlin用户:)。

Update 2: It looks like JetBrains is really committed to supporting Kotlin for Android in the long run. I'm a happy kotlin user :).

更新:来自JetBrains的Hadi Hariri,提到他们将发布有关此主题的一些信息。一旦他们这样做,我会更新这篇文章。

Update: Hadi Hariri, from JetBrains, mentioned they're going to release some info on this topic. I will update this post once they do.



===弃用的STUFF NEXT ===


=== DEPRECATED STUFF NEXT ===

Google刚刚发布了即将推出的Android N的预览版,其中包含一些有趣的功能,最值得注意的是部分 Java 8语言支持。这是可能的,因为Google正在开发新的杰克工具链

Google just released a preview for the upcoming Android N with some interesting features, the most notable being partial Java 8 language support. This is possible due to the new Jack toolchain Google is working on.

使用 javac kotlinc 的当前工具链:

javac .java - > .class ) - > dx .class - > .dex

kotlinc .kt - > .class ) - > dx .class - > .dex

The current toolchain using javac or kotlinc:
javac (.java --> .class) --> dx (.class --> .dex)
kotlinc (.kt --> .class) --> dx (.class --> .dex)

新杰克工具链:

杰克 .java - > .jack - > .dex

New Jack toolchain:
Jack (.java --> .jack --> .dex)

我假设谷歌将推进杰克的默认工具链Android开发。
更新:杰克现在已弃用。 Yas。

I am assuming Google will push forward towards making Jack the default toolchain for Android development. Update: Jack is now deprecated. Yas.

我的问题是这个新工具链将来如何影响我作为Android开发的 kotlin 用户?我会陷入困境吗?

My question is how will this new toolchain affect me, in the future, as a kotlin user for Android development? Will I get "stuck in the past"?

推荐答案

免责声明:我在杰克工作

disclaimer: I work on Jack

这不会对您产生影响。 Kotlin的编译器生成Java 6字节码,Jack / Jill可以很好地导入它。

This won't affect you. Kotlin's compiler produces Java 6 bytecode, which Jack/Jill can import just fine.

这篇关于Android N Java 8功能(Jack编译器)和Kotlin互操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆