Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
47ec992
feat: add support for kotlin bindings
LarsWerkman Jan 6, 2025
1603a9f
chore: build kotlin bindings version
LarsWerkman Jan 6, 2025
e59b395
build: add proper lib dir for jna
LarsWerkman Jan 6, 2025
d1617b5
chore: rename kotlin directory to uniffi
LarsWerkman Jan 31, 2025
3abcc55
update kotlin files
stefan-gorules Feb 20, 2025
e28136f
update kotlin
stefan-gorules Feb 20, 2025
b96d036
fix workflow
stefan-gorules Feb 20, 2025
0e249b4
fix workflow
stefan-gorules Feb 20, 2025
a499580
fix
stefan-gorules Feb 20, 2025
e1c7fff
fix upload path
stefan-gorules Feb 20, 2025
8809f3b
fix
stefan-gorules Feb 20, 2025
c3ed322
fix
stefan-gorules Feb 20, 2025
159ecc1
fix fmt
stefan-gorules Feb 20, 2025
a6afa10
fix
stefan-gorules Feb 20, 2025
e6e3b75
fix
stefan-gorules Feb 20, 2025
ec1f5b4
fix
stefan-gorules Feb 20, 2025
41e89c4
fix
stefan-gorules Feb 20, 2025
aa0dda0
fix
stefan-gorules Feb 20, 2025
2e98f80
fix
stefan-gorules Feb 21, 2025
56751ea
fix
stefan-gorules Feb 21, 2025
780629f
fix charset
stefan-gorules Feb 21, 2025
592ca02
fix
stefan-gorules Feb 21, 2025
0c8ae15
fix
stefan-gorules Feb 21, 2025
96b70f9
fix
stefan-gorules Feb 22, 2025
53bfe26
fix
stefan-gorules Feb 22, 2025
323e1bb
update env variables
stefan-gorules Feb 22, 2025
8d84f54
fix
stefan-gorules Feb 22, 2025
91f86d6
add pipelines for release
stefan-gorules Feb 22, 2025
99637ce
debug
stefan-gorules Feb 22, 2025
188934b
fix
stefan-gorules Feb 22, 2025
9b3746d
fix
stefan-gorules Feb 22, 2025
43ebff0
fix
stefan-gorules Feb 22, 2025
61cb44d
fix
stefan-gorules Feb 23, 2025
99ceca3
fix
stefan-gorules Feb 23, 2025
0de1365
fix
stefan-gorules Feb 23, 2025
33a3425
fix
stefan-gorules Feb 23, 2025
0f80124
fix
stefan-gorules Feb 23, 2025
f894a7f
fix
stefan-gorules Feb 23, 2025
849ecf4
fix
stefan-gorules Feb 23, 2025
51723f4
fix build
stefan-gorules Feb 23, 2025
6db4d93
add javadoc
stefan-gorules Feb 23, 2025
f5b9762
improve bindings
stefan-gorules Feb 24, 2025
74206a8
feat: separate artifact for java and kotlin source code
LarsWerkman Jul 11, 2025
a9faed9
feat: add custom JsonBuffer type with fromString and toString abbilities
LarsWerkman Jul 14, 2025
92377d4
fix workflows
stefan-gorules Jul 25, 2025
1eb2332
fix pipeline
stefan-gorules Jul 25, 2025
4947bc4
fix gradle
stefan-gorules Jul 25, 2025
030f03f
fix: java bindings
stefan-gorules Jul 25, 2025
d09a0b8
update java
stefan-gorules Jul 25, 2025
ac38944
include kotlin in publish; bump version
stefan-gorules Jul 25, 2025
a27f18b
fix release
stefan-gorules Jul 25, 2025
fe10d86
fix
stefan-gorules Jul 25, 2025
da52566
fix publication
stefan-gorules Jul 26, 2025
7e38e48
fix missing dep
stefan-gorules Jul 26, 2025
a36f5a1
fix dep chain
stefan-gorules Jul 26, 2025
49bc711
add expression compilation
stefan-gorules Jul 26, 2025
a63ce7b
bump version
stefan-gorules Jul 26, 2025
1b9c03a
improve performance
stefan-gorules Jul 26, 2025
fe54801
improve expression api
stefan-gorules Jul 28, 2025
6044d22
fix: restore interfaces
stefan-gorules Jul 30, 2025
7a5a843
cleanup and add preliminary csharp support
stefan-gorules Jul 31, 2025
61f92ad
prepare for release
stefan-gorules Jul 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/uniffi-version-bump.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "Release: Uniffi"

env:
WORKING_DIRECTORY: bindings/uniffi

on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
default: 'patch'
type: choice
options:
- patch
- minor
- major

permissions:
contents: write

jobs:
publish:
name: Version
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.WORKING_DIRECTORY }}
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false

- name: Set Git author
run: |
git config user.name "Bot"
git config user.email "bot@gorules.io"

- uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: 'Install dependencies'
run: pip install --upgrade bump2version

