diff --git a/README.md b/README.md index be5aefc..02053fc 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,11 @@ This repository contains example applications that demonstrate how to use the [S ## Available Examples -- **[hello-swift](hello-swift/)** - basic Swift integration that calls a Swift function. -- **[hello-swift-callback](hello-swift-callback/)** - demonstrates bidirectional communication with Swift timer callbacks updating Android UI. -- **[hello-swift-library](hello-swift-library/)** - shows how to package Swift code as a reusable Android library component. +Examples using [swift-java](https://github.com/swiftlang/swift-java) to generate necessary Swift/Java bridging: +- **[hello-swift-java](hello-swift-java/)** - application that demonstrates how to call Swift code from an Android app with automatically generated Java wrappers and JNI code using [swift-java](https://github.com/swiftlang/swift-java). + +Examples using raw JNI, without generated bridging sources: +- **[hello-swift-raw-jni](hello-swift-raw-jni/)** - basic Swift integration that calls a Swift function. +- **[hello-swift-raw-jni-callback](hello-swift-raw-jni-callback/)** - demonstrates bidirectional communication with Swift timer callbacks updating Android UI. +- **[hello-swift-raw-jni-library](hello-swift-raw-jni-library/)** - shows how to package Swift code as a reusable Android library component. - **[native-activity](native-activity/)** - complete native Android activity with OpenGL ES rendering written entirely in Swift. -- **[swift-java-hashing-example](swift-java-hashing-example/)** - application that demonstrates how to call Swift code from an Android app with automatically generated Java wrappers and JNI code using [swift-java](https://github.com/swiftlang/swift-java). diff --git a/swift-java-hashing-example/.gitignore b/hello-swift-java/.gitignore similarity index 100% rename from swift-java-hashing-example/.gitignore rename to hello-swift-java/.gitignore diff --git a/swift-java-hashing-example/README.md b/hello-swift-java/README.md similarity index 92% rename from swift-java-hashing-example/README.md rename to hello-swift-java/README.md index 4d1921a..edd512a 100644 --- a/swift-java-hashing-example/README.md +++ b/hello-swift-java/README.md @@ -1,9 +1,8 @@ # swift-java on Android This example contains a sample Android application that demonstrates how to call Swift code from a Android app. -The example consists of an Android application (`hashing-app`) and a Swift library (`hashing-lib`) that performs a SHA256 hash on a given string. -The Swift library uses [swift-java](https://github.com/swiftlang/swift-java) and the new JNI mode to automatically -generate Java wrappers for calling into the Swift library. + +The example consists of an Android application (`hashing-app`) and a Swift library (`hashing-lib`) that performs a SHA256 hash on a given string. The Swift library uses [swift-java](https://github.com/swiftlang/swift-java) and the new JNI mode to **automatically generate Java wrappers** for calling into the Swift library. ![IDE Screenshot](resources/ide.png) @@ -27,7 +26,7 @@ Before you can build and run this project, you need to have the following instal ### Prepare Swift Android SDK and matching Swift -Currently these examples utilize very recent nightly Swift Android SDK versions. In order to install these, you can use Swiftly (the Swift toolchain installer): +Currently, these examples utilize very recent nightly Swift Android SDK versions. In order to install these, you can use Swiftly (the Swift toolchain installer): You can follow [these instructions](https://www.swift.org/documentation/articles/swift-sdk-for-android-getting-started.html) to install an appropriate Swift SDK for Android. diff --git a/hello-swift-callback/.gitignore b/hello-swift-java/hashing-app/.gitignore similarity index 100% rename from hello-swift-callback/.gitignore rename to hello-swift-java/hashing-app/.gitignore diff --git a/swift-java-hashing-example/hashing-app/build.gradle.kts b/hello-swift-java/hashing-app/build.gradle.kts similarity index 96% rename from swift-java-hashing-example/hashing-app/build.gradle.kts rename to hello-swift-java/hashing-app/build.gradle.kts index 31a9ad3..bddfdc0 100644 --- a/swift-java-hashing-example/hashing-app/build.gradle.kts +++ b/hello-swift-java/hashing-app/build.gradle.kts @@ -40,7 +40,6 @@ android { } dependencies { - implementation(libs.androidx.core.ktx) implementation(libs.androidx.lifecycle.runtime.ktx) implementation(libs.androidx.activity.compose) @@ -49,7 +48,7 @@ dependencies { implementation(libs.androidx.ui.graphics) implementation(libs.androidx.ui.tooling.preview) implementation(libs.androidx.material3) - implementation(project(":hashing-lib")) + implementation(project(":hello-swift-java-hashing-lib")) testImplementation(libs.junit) androidTestImplementation(libs.androidx.junit) androidTestImplementation(libs.androidx.espresso.core) diff --git a/swift-java-hashing-example/hashing-app/proguard-rules.pro b/hello-swift-java/hashing-app/proguard-rules.pro similarity index 100% rename from swift-java-hashing-example/hashing-app/proguard-rules.pro rename to hello-swift-java/hashing-app/proguard-rules.pro diff --git a/swift-java-hashing-example/hashing-app/src/androidTest/java/com/example/hashingapp/ExampleInstrumentedTest.kt b/hello-swift-java/hashing-app/src/androidTest/java/com/example/hashingapp/ExampleInstrumentedTest.kt similarity index 100% rename from swift-java-hashing-example/hashing-app/src/androidTest/java/com/example/hashingapp/ExampleInstrumentedTest.kt rename to hello-swift-java/hashing-app/src/androidTest/java/com/example/hashingapp/ExampleInstrumentedTest.kt diff --git a/swift-java-hashing-example/hashing-app/src/main/AndroidManifest.xml b/hello-swift-java/hashing-app/src/main/AndroidManifest.xml similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/AndroidManifest.xml rename to hello-swift-java/hashing-app/src/main/AndroidManifest.xml diff --git a/swift-java-hashing-example/hashing-app/src/main/java/com/example/hashingapp/MainActivity.kt b/hello-swift-java/hashing-app/src/main/java/com/example/hashingapp/MainActivity.kt similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/java/com/example/hashingapp/MainActivity.kt rename to hello-swift-java/hashing-app/src/main/java/com/example/hashingapp/MainActivity.kt diff --git a/swift-java-hashing-example/hashing-app/src/main/java/com/example/hashingapp/ui/theme/Color.kt b/hello-swift-java/hashing-app/src/main/java/com/example/hashingapp/ui/theme/Color.kt similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/java/com/example/hashingapp/ui/theme/Color.kt rename to hello-swift-java/hashing-app/src/main/java/com/example/hashingapp/ui/theme/Color.kt diff --git a/swift-java-hashing-example/hashing-app/src/main/java/com/example/hashingapp/ui/theme/Theme.kt b/hello-swift-java/hashing-app/src/main/java/com/example/hashingapp/ui/theme/Theme.kt similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/java/com/example/hashingapp/ui/theme/Theme.kt rename to hello-swift-java/hashing-app/src/main/java/com/example/hashingapp/ui/theme/Theme.kt diff --git a/swift-java-hashing-example/hashing-app/src/main/java/com/example/hashingapp/ui/theme/Type.kt b/hello-swift-java/hashing-app/src/main/java/com/example/hashingapp/ui/theme/Type.kt similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/java/com/example/hashingapp/ui/theme/Type.kt rename to hello-swift-java/hashing-app/src/main/java/com/example/hashingapp/ui/theme/Type.kt diff --git a/hello-swift-callback/src/main/res/drawable/ic_launcher_background.xml b/hello-swift-java/hashing-app/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from hello-swift-callback/src/main/res/drawable/ic_launcher_background.xml rename to hello-swift-java/hashing-app/src/main/res/drawable/ic_launcher_background.xml diff --git a/hello-swift-callback/src/main/res/drawable/ic_launcher_foreground.xml b/hello-swift-java/hashing-app/src/main/res/drawable/ic_launcher_foreground.xml similarity index 100% rename from hello-swift-callback/src/main/res/drawable/ic_launcher_foreground.xml rename to hello-swift-java/hashing-app/src/main/res/drawable/ic_launcher_foreground.xml diff --git a/hello-swift-callback/src/main/res/mipmap-anydpi/ic_launcher.xml b/hello-swift-java/hashing-app/src/main/res/mipmap-anydpi/ic_launcher.xml similarity index 100% rename from hello-swift-callback/src/main/res/mipmap-anydpi/ic_launcher.xml rename to hello-swift-java/hashing-app/src/main/res/mipmap-anydpi/ic_launcher.xml diff --git a/hello-swift-callback/src/main/res/mipmap-anydpi/ic_launcher_round.xml b/hello-swift-java/hashing-app/src/main/res/mipmap-anydpi/ic_launcher_round.xml similarity index 100% rename from hello-swift-callback/src/main/res/mipmap-anydpi/ic_launcher_round.xml rename to hello-swift-java/hashing-app/src/main/res/mipmap-anydpi/ic_launcher_round.xml diff --git a/hello-swift-callback/src/main/res/mipmap-hdpi/ic_launcher.webp b/hello-swift-java/hashing-app/src/main/res/mipmap-hdpi/ic_launcher.webp similarity index 100% rename from hello-swift-callback/src/main/res/mipmap-hdpi/ic_launcher.webp rename to hello-swift-java/hashing-app/src/main/res/mipmap-hdpi/ic_launcher.webp diff --git a/hello-swift-callback/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/hello-swift-java/hashing-app/src/main/res/mipmap-hdpi/ic_launcher_round.webp similarity index 100% rename from hello-swift-callback/src/main/res/mipmap-hdpi/ic_launcher_round.webp rename to hello-swift-java/hashing-app/src/main/res/mipmap-hdpi/ic_launcher_round.webp diff --git a/hello-swift-callback/src/main/res/mipmap-mdpi/ic_launcher.webp b/hello-swift-java/hashing-app/src/main/res/mipmap-mdpi/ic_launcher.webp similarity index 100% rename from hello-swift-callback/src/main/res/mipmap-mdpi/ic_launcher.webp rename to hello-swift-java/hashing-app/src/main/res/mipmap-mdpi/ic_launcher.webp diff --git a/hello-swift-callback/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/hello-swift-java/hashing-app/src/main/res/mipmap-mdpi/ic_launcher_round.webp similarity index 100% rename from hello-swift-callback/src/main/res/mipmap-mdpi/ic_launcher_round.webp rename to hello-swift-java/hashing-app/src/main/res/mipmap-mdpi/ic_launcher_round.webp diff --git a/hello-swift-callback/src/main/res/mipmap-xhdpi/ic_launcher.webp b/hello-swift-java/hashing-app/src/main/res/mipmap-xhdpi/ic_launcher.webp similarity index 100% rename from hello-swift-callback/src/main/res/mipmap-xhdpi/ic_launcher.webp rename to hello-swift-java/hashing-app/src/main/res/mipmap-xhdpi/ic_launcher.webp diff --git a/hello-swift-callback/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/hello-swift-java/hashing-app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp similarity index 100% rename from hello-swift-callback/src/main/res/mipmap-xhdpi/ic_launcher_round.webp rename to hello-swift-java/hashing-app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp diff --git a/hello-swift-callback/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/hello-swift-java/hashing-app/src/main/res/mipmap-xxhdpi/ic_launcher.webp similarity index 100% rename from hello-swift-callback/src/main/res/mipmap-xxhdpi/ic_launcher.webp rename to hello-swift-java/hashing-app/src/main/res/mipmap-xxhdpi/ic_launcher.webp diff --git a/hello-swift-callback/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/hello-swift-java/hashing-app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp similarity index 100% rename from hello-swift-callback/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp rename to hello-swift-java/hashing-app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp diff --git a/hello-swift-callback/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/hello-swift-java/hashing-app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp similarity index 100% rename from hello-swift-callback/src/main/res/mipmap-xxxhdpi/ic_launcher.webp rename to hello-swift-java/hashing-app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp diff --git a/hello-swift-callback/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/hello-swift-java/hashing-app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp similarity index 100% rename from hello-swift-callback/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp rename to hello-swift-java/hashing-app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp diff --git a/hello-swift-callback/src/main/res/values/colors.xml b/hello-swift-java/hashing-app/src/main/res/values/colors.xml similarity index 100% rename from hello-swift-callback/src/main/res/values/colors.xml rename to hello-swift-java/hashing-app/src/main/res/values/colors.xml diff --git a/swift-java-hashing-example/hashing-app/src/main/res/values/strings.xml b/hello-swift-java/hashing-app/src/main/res/values/strings.xml similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/values/strings.xml rename to hello-swift-java/hashing-app/src/main/res/values/strings.xml diff --git a/swift-java-hashing-example/hashing-app/src/main/res/values/themes.xml b/hello-swift-java/hashing-app/src/main/res/values/themes.xml similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/values/themes.xml rename to hello-swift-java/hashing-app/src/main/res/values/themes.xml diff --git a/hello-swift-callback/src/main/res/xml/backup_rules.xml b/hello-swift-java/hashing-app/src/main/res/xml/backup_rules.xml similarity index 100% rename from hello-swift-callback/src/main/res/xml/backup_rules.xml rename to hello-swift-java/hashing-app/src/main/res/xml/backup_rules.xml diff --git a/hello-swift-callback/src/main/res/xml/data_extraction_rules.xml b/hello-swift-java/hashing-app/src/main/res/xml/data_extraction_rules.xml similarity index 100% rename from hello-swift-callback/src/main/res/xml/data_extraction_rules.xml rename to hello-swift-java/hashing-app/src/main/res/xml/data_extraction_rules.xml diff --git a/swift-java-hashing-example/hashing-app/src/test/java/com/example/hashingapp/ExampleUnitTest.kt b/hello-swift-java/hashing-app/src/test/java/com/example/hashingapp/ExampleUnitTest.kt similarity index 100% rename from swift-java-hashing-example/hashing-app/src/test/java/com/example/hashingapp/ExampleUnitTest.kt rename to hello-swift-java/hashing-app/src/test/java/com/example/hashingapp/ExampleUnitTest.kt diff --git a/swift-java-hashing-example/hashing-lib/Package.swift b/hello-swift-java/hashing-lib/Package.swift similarity index 100% rename from swift-java-hashing-example/hashing-lib/Package.swift rename to hello-swift-java/hashing-lib/Package.swift diff --git a/swift-java-hashing-example/hashing-lib/Sources/SwiftHashing/SwiftHashing.swift b/hello-swift-java/hashing-lib/Sources/SwiftHashing/SwiftHashing.swift similarity index 100% rename from swift-java-hashing-example/hashing-lib/Sources/SwiftHashing/SwiftHashing.swift rename to hello-swift-java/hashing-lib/Sources/SwiftHashing/SwiftHashing.swift diff --git a/swift-java-hashing-example/hashing-lib/Sources/SwiftHashing/swift-java.config b/hello-swift-java/hashing-lib/Sources/SwiftHashing/swift-java.config similarity index 100% rename from swift-java-hashing-example/hashing-lib/Sources/SwiftHashing/swift-java.config rename to hello-swift-java/hashing-lib/Sources/SwiftHashing/swift-java.config diff --git a/swift-java-hashing-example/hashing-lib/Tests/SwiftHashingTests/SwiftHashingTests.swift b/hello-swift-java/hashing-lib/Tests/SwiftHashingTests/SwiftHashingTests.swift similarity index 100% rename from swift-java-hashing-example/hashing-lib/Tests/SwiftHashingTests/SwiftHashingTests.swift rename to hello-swift-java/hashing-lib/Tests/SwiftHashingTests/SwiftHashingTests.swift diff --git a/swift-java-hashing-example/hashing-lib/build.gradle b/hello-swift-java/hashing-lib/build.gradle similarity index 100% rename from swift-java-hashing-example/hashing-lib/build.gradle rename to hello-swift-java/hashing-lib/build.gradle diff --git a/swift-java-hashing-example/hashing-lib/gradle.properties b/hello-swift-java/hashing-lib/gradle.properties similarity index 100% rename from swift-java-hashing-example/hashing-lib/gradle.properties rename to hello-swift-java/hashing-lib/gradle.properties diff --git a/swift-java-hashing-example/resources/ide.png b/hello-swift-java/resources/ide.png similarity index 100% rename from swift-java-hashing-example/resources/ide.png rename to hello-swift-java/resources/ide.png diff --git a/hello-swift-library/.gitignore b/hello-swift-raw-jni-callback/.gitignore similarity index 100% rename from hello-swift-library/.gitignore rename to hello-swift-raw-jni-callback/.gitignore diff --git a/hello-swift-callback/README.md b/hello-swift-raw-jni-callback/README.md similarity index 72% rename from hello-swift-callback/README.md rename to hello-swift-raw-jni-callback/README.md index 723d619..065c995 100644 --- a/hello-swift-callback/README.md +++ b/hello-swift-raw-jni-callback/README.md @@ -1,6 +1,6 @@ -# Swift to Android Callbacks +# Swift to Android Callbacks using Raw JNI -This example demonstrates bidirectional communication between Swift and Android. The Swift code runs a timer that calls back to Android every second to update the UI with the current time (HH:MM:SS format). +This example demonstrates bidirectional communication between Swift and Android, without the use of swift-java interoperability support, just by using raw JNI. The Swift code runs a timer that calls back to Android every second to update the UI with the current time (HH:MM:SS format). ![Screenshot](screenshot.png) @@ -23,7 +23,7 @@ Before you can build and run this project, you need to have the following instal 1. Open the `swift-android-examples` project in Android Studio. -2. Select the `hello-swift-callback` Gradle target. +2. Select the `hello-swift-raw-jni-callback` Gradle target. 3. Run the app on an Android emulator or a physical device. @@ -31,8 +31,8 @@ Before you can build and run this project, you need to have the following instal ```bash # Build the example -./gradlew :hello-swift-callback:assembleDebug +./gradlew :hello-swift-raw-jni-callback:assembleDebug # Install on device/emulator -./gradlew :hello-swift-callback:installDebug +./gradlew :hello-swift-raw-jni-callback:installDebug ``` diff --git a/hello-swift-callback/build.gradle.kts b/hello-swift-raw-jni-callback/build.gradle.kts similarity index 100% rename from hello-swift-callback/build.gradle.kts rename to hello-swift-raw-jni-callback/build.gradle.kts diff --git a/hello-swift-callback/screenshot.png b/hello-swift-raw-jni-callback/screenshot.png similarity index 100% rename from hello-swift-callback/screenshot.png rename to hello-swift-raw-jni-callback/screenshot.png diff --git a/hello-swift-callback/src/main/AndroidManifest.xml b/hello-swift-raw-jni-callback/src/main/AndroidManifest.xml similarity index 100% rename from hello-swift-callback/src/main/AndroidManifest.xml rename to hello-swift-raw-jni-callback/src/main/AndroidManifest.xml diff --git a/hello-swift-callback/src/main/java/org/example/helloswift/MainActivity.kt b/hello-swift-raw-jni-callback/src/main/java/org/example/helloswift/MainActivity.kt similarity index 92% rename from hello-swift-callback/src/main/java/org/example/helloswift/MainActivity.kt rename to hello-swift-raw-jni-callback/src/main/java/org/example/helloswift/MainActivity.kt index e60f4a4..69a49a1 100644 --- a/hello-swift-callback/src/main/java/org/example/helloswift/MainActivity.kt +++ b/hello-swift-raw-jni-callback/src/main/java/org/example/helloswift/MainActivity.kt @@ -72,9 +72,9 @@ class MainActivity : AppCompatActivity() { external fun stopTicks() companion object { - // Used to load the 'hello-swift-callback' library on application startup. + // Used to load the 'hello-swift-raw-jni-callback' library on application startup. init { - System.loadLibrary("hello-swift-callback") + System.loadLibrary("hello-swift-raw-jni-callback") } } } diff --git a/hello-swift/src/main/res/drawable/ic_launcher_background.xml b/hello-swift-raw-jni-callback/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from hello-swift/src/main/res/drawable/ic_launcher_background.xml rename to hello-swift-raw-jni-callback/src/main/res/drawable/ic_launcher_background.xml diff --git a/hello-swift/src/main/res/drawable/ic_launcher_foreground.xml b/hello-swift-raw-jni-callback/src/main/res/drawable/ic_launcher_foreground.xml similarity index 100% rename from hello-swift/src/main/res/drawable/ic_launcher_foreground.xml rename to hello-swift-raw-jni-callback/src/main/res/drawable/ic_launcher_foreground.xml diff --git a/hello-swift-callback/src/main/res/layout/activity_main.xml b/hello-swift-raw-jni-callback/src/main/res/layout/activity_main.xml similarity index 100% rename from hello-swift-callback/src/main/res/layout/activity_main.xml rename to hello-swift-raw-jni-callback/src/main/res/layout/activity_main.xml diff --git a/hello-swift/src/main/res/mipmap-anydpi/ic_launcher.xml b/hello-swift-raw-jni-callback/src/main/res/mipmap-anydpi/ic_launcher.xml similarity index 100% rename from hello-swift/src/main/res/mipmap-anydpi/ic_launcher.xml rename to hello-swift-raw-jni-callback/src/main/res/mipmap-anydpi/ic_launcher.xml diff --git a/hello-swift/src/main/res/mipmap-anydpi/ic_launcher_round.xml b/hello-swift-raw-jni-callback/src/main/res/mipmap-anydpi/ic_launcher_round.xml similarity index 100% rename from hello-swift/src/main/res/mipmap-anydpi/ic_launcher_round.xml rename to hello-swift-raw-jni-callback/src/main/res/mipmap-anydpi/ic_launcher_round.xml diff --git a/hello-swift/src/main/res/mipmap-hdpi/ic_launcher.webp b/hello-swift-raw-jni-callback/src/main/res/mipmap-hdpi/ic_launcher.webp similarity index 100% rename from hello-swift/src/main/res/mipmap-hdpi/ic_launcher.webp rename to hello-swift-raw-jni-callback/src/main/res/mipmap-hdpi/ic_launcher.webp diff --git a/hello-swift/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/hello-swift-raw-jni-callback/src/main/res/mipmap-hdpi/ic_launcher_round.webp similarity index 100% rename from hello-swift/src/main/res/mipmap-hdpi/ic_launcher_round.webp rename to hello-swift-raw-jni-callback/src/main/res/mipmap-hdpi/ic_launcher_round.webp diff --git a/hello-swift/src/main/res/mipmap-mdpi/ic_launcher.webp b/hello-swift-raw-jni-callback/src/main/res/mipmap-mdpi/ic_launcher.webp similarity index 100% rename from hello-swift/src/main/res/mipmap-mdpi/ic_launcher.webp rename to hello-swift-raw-jni-callback/src/main/res/mipmap-mdpi/ic_launcher.webp diff --git a/hello-swift/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/hello-swift-raw-jni-callback/src/main/res/mipmap-mdpi/ic_launcher_round.webp similarity index 100% rename from hello-swift/src/main/res/mipmap-mdpi/ic_launcher_round.webp rename to hello-swift-raw-jni-callback/src/main/res/mipmap-mdpi/ic_launcher_round.webp diff --git a/hello-swift/src/main/res/mipmap-xhdpi/ic_launcher.webp b/hello-swift-raw-jni-callback/src/main/res/mipmap-xhdpi/ic_launcher.webp similarity index 100% rename from hello-swift/src/main/res/mipmap-xhdpi/ic_launcher.webp rename to hello-swift-raw-jni-callback/src/main/res/mipmap-xhdpi/ic_launcher.webp diff --git a/hello-swift/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/hello-swift-raw-jni-callback/src/main/res/mipmap-xhdpi/ic_launcher_round.webp similarity index 100% rename from hello-swift/src/main/res/mipmap-xhdpi/ic_launcher_round.webp rename to hello-swift-raw-jni-callback/src/main/res/mipmap-xhdpi/ic_launcher_round.webp diff --git a/hello-swift/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/hello-swift-raw-jni-callback/src/main/res/mipmap-xxhdpi/ic_launcher.webp similarity index 100% rename from hello-swift/src/main/res/mipmap-xxhdpi/ic_launcher.webp rename to hello-swift-raw-jni-callback/src/main/res/mipmap-xxhdpi/ic_launcher.webp diff --git a/hello-swift/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/hello-swift-raw-jni-callback/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp similarity index 100% rename from hello-swift/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp rename to hello-swift-raw-jni-callback/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp diff --git a/hello-swift/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/hello-swift-raw-jni-callback/src/main/res/mipmap-xxxhdpi/ic_launcher.webp similarity index 100% rename from hello-swift/src/main/res/mipmap-xxxhdpi/ic_launcher.webp rename to hello-swift-raw-jni-callback/src/main/res/mipmap-xxxhdpi/ic_launcher.webp diff --git a/hello-swift/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/hello-swift-raw-jni-callback/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp similarity index 100% rename from hello-swift/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp rename to hello-swift-raw-jni-callback/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp diff --git a/hello-swift-callback/src/main/res/values-night/themes.xml b/hello-swift-raw-jni-callback/src/main/res/values-night/themes.xml similarity index 100% rename from hello-swift-callback/src/main/res/values-night/themes.xml rename to hello-swift-raw-jni-callback/src/main/res/values-night/themes.xml diff --git a/hello-swift/src/main/res/values/colors.xml b/hello-swift-raw-jni-callback/src/main/res/values/colors.xml similarity index 100% rename from hello-swift/src/main/res/values/colors.xml rename to hello-swift-raw-jni-callback/src/main/res/values/colors.xml diff --git a/hello-swift-callback/src/main/res/values/strings.xml b/hello-swift-raw-jni-callback/src/main/res/values/strings.xml similarity index 100% rename from hello-swift-callback/src/main/res/values/strings.xml rename to hello-swift-raw-jni-callback/src/main/res/values/strings.xml diff --git a/hello-swift-callback/src/main/res/values/themes.xml b/hello-swift-raw-jni-callback/src/main/res/values/themes.xml similarity index 100% rename from hello-swift-callback/src/main/res/values/themes.xml rename to hello-swift-raw-jni-callback/src/main/res/values/themes.xml diff --git a/hello-swift/src/main/res/xml/backup_rules.xml b/hello-swift-raw-jni-callback/src/main/res/xml/backup_rules.xml similarity index 100% rename from hello-swift/src/main/res/xml/backup_rules.xml rename to hello-swift-raw-jni-callback/src/main/res/xml/backup_rules.xml diff --git a/hello-swift/src/main/res/xml/data_extraction_rules.xml b/hello-swift-raw-jni-callback/src/main/res/xml/data_extraction_rules.xml similarity index 100% rename from hello-swift/src/main/res/xml/data_extraction_rules.xml rename to hello-swift-raw-jni-callback/src/main/res/xml/data_extraction_rules.xml diff --git a/hello-swift-callback/src/main/swift/.gitignore b/hello-swift-raw-jni-callback/src/main/swift/.gitignore similarity index 100% rename from hello-swift-callback/src/main/swift/.gitignore rename to hello-swift-raw-jni-callback/src/main/swift/.gitignore diff --git a/hello-swift-callback/src/main/swift/Package.swift b/hello-swift-raw-jni-callback/src/main/swift/Package.swift similarity index 51% rename from hello-swift-callback/src/main/swift/Package.swift rename to hello-swift-raw-jni-callback/src/main/swift/Package.swift index 792ce4e..84c2b44 100644 --- a/hello-swift-callback/src/main/swift/Package.swift +++ b/hello-swift-raw-jni-callback/src/main/swift/Package.swift @@ -4,11 +4,11 @@ import PackageDescription let package = Package( - name: "hello-swift-callback", + name: "hello-swift-raw-jni-callback", products: [ - .library(name: "hello-swift-callback", type: .dynamic, targets: ["hello-swift-callback"]), + .library(name: "hello-swift-raw-jni-callback", type: .dynamic, targets: ["hello-swift-raw-jni-callback"]), ], targets: [ - .target(name: "hello-swift-callback") + .target(name: "hello-swift-raw-jni-callback") ] ) diff --git a/hello-swift-callback/src/main/swift/Sources/hello-swift-callback/hello-swift-callback.swift b/hello-swift-raw-jni-callback/src/main/swift/Sources/hello-swift-callback/hello-swift-callback.swift similarity index 97% rename from hello-swift-callback/src/main/swift/Sources/hello-swift-callback/hello-swift-callback.swift rename to hello-swift-raw-jni-callback/src/main/swift/Sources/hello-swift-callback/hello-swift-callback.swift index cd20234..2e76e4f 100644 --- a/hello-swift-callback/src/main/swift/Sources/hello-swift-callback/hello-swift-callback.swift +++ b/hello-swift-raw-jni-callback/src/main/swift/Sources/hello-swift-callback/hello-swift-callback.swift @@ -30,7 +30,7 @@ struct JMethodID: @unchecked Sendable { let id: jmethodID } -let queue = DispatchQueue(label: "hello-swift-callback") +let queue = DispatchQueue(label: "hello-swift-raw-jni-callback") var workItem: DispatchWorkItem? = nil var activityRef: jobject? = nil diff --git a/hello-swift/.gitignore b/hello-swift-raw-jni-library/.gitignore similarity index 100% rename from hello-swift/.gitignore rename to hello-swift-raw-jni-library/.gitignore diff --git a/hello-swift-library/README.md b/hello-swift-raw-jni-library/README.md similarity index 68% rename from hello-swift-library/README.md rename to hello-swift-raw-jni-library/README.md index 3047ba0..564d8b6 100644 --- a/hello-swift-library/README.md +++ b/hello-swift-raw-jni-library/README.md @@ -1,6 +1,6 @@ # Swift as Android Library -This example demonstrates how to package Swift code as a reusable Android library. It shows how to create a Swift library that can be consumed by other Android applications, making Swift functionality available as a standard Android library component. +This example demonstrates how to package Swift code as a reusable Android library, without the use of swift-java interoperability support, just by using raw JNI. It shows how to create a Swift library that can be consumed by other Android applications, making Swift functionality available as a standard Android library component. ## Overview @@ -21,7 +21,7 @@ Before you can build and run this project, you need to have the following instal 1. Open the `swift-android-examples` project in Android Studio. -2. Select the `hello-swift-library` Gradle target. +2. Select the `hello-swift-raw-jni-library` Gradle target. 3. Build the library (it doesn't have a runnable app). @@ -29,19 +29,19 @@ Before you can build and run this project, you need to have the following instal ```bash # Build the library -./gradlew :hello-swift-library:assembleDebug +./gradlew :hello-swift-raw-jni-library:assembleDebug # Build the AAR file -./gradlew :hello-swift-library:bundleReleaseAar +./gradlew :hello-swift-raw-jni-library:bundleReleaseAar ``` -After a successful build, the Android library will be located at `hello-swift-library/build/outputs/aar/hello-swift-library-release.aar`. +After a successful build, the Android library will be located at `hello-swift-raw-jni-library/build/outputs/aar/hello-swift-raw-jni-library-release.aar`. ## Using the library in other projects 1. Copy the generated AAR file to your project's `libs/` directory 2. Add the dependency in your `build.gradle`: ```gradle - implementation files('libs/hello-swift-library-release.aar') + implementation files('libs/hello-swift-raw-jni-library-release.aar') ``` 3. Use the `SwiftLibrary` class in your code diff --git a/hello-swift-library/build.gradle.kts b/hello-swift-raw-jni-library/build.gradle.kts similarity index 100% rename from hello-swift-library/build.gradle.kts rename to hello-swift-raw-jni-library/build.gradle.kts diff --git a/hello-swift-library/src/androidTest/java/org/example/swiftlibrary/SwiftLibraryTest.kt b/hello-swift-raw-jni-library/src/androidTest/java/org/example/swiftlibrary/SwiftLibraryTest.kt similarity index 100% rename from hello-swift-library/src/androidTest/java/org/example/swiftlibrary/SwiftLibraryTest.kt rename to hello-swift-raw-jni-library/src/androidTest/java/org/example/swiftlibrary/SwiftLibraryTest.kt diff --git a/hello-swift-library/src/main/AndroidManifest.xml b/hello-swift-raw-jni-library/src/main/AndroidManifest.xml similarity index 100% rename from hello-swift-library/src/main/AndroidManifest.xml rename to hello-swift-raw-jni-library/src/main/AndroidManifest.xml diff --git a/hello-swift-library/src/main/java/org/example/swiftlibrary/SwiftLibrary.kt b/hello-swift-raw-jni-library/src/main/java/org/example/swiftlibrary/SwiftLibrary.kt similarity index 91% rename from hello-swift-library/src/main/java/org/example/swiftlibrary/SwiftLibrary.kt rename to hello-swift-raw-jni-library/src/main/java/org/example/swiftlibrary/SwiftLibrary.kt index c72a86c..4298b84 100644 --- a/hello-swift-library/src/main/java/org/example/swiftlibrary/SwiftLibrary.kt +++ b/hello-swift-raw-jni-library/src/main/java/org/example/swiftlibrary/SwiftLibrary.kt @@ -18,7 +18,7 @@ class SwiftLibrary { companion object { init { - System.loadLibrary("hello-swift-library") + System.loadLibrary("hello-swift-raw-jni-library") } } } diff --git a/hello-swift-library/src/main/swift/.gitignore b/hello-swift-raw-jni-library/src/main/swift/.gitignore similarity index 100% rename from hello-swift-library/src/main/swift/.gitignore rename to hello-swift-raw-jni-library/src/main/swift/.gitignore diff --git a/hello-swift-library/src/main/swift/Package.swift b/hello-swift-raw-jni-library/src/main/swift/Package.swift similarity index 51% rename from hello-swift-library/src/main/swift/Package.swift rename to hello-swift-raw-jni-library/src/main/swift/Package.swift index 52a4456..ad9d3b4 100644 --- a/hello-swift-library/src/main/swift/Package.swift +++ b/hello-swift-raw-jni-library/src/main/swift/Package.swift @@ -4,11 +4,11 @@ import PackageDescription let package = Package( - name: "hello-swift-library", + name: "hello-swift-raw-jni-library", products: [ - .library(name: "hello-swift-library", type: .dynamic, targets: ["hello-swift-library"]), + .library(name: "hello-swift-raw-jni-library", type: .dynamic, targets: ["hello-swift-raw-jni-library"]), ], targets: [ - .target(name: "hello-swift-library") + .target(name: "hello-swift-raw-jni-library") ] ) diff --git a/hello-swift-library/src/main/swift/Sources/helloswift/helloswift.swift b/hello-swift-raw-jni-library/src/main/swift/Sources/helloswift/helloswift.swift similarity index 100% rename from hello-swift-library/src/main/swift/Sources/helloswift/helloswift.swift rename to hello-swift-raw-jni-library/src/main/swift/Sources/helloswift/helloswift.swift diff --git a/swift-java-hashing-example/hashing-app/.gitignore b/hello-swift-raw-jni/.gitignore similarity index 100% rename from swift-java-hashing-example/hashing-app/.gitignore rename to hello-swift-raw-jni/.gitignore diff --git a/hello-swift/README.md b/hello-swift-raw-jni/README.md similarity index 75% rename from hello-swift/README.md rename to hello-swift-raw-jni/README.md index 7104af5..f1a1fe1 100644 --- a/hello-swift/README.md +++ b/hello-swift-raw-jni/README.md @@ -1,6 +1,6 @@ # Basic Swift Integration -This example demonstrates the most basic Swift integration pattern with Android. The app calls a Swift function that returns a "Hello from Swift ❤️" message and displays it in the Android UI. +This example demonstrates the most basic Swift integration pattern with Android, without the use of swift-java interoperability support, just by using raw JNI. The app calls a Swift function that returns a "Hello from Swift ❤️" message and displays it in the Android UI. ![Screenshot](screenshot.png) @@ -23,7 +23,7 @@ Before you can build and run this project, you need to have the following instal 1. Open the `swift-android-examples` project in Android Studio. -2. Select the `hello-swift` Gradle target. +2. Select the `hello-swift-raw-jni` Gradle target. 3. Run the app on an Android emulator or a physical device. @@ -31,8 +31,8 @@ Before you can build and run this project, you need to have the following instal ```bash # Build the example -./gradlew :hello-swift:assembleDebug +./gradlew :hello-swift-raw-jni:assembleDebug # Install on device/emulator -./gradlew :hello-swift:installDebug +./gradlew :hello-swift-raw-jni:installDebug ``` diff --git a/hello-swift/build.gradle.kts b/hello-swift-raw-jni/build.gradle.kts similarity index 100% rename from hello-swift/build.gradle.kts rename to hello-swift-raw-jni/build.gradle.kts diff --git a/hello-swift/screenshot.png b/hello-swift-raw-jni/screenshot.png similarity index 100% rename from hello-swift/screenshot.png rename to hello-swift-raw-jni/screenshot.png diff --git a/hello-swift/src/main/AndroidManifest.xml b/hello-swift-raw-jni/src/main/AndroidManifest.xml similarity index 100% rename from hello-swift/src/main/AndroidManifest.xml rename to hello-swift-raw-jni/src/main/AndroidManifest.xml diff --git a/hello-swift/src/main/java/org/example/helloswift/MainActivity.kt b/hello-swift-raw-jni/src/main/java/org/example/helloswift/MainActivity.kt similarity index 100% rename from hello-swift/src/main/java/org/example/helloswift/MainActivity.kt rename to hello-swift-raw-jni/src/main/java/org/example/helloswift/MainActivity.kt diff --git a/swift-java-hashing-example/hashing-app/src/main/res/drawable/ic_launcher_background.xml b/hello-swift-raw-jni/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/drawable/ic_launcher_background.xml rename to hello-swift-raw-jni/src/main/res/drawable/ic_launcher_background.xml diff --git a/swift-java-hashing-example/hashing-app/src/main/res/drawable/ic_launcher_foreground.xml b/hello-swift-raw-jni/src/main/res/drawable/ic_launcher_foreground.xml similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/drawable/ic_launcher_foreground.xml rename to hello-swift-raw-jni/src/main/res/drawable/ic_launcher_foreground.xml diff --git a/hello-swift/src/main/res/layout/activity_main.xml b/hello-swift-raw-jni/src/main/res/layout/activity_main.xml similarity index 100% rename from hello-swift/src/main/res/layout/activity_main.xml rename to hello-swift-raw-jni/src/main/res/layout/activity_main.xml diff --git a/swift-java-hashing-example/hashing-app/src/main/res/mipmap-anydpi/ic_launcher.xml b/hello-swift-raw-jni/src/main/res/mipmap-anydpi/ic_launcher.xml similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/mipmap-anydpi/ic_launcher.xml rename to hello-swift-raw-jni/src/main/res/mipmap-anydpi/ic_launcher.xml diff --git a/swift-java-hashing-example/hashing-app/src/main/res/mipmap-anydpi/ic_launcher_round.xml b/hello-swift-raw-jni/src/main/res/mipmap-anydpi/ic_launcher_round.xml similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/mipmap-anydpi/ic_launcher_round.xml rename to hello-swift-raw-jni/src/main/res/mipmap-anydpi/ic_launcher_round.xml diff --git a/swift-java-hashing-example/hashing-app/src/main/res/mipmap-hdpi/ic_launcher.webp b/hello-swift-raw-jni/src/main/res/mipmap-hdpi/ic_launcher.webp similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/mipmap-hdpi/ic_launcher.webp rename to hello-swift-raw-jni/src/main/res/mipmap-hdpi/ic_launcher.webp diff --git a/swift-java-hashing-example/hashing-app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/hello-swift-raw-jni/src/main/res/mipmap-hdpi/ic_launcher_round.webp similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/mipmap-hdpi/ic_launcher_round.webp rename to hello-swift-raw-jni/src/main/res/mipmap-hdpi/ic_launcher_round.webp diff --git a/swift-java-hashing-example/hashing-app/src/main/res/mipmap-mdpi/ic_launcher.webp b/hello-swift-raw-jni/src/main/res/mipmap-mdpi/ic_launcher.webp similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/mipmap-mdpi/ic_launcher.webp rename to hello-swift-raw-jni/src/main/res/mipmap-mdpi/ic_launcher.webp diff --git a/swift-java-hashing-example/hashing-app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/hello-swift-raw-jni/src/main/res/mipmap-mdpi/ic_launcher_round.webp similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/mipmap-mdpi/ic_launcher_round.webp rename to hello-swift-raw-jni/src/main/res/mipmap-mdpi/ic_launcher_round.webp diff --git a/swift-java-hashing-example/hashing-app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/hello-swift-raw-jni/src/main/res/mipmap-xhdpi/ic_launcher.webp similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/mipmap-xhdpi/ic_launcher.webp rename to hello-swift-raw-jni/src/main/res/mipmap-xhdpi/ic_launcher.webp diff --git a/swift-java-hashing-example/hashing-app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/hello-swift-raw-jni/src/main/res/mipmap-xhdpi/ic_launcher_round.webp similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp rename to hello-swift-raw-jni/src/main/res/mipmap-xhdpi/ic_launcher_round.webp diff --git a/swift-java-hashing-example/hashing-app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/hello-swift-raw-jni/src/main/res/mipmap-xxhdpi/ic_launcher.webp similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/mipmap-xxhdpi/ic_launcher.webp rename to hello-swift-raw-jni/src/main/res/mipmap-xxhdpi/ic_launcher.webp diff --git a/swift-java-hashing-example/hashing-app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/hello-swift-raw-jni/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp rename to hello-swift-raw-jni/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp diff --git a/swift-java-hashing-example/hashing-app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/hello-swift-raw-jni/src/main/res/mipmap-xxxhdpi/ic_launcher.webp similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp rename to hello-swift-raw-jni/src/main/res/mipmap-xxxhdpi/ic_launcher.webp diff --git a/swift-java-hashing-example/hashing-app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/hello-swift-raw-jni/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp rename to hello-swift-raw-jni/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp diff --git a/hello-swift/src/main/res/values-night/themes.xml b/hello-swift-raw-jni/src/main/res/values-night/themes.xml similarity index 100% rename from hello-swift/src/main/res/values-night/themes.xml rename to hello-swift-raw-jni/src/main/res/values-night/themes.xml diff --git a/swift-java-hashing-example/hashing-app/src/main/res/values/colors.xml b/hello-swift-raw-jni/src/main/res/values/colors.xml similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/values/colors.xml rename to hello-swift-raw-jni/src/main/res/values/colors.xml diff --git a/hello-swift/src/main/res/values/strings.xml b/hello-swift-raw-jni/src/main/res/values/strings.xml similarity index 100% rename from hello-swift/src/main/res/values/strings.xml rename to hello-swift-raw-jni/src/main/res/values/strings.xml diff --git a/hello-swift/src/main/res/values/themes.xml b/hello-swift-raw-jni/src/main/res/values/themes.xml similarity index 100% rename from hello-swift/src/main/res/values/themes.xml rename to hello-swift-raw-jni/src/main/res/values/themes.xml diff --git a/swift-java-hashing-example/hashing-app/src/main/res/xml/backup_rules.xml b/hello-swift-raw-jni/src/main/res/xml/backup_rules.xml similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/xml/backup_rules.xml rename to hello-swift-raw-jni/src/main/res/xml/backup_rules.xml diff --git a/swift-java-hashing-example/hashing-app/src/main/res/xml/data_extraction_rules.xml b/hello-swift-raw-jni/src/main/res/xml/data_extraction_rules.xml similarity index 100% rename from swift-java-hashing-example/hashing-app/src/main/res/xml/data_extraction_rules.xml rename to hello-swift-raw-jni/src/main/res/xml/data_extraction_rules.xml diff --git a/hello-swift/src/main/swift/.gitignore b/hello-swift-raw-jni/src/main/swift/.gitignore similarity index 100% rename from hello-swift/src/main/swift/.gitignore rename to hello-swift-raw-jni/src/main/swift/.gitignore diff --git a/hello-swift/src/main/swift/Package.swift b/hello-swift-raw-jni/src/main/swift/Package.swift similarity index 100% rename from hello-swift/src/main/swift/Package.swift rename to hello-swift-raw-jni/src/main/swift/Package.swift diff --git a/hello-swift/src/main/swift/Sources/helloswift/helloswift.swift b/hello-swift-raw-jni/src/main/swift/Sources/helloswift/helloswift.swift similarity index 100% rename from hello-swift/src/main/swift/Sources/helloswift/helloswift.swift rename to hello-swift-raw-jni/src/main/swift/Sources/helloswift/helloswift.swift diff --git a/settings.gradle.kts b/settings.gradle.kts index 813f6fc..0be2778 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -22,11 +22,17 @@ dependencyResolutionManagement { } rootProject.name = "Swift Android Examples" -include(":hello-swift") -include(":hello-swift-callback") -include(":hello-swift-library") + +// swift-java examples +include(":hello-swift-java-hashing-lib") +project(":hello-swift-java-hashing-lib").projectDir = file("hello-swift-java/hashing-lib") +include(":hello-swift-java-hashing-app") +project(":hello-swift-java-hashing-app").projectDir = file("hello-swift-java/hashing-app") + +// raw-jni examples +include(":hello-swift-raw-jni") +include(":hello-swift-raw-jni-callback") +include(":hello-swift-raw-jni-library") + +// native-only examples include(":native-activity") -include(":hashing-lib") -project(":hashing-lib").projectDir = file("swift-java-hashing-example/hashing-lib") -include(":hashing-app") -project(":hashing-app").projectDir = file("swift-java-hashing-example/hashing-app")