This project provides a Java like API in 100%-pure Swift instead bridging to Java virtual machine. In result you do not need a Java virtual machine. On the otherside you can port Java code to Swift without Big-Bang step by step.
This project use MinD pattern to reduce dependency and eat other great resources.
This project use only business friendly permissive licenses.
By default the MIT License is used. Parts of source code use the BSD Licenses and the Public Domain / The Unlicense.
Special thanks to contributors of
- JZLib implementation and original JZLib implementation
- AnyDate implementation
- Base64 implementation with alphabet separation
When working with XCode add dependency
https://github.com/bastie/JavApi4Swift.git
When working with SwiftPM add dependency
.package(url: "https://github.com/bastie/JavApi4Swift.git", from: "0.8.0")
or
.Package(url: "https://github.com/bastie/JavApi4Swift.git", .upToNextMajor(from: "0.8.0"))
I'm implementing some porting projects to check JavApi⁴Swift releases and look for the next missing features. The use could start from version 0.4.2. Check out these projects and learn how to use JavApi⁴Swift.
- ASCII-Data is a library to display tables and graphs on command line as ASCII or ANSI.
- LStXML2Code is a library and CLI to generate source code for German income tax calculation based on Federal Ministry of Finance provided XML Pseudocode.
- iban4j is a library for generation and validation of the International Bank Account Numbers (IBAN ISO_13616) and Business Identifier Codes (BIC ISO_9362).
To honor the work of the developer of other project let the history come inside.
To include other project with compatible license do
# 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
- The ported Java source code should not to modify more than needed.
- I like short lines and so indent is 2 spaces.
- Types are in same name files like Java with the exception of java.lang types.
- The opend curly braces are in the same line.
- packages are mapped over enums in files named as java.basepackagename.packagename.swift in result of compiler problems with more than one identical files names.
- Exported parameters of Java translated, non-private function parameter are marked with underline.
- Exceptions are mapped over extension of Error enumeration.
- Default methods are in extensions implemented.
- Swiftify code are implemented in extensions.
- All previous points are non-binding recommendations with no binding effect.