06
Dev.to Kotlin
作者:Sifiso Fakude
發布:08-24 03:41
Building a Plug-and-Play JVM Compiler for Android and Desktop with Bytesmith
Configure the filesystem, provide the source, choose the output, and compile.
重點摘要
Unifies Kotlin and Java compilation behind one API
Uses a filesystem abstraction for JVM paths and Android SAF
Supports classpaths, boot classpaths, plugins, diagnostics, and packaging
Bytesmith is a Kotlin and Java compiler toolkit for JVM and Android applications that aims to make compilation a pluggable capability rather than a custom pipeline you must build yourself. It offers a unified API for Kotlin, Java, and mixed-language projects, while abstracting filesystem access so the same compilation layer can work with desktop paths, Android storage, or Storage Access Framework URIs. The toolkit also supports custom classpaths, boot classpaths, compiler plugins, diagnostics, and packaging output as JAR or ZIP files. It can be used programmatically or through a CLI, making it suitable for IDEs, editors, code generators, and other tools that need embedded compilation.
使用 Bytesmith 为 Android 和桌面构建可插拔的 JVM 编译器
配置文件系统、提供源代码、指定输出位置,然后直接编译。
重點摘要
用统一 API 支持 Kotlin、Java 以及混合编译
通过文件系统抽象兼容 JVM 路径与 Android SAF
支持 classpath、bootclasspath、插件、诊断和打包输出
Bytesmith 是面向 JVM 与 Android 应用的 Kotlin、Java 编译工具包,目标是把编译能力做成可插入应用的组件,而不是让开发者从头搭建完整编译流水线。它提供统一 API,可处理 Kotlin、Java 以及混合语言项目,并通过文件系统抽象让同一套编译层适配桌面路径、Android 存储和 Storage Access Framework URI。Bytesmith 还支持自定义 classpath、bootclasspath、编译器插件、诊断信息,以及将结果打包为 JAR 或 ZIP;同时既可嵌入程序调用,也可通过命令行使用,适合 IDE、编辑器、代码生成器和其他需要内置编译能力的场景。
為 Android 與桌面打造可插拔的 JVM 編譯器:Bytesmith
先設定檔案系統,提供原始碼,選定輸出位置,就能直接編譯。
重點摘要
以單一 API 支援 Kotlin、Java 與混合編譯
透過檔案系統抽象同時相容 JVM 路徑與 Android SAF
支援 classpath、bootclasspath、外掛、診斷與封裝輸出
Bytesmith 是一套面向 JVM 與 Android 應用的 Kotlin、Java 編譯工具組,目標是把編譯變成可直接插入應用的能力,而不是讓開發者自行重建整套流程。它提供統一 API,可處理 Kotlin、Java 與混合語言專案,並透過檔案系統抽象讓同一層編譯邏輯同時適用於桌面路徑、Android 儲存空間與 Storage Access Framework URI。Bytesmith 也支援自訂 classpath、bootclasspath、編譯器外掛、診斷回報,以及將輸出封裝成 JAR 或 ZIP,還可透過程式或命令列使用,適合 IDE、編輯器、產碼工具與其他需要內嵌編譯的應用。