jothepro / djinni-library-template

A template for a Djinni library that can be used in Java/Kotlin, ObjC/Swift and C#
https://jothepro.github.io/djinni-library-template/cpp/
MIT License
11 stars 1 forks source link
cross-platform djinni

Djinni Library

GitHub release (latest by date) GitHub

A template for a Djinni library that can be used in Java/Kotlin on Android, ObjC/Swift on iOS/macOS and C# on Windows.

Features

How to use this template

Installation

This template integrates into each build system by providing a package format native to each platform.

Android (Android Library)

  1. Add the repository to your project
    repositories {
       maven {
           url "https://maven.pkg.github.com/jothepro/djinni-library-template"
       }
    }
  2. Add the package dependencies to your applications build.gradle file:
    dependencies {
       implementation 'my.djinnilibrary:mydjinnilibrary'
    }

Visual Studio 17 2022 (NuGet Package)

The NuGet package only works for .NET 6 (Core) Projects!

  1. Add the Package Source.
    https://nuget.pkg.github.com/jothepro/index.json
  2. In the NuGet Package Manager search for MyDjinniLibrary and install the package.

XCode (Swift Package)

  1. Add the repository jothepro/djinni-library-template-swiftpackage as Package dependency to your XCode project. It contains the XCFramework with the Objective-C binaries.
  2. Add this import to the swift code:
    import MyDjinniLibrary

Linux (Conan Recipe)

This template is meant to be used in a C++ project on Linux, e.g. together with gtkmm-3.0. The binary for Linux consists of just the C++ interface without any wrapper.

  1. Add the conan remote.
    conan remote add djinni_library_template https://gitlab.com/api/v4/projects/27897297/packages/conan
  2. Add the library as dependency in your conanfile.
    [requires]
    my_djinni_library/1.0.0@jothepro/release

Read Next: Development