在Scala和Gradle中使用AndroidAnnotations [英] Using AndroidAnnotations with Scala and Gradle

查看:179
本文介绍了在Scala和Gradle中使用AndroidAnnotations的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过Scala编程语言和Gradle构建系统使用AndroidAnnotations?当我尝试将AndroidAnnotations集成到我现有的Android / Scala / Gradle项目中时,编译失败是因为无法找到生成的下划线类(例如MyActivity_)。



有用的出发点和参考:


解决方案

在我的问题t解决这个问题,我添加了一些研究链接到我原来的问题。 AndroidAnnotations注释处理器生成源代码(Java文件)。通常注释处理器似乎在源代码级(而不是类文件)上运行。我期待AndroidAnnotations从Scala源文件生成Java代码。 Scala似乎不支持Java注释处理工具。所以我对这个问题的回答是:不可能在Scala源代码中使用AndroidAnnotations。然而,AndroidAnnotations仍然可以用于Scala混合源项目中的Java源代码。


Is it possible to use AndroidAnnotations with the Scala programming language and the Gradle build system? When I try to integrate AndroidAnnotations into my existing Android/Scala/Gradle project, then compilation fails because the generated underscore classes (e.g. MyActivity_) cannot be found.

Here are some useful starting points and references:

解决方案

During my quest to solve this problem, I added some research links to my original question post. The AndroidAnnotations annotation processor generates source code (Java files). Annotation processors in general seem to operate at the source code level (and not class files). I am expecting AndroidAnnotations to generate Java code from Scala source files. Scala doesn't seem to support the Java annotation processing tool. So my answer to this question would be: it is not possible to use AndroidAnnotations with Scala source code. However, AndroidAnnotations may still be used in the Java source code in a Scala mixed-source project.

这篇关于在Scala和Gradle中使用AndroidAnnotations的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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