Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.readdle:swift-java-codegen:0.6.9'
}
dependencies {
implementation("com.github.readdle:swift-java-codegen:0.6.9")
}
<dependency>
<groupId>com.github.readdle</groupId>
<artifactId>swift-java-codegen</artifactId>
<version>0.6.9</version>
</dependency>
libraryDependencies += "com.github.readdle" % "swift-java-codegen" % "0.6.9"
:dependencies [[com.github.readdle/swift-java-codegen "0.6.9"]]
Annotation processor that generate Swift JNI code for Kotlin headers
This annotation process only generate Swift JNI code. For compiling swift code for Android please use Swift Android Gradle plugin
allprojects {
repositories {
mavenCentral()
}
}
dependencies {
kapt "com.readdle.swift.java.codegen:compiler:$swift-java-codegen-version"
implementation "com.readdle.swift.java.codegen:annotations:$swift-java-codegen-version"
}
Documentation in progress...
There are few samples that use Swift Java Codegen:
When this project was started Kotlin was in beta development. That's why we decide to move on with Java as primary language. After 4 year of development we moved to Kotlin and break Java support. If for some reason you would like to use this project with Java, latest Java support version us stil available on Maven Central.
Very good question. Probably it's possible but it's quite complicated. We invest time to research code generation based on Swift and have a small prototype. But the development of this new tool is still at a very early stage.