Giter Site home page Giter Site logo

jothepro / djinni_build Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 86 KB

Utility to package and distribute Djinni libraries easily. Requires a project structure close to jothepro/djinni-library-template

Home Page: https://pypi.org/project/djinni-build/

License: MIT License

Python 100.00%
djinni build-tool

djinni_build's Introduction

djinni_build.py ๐ŸฆŽ

GitHub release (latest by date) GitHub PyPI - Downloads

Utility to package and distribute Djinni libraries easily.

Requirements

What it does

This utility automates the building & packaging for Djinni libraries.

It supports these platforms:

  • Android (AAR)
  • iOS (xcframework, Swiftpackage)
  • macOS (xcframework, Swiftpackage)
  • Windows (NuGet .NET package)
  • Linux (Conan)

DjinniBuild provides a CLI that allows the user to configure what the output should be.

The user is able to configure:

  • What target platform to build for (Android, iOS, macOS, Windows, Linux)
  • Which architectures to build for (x86, x86_64, armv7, armv8)
  • How to package the resulting binaries (AAR, NuGet, XCFramework, Swift Package, Conan)

For every target language, the following steps are executed:

  • Configure Project & Install Dependencies: Runs conan install for each target architecture & target platform to configure the CMake project and install all dependencies defined in the Conanfile.
  • Build: Runs conan build for each requested target architecture & platform
  • Package: Executes the platform specific packaging tasks.

How to use

Install djinni_build from PYPi:

pip install djinni_build

Then import DjinniBuild and configure the project structure and then execute the main() function:

#!/usr/bin/env python3

from djinni_build import DjinniBuild

djinniBuild = DjinniBuild(
  darwin_target='MyDjinniLibrary',
  windows_target='MyDjinniLibrary',
  android_target='MyDjinniLibrary',
  android_module_name='MyDjinniLibrary',
  nupkg_name='MyDjinniLibrary',
  conan_user='jothepro',
  conan_channel='release'
)
djinniBuild.main()

In its current state not everything in the script is configurable and some things will only work if the correct directory structures and files are present. It is recommended to strictly stick with the project structure of jothepro/djinni-library-template to avoid compatibility issues!

CLI Interface

This example output from the CLI shows what the configuration options for the user are:

usage: build.py [-h] [--configuration {release,debug}] [--android [{x86_64,x86,armv8,armv7} ...]] [--macos [{armv8,x86_64} ...]]
                [--iphonesimulator [{armv8,x86_64} ...]] [--iphoneos [{armv8,armv7} ...]] [--windows [{x86_64,x86,armv8,armv7} ...]]
                [--linux [{x86_64,x86,armv8,armv7} ...]] [--build-directory BUILD_DIRECTORY] [--build-profile CONAN_BUILD_PROFILE]
                [--package [{xcframework,swiftpackage,conan,aar,nuget} ...]]

Build & package library for different platforms

options:
  -h, --help            show this help message and exit
  --configuration {release,debug}
  --android [{x86_64,x86,armv8,armv7} ...]
                        list of architectures that the library should be built for android
  --macos [{armv8,x86_64} ...]
                        list of architectures to build for macOS
  --iphonesimulator [{armv8,x86_64} ...]
                        list of architectures to build for the iOS Simulator
  --iphoneos [{armv8,armv7} ...]
                        list of architectures to build for iOS
  --windows [{x86_64,x86,armv8,armv7} ...]
                        list of architectures to build for windows
  --linux [{x86_64,x86,armv8,armv7} ...]
                        list of architectures to build for linux
  --build-directory BUILD_DIRECTORY
  --build-profile CONAN_BUILD_PROFILE
  --package [{xcframework,swiftpackage,conan,aar,nuget} ...]
                        which packages to create. Packages that cannot be created for the selected target platforms will be ignored.

djinni_build's People

Contributors

jothepro avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.