将 javac 和 dx 移植到 android [英] porting javac and dx to android

查看:21
本文介绍了将 javac 和 dx 移植到 android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正计划将 javac 编译器和 dx 转换器移植到 android..这将是一项微不足道的任务还是有任何主要的障碍?

Hi i'm planning on porting the javac compiler and dx converter to android..Is this going to be a trivial Task or are there any major Roadblocks?

我的想法是创建一个应用程序,以便人们可以在 android 设备中编译 java 源代码,甚至可以在相同的 android 设备中制作 android 应用程序...

My idea is to create an app so that people can compile java source code in the android devices and maybe even make android apps in the same android devices...

这可能吗?

推荐答案

大多数人不会认为它微不足道.

Most people would not consider it trivial.

您将 javacdx 列为需要移植的东西.这些当然是要求.您需要创建 javac 的 ARM 端口(以及它可能使用的所有不在 Android 上的系统库).您还需要尝试创建一个可以在 Dalvik VM 上运行的 dx 版本,因为它是为 Java VM 编写的.

You list javac and dx as things that need to be ported. Those are certainly requirements. You would need to create an ARM port of javac (and all the system libraries that it might use that are not on Android). You would also need to attempt to create a version of dx that would run on Dalvik VM, as it is written for the Java VM.

除此之外,您至少需要移植:

Beyond that, you would need to port, at minimum:

  • aapt 以及它可能使用的所有不在 Android 上的系统库
  • aidl 以及它可能使用的所有不在 Android 上的系统库
  • LLVM 编译器
  • Ant(用 Java 编写,但适用于 Java VM,如果不进行修改,很可能无法在 Dalvik VM 上运行)
  • 构建过程使用的整个导入的 Ant 任务集(也为 Java VM 编写)
  • 那些 Ant 任务在构建过程中使用的其他 Java SDK 工具(例如,jarsignerkeytool)
  • aapt and all the system libraries that it might use that are not on Android
  • aidl and all the system libraries that it might use that are not on Android
  • the LLVM compiler
  • Ant (written in Java, but for the Java VM and very likely will not run on the Dalvik VM without modifications)
  • the entire imported set of Ant tasks used by the build process (also written for the Java VM)
  • other Java SDK tools used by those Ant tasks as part of the build process (e.g., jarsigner, keytool)

然后您需要创建一个 Android 应用程序,该应用程序可以调用 Ant 任务来进行构建,请记住,Android shell 相当有限,并且可能会在此过程中设置自己的障碍.这样的应用程序需要捕获 stdoutstderr 并将结果报告给用户(例如,编译错误).您可能还需要推出自己的微型 IDE,除非现有的文本编辑器足以满足您的需求.

And then you would need to create an Android app that could invoke the Ant task to do the build, bearing in mind that the Android shell is rather limited and could conceivably place its own impediments on this process. Such an app would need to capture stdout and stderr and report the results to the user (e.g., compile errors). You would likely also need to roll your own miniature IDE, unless there is an existing text editor sufficient for your needs.

我估计这需要超过 100 个工程师月.因此,如果您的公司为该项目安排了一个规模庞大的团队,您可能会在一年左右的时间内完成.

I would estimate this as taking well in excess of 100 engineer-months. So, if your firm has tasked a nice-sized team for the project, you might have it done in a year or so.

这篇关于将 javac 和 dx 移植到 android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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