- name: Bumpversion
run: bumpversion ${{ github.event.inputs.version }} --allow-dirty --tag-name "uniffi-v{new_version}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.PAT}}
137 changes: 137 additions & 0 deletions .github/workflows/uniffi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: UniFFI
env:
UNIFFI_DIRECTORY: bindings/uniffi

on:
push:
branches:
- master
tags-ignore:
- '**'
paths:
- '../../bindings/uniffi/**'
- 'core/**'
- 'test-data/**'
- '.github/workflows/uniffi.yaml'
pull_request:
paths:
- '../../bindings/uniffi/**'
- 'core/**'
- 'test-data/**'
- '.github/workflows/uniffi.yaml'

jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
env:
OUTPUT_NAME: zen_uniffi

strategy:
fail-fast: true
matrix:
settings:
- host: windows-latest
target: 'x86_64-pc-windows-msvc'
output: '{0}.dll'
lib_dir: 'win32-x86-64'
- host: macos-latest
target: 'x86_64-apple-darwin'
output: 'lib{0}.dylib'
lib_dir: 'darwin-x86-64'
- host: macos-latest
target: 'aarch64-apple-darwin'
output: 'lib{0}.dylib'
lib_dir: 'darwin-aarch64'
- host: ubuntu-latest
target: 'x86_64-unknown-linux-gnu'
output: 'lib{0}.so'
lib_dir: 'linux-x86-64'
- host: ubuntu-latest
target: 'aarch64-unknown-linux-gnu'
output: 'lib{0}.so'
lib_dir: 'linux-aarch64'

name: UniFFI - ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}

steps:
- uses: actions/checkout@v3

- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.settings.target }}

- name: Build
uses: houseabsolute/actions-rust-cross@v1
with:
working-directory: ${{ env.UNIFFI_DIRECTORY }}
target: ${{ matrix.settings.target }}
args: '--lib --release'

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.settings.lib_dir }}
path: target/${{ matrix.settings.target }}/release/${{ format(matrix.settings.output, env.OUTPUT_NAME) }}
if-no-files-found: error

release-java-kotlin:
runs-on: ubuntu-latest
needs: [ build ]
if: "startsWith(github.event.head_commit.message, 'chore(release): publish uniffi')"
defaults:
run:
working-directory: ${{ env.UNIFFI_DIRECTORY }}

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Setup Rust Toolchain
uses: dtolnay/rust-toolchain@stable

- name: Validate Gradle wrapper jar
uses: gradle/actions/wrapper-validation@v3

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: build/generated/resources

- name: Move artifacts
run: mv ../../build ./

- name: Generate Kotlin sources
run: |
cargo run --bin uniffi-bindgen -- generate \
--library build/generated/resources/darwin-x86-64/libzen_uniffi.dylib \
--language kotlin \
--out-dir build/generated/kotlin

- name: Install uniffi-bindgen-java
run: cargo install uniffi-bindgen-java

- name: Generate Java sources
run: |
uniffi-bindgen-java generate \
--library build/generated/resources/darwin-x86-64/libzen_uniffi.dylib \
--out-dir build/generated/java

- name: Print directory tree
run: tree build

- name: Publish Maven Artifact
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSPHRASE }}
run: ./gradlew publishAllPublicationsToCentralPortal
7 changes: 7 additions & 0 deletions bindings/uniffi/.bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[bumpversion]
current_version = 0.1.10
commit = True
tag = True
message = chore(release): publish uniffi

[bumpversion:file:Cargo.toml]
3 changes: 3 additions & 0 deletions bindings/uniffi/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
.gradle
build/
25 changes: 25 additions & 0 deletions bindings/uniffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[package]
name = "zen-uniffi"
version = "0.1.10"
edition = "2024"
license = "MIT"
publish = false

[lib]
crate-type = ["cdylib"]

[[bin]]
name = "uniffi-bindgen"
path = "uniffi-bindgen.rs"

[dependencies]
uniffi = { version = "0.29", features = ["tokio", "cli"] }
serde_json = { workspace = true }
zen-engine = { path = "../../core/engine" }
zen-expression = { path = "../../core/expression" }
serde = { workspace = true, features = ["derive"] }
async-trait = "0.1"
tokio = "1.46"

[build-dependencies]
uniffi = { version = "0.29", features = ["build"] }
25 changes: 25 additions & 0 deletions bindings/uniffi/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Just for local testing, at the moment it relies on .dylib (Mac), feel free to change below
build:
cargo build --lib --release
@mkdir -p build/generated/resources
cp -f ../../target/release/libzen_uniffi.dylib build/generated/resources/libzen_uniffi.dylib

generate-java:
uniffi-bindgen-java generate \
--library build/generated/resources/libzen_uniffi.dylib \
--out-dir build/generated/java

generate-kotlin:
cargo run --bin uniffi-bindgen generate \
--library build/generated/resources/libzen_uniffi.dylib \
--language kotlin \
--out-dir build/generated/kotlin

generate-csharp:
uniffi-bindgen-cs \
--library build/generated/resources/libzen_uniffi.dylib \
--out-dir build/generated/csharp

all: build generate-java generate-kotlin generate-csharp

.PHONY: all build generate-java generate-kotlin generate-csharp
Loading
Loading