本项目提供了一个类似 Java 的 API,但它是 100% 纯 Swift 实现,而不是桥接到 Java 虚拟机。 因此,您不需要 Java 虚拟机。 另一方面,您可以将 Java 代码逐步移植到 Swift,而无需一次性全部迁移。
本项目使用 MinD 模式来减少依赖性,并利用其他优秀资源。
本项目仅使用对商业友好的 许可型许可证。
部分源代码使用 BSD 许可证和 Public Domain / The Unlicense。 默认情况下,我使用 MIT 许可证。 部分源代码使用 Apache 2.0 许可证。
特别感谢以下贡献者的工作:
使用 XCode 时,添加依赖项
https://github.com/bastie/JavApi4Swift.git
使用 SwiftPM 时,添加依赖项
.package(url: "https://github.com/bastie/JavApi4Swift.git", from: "0.19.1")
或者
.Package(url: "https://github.com/bastie/JavApi4Swift.git", .upToNextMajor(from: "0.19.1"))
我正在实现一些移植项目,以检查 JavApi⁴Swift 的发布版本,并寻找下一个缺失的功能。 可以从 0.4.2 版本开始使用。 检查这些项目并学习如何使用 JavApi⁴Swift。
为了尊重其他项目的开发人员的工作,让历史记录保留。
要包含具有兼容许可证的其他项目,请执行以下操作:
# Example for some types from a jzlib clone
#
# clone the other project local, jzlib clone are here https://github.com/kohsuke/jzlib.git
git clone https://github.com/kohsuke/jzlib.git otherProject
# go into project directory and remove the origin
cd otherProject
git remote rm origin
# filter project to remove all unwanted data and commit it
git filter-branch --subdirectory-filter src/main/java/com/jcraft/jzlib -- --all
git rm Deflat*.java GZIP*.java Inf*.java Z*.java Tree.java StaticTree.java JZl*.java
git commit -m "ready to import"
# go to JavApi project directory
cd ../JavApi4Swift
# add (temporary) the local other project as remote source and pull wanted data with history
git remote add importSource ../otherProject
git pull importSource master --no-rebase --allow-unrelated-histories
git remote rm importSource
# work on conflicts f.e. in .gitignore
# optional take a look into history
git log