Skip to content

Commit

Permalink
chore: revert back the dotlottie_ffi renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
theashraf committed Sep 17, 2024
1 parent 349900a commit 83d84f9
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 33 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@v4.0.0
with:
name: dotlottie-ffi.android.tar.gz
path: release/android/dotlottie-ffi.android.tar.gz
name: dotlottie-player.android.tar.gz
path: release/android/dotlottie-player.android.tar.gz
if-no-files-found: error
- name: Upload Artifact
uses: actions/upload-artifact@v4.0.0
with:
name: dotlottie-ffi.darwin.tar.gz
path: release/apple/dotlottie-ffi.darwin.tar.gz
name: dotlottie-player.darwin.tar.gz
path: release/apple/dotlottie-player.darwin.tar.gz
if-no-files-found: error
- name: Upload Artifact
uses: actions/upload-artifact@v4.0.0
with:
name: dotlottie-ffi.wasm.tar.gz
path: release/wasm/dotlottie-ffi.wasm.tar.gz
name: dotlottie-player.wasm.tar.gz
path: release/wasm/dotlottie-player.wasm.tar.gz
if-no-files-found: error

release:
Expand Down
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,17 @@ RELEASE := release
# Build artifact types
CORE := dotlottie-rs
RUNTIME_FFI := dotlottie-ffi
DOTLOTTIE_PLAYER := dotlottie-ffi
DOTLOTTIE_PLAYER := dotlottie-player

# Build artifacts
RUNTIME_FFI_UNIFFI_BINDINGS := uniffi-bindings

RUNTIME_FFI_STATIC_LIB := libdotlottie_ffi.a
RUNTIME_FFI_LIB := libdotlottie_ffi.so
RUNTIME_FFI_DYLIB := libdotlottie_ffi.dylib
RUNTIME_FFI_STATIC_LIB := libdotlottie_player.a
RUNTIME_FFI_LIB := libdotlottie_player.so
RUNTIME_FFI_DYLIB := libdotlottie_player.dylib

DOTLOTTIE_PLAYER_HEADER := dotlottie_uniffi.h
DOTLOTTIE_PLAYER_SWIFT := dotlottie_uniffi.swift
DOTLOTTIE_PLAYER_HEADER := dotlottie_player.h
DOTLOTTIE_PLAYER_SWIFT := dotlottie_player.swift
DOTLOTTIE_PLAYER_MODULE := DotLottiePlayer

DOTLOTTIE_PLAYER_FRAMEWORK := $(DOTLOTTIE_PLAYER_MODULE).framework
Expand All @@ -159,7 +159,7 @@ CPLUSPLUS := cpp
RUNTIME_FFI_ANDROID_ASSETS := assets
DOTLOTTIE_PLAYER_ANDROID_RELEASE_DIR := $(RELEASE)/$(ANDROID)/$(DOTLOTTIE_PLAYER)
DOTLOTTIE_PLAYER_ANDROID_SRC_DIR := $(DOTLOTTIE_PLAYER_ANDROID_RELEASE_DIR)/src/main/$(KOTLIN)
DOTLOTTIE_PLAYER_LIB := libuniffi_dotlottie_uniffi.so
DOTLOTTIE_PLAYER_LIB := libuniffi_dotlottie_player.so
DOTLOTTIE_PLAYER_GRADLE_PROPERTIES := gradle.properties

# Dependency build directories for the current machine architecture
Expand Down Expand Up @@ -296,7 +296,7 @@ if cc.get_id() == 'emscripten'
executable('$(WASM_MODULE)',
[$(shell find $(FFI_BINDINGS_DIR) -name "*.cpp" -exec printf "'%s'," {} \; 2>/dev/null)],
include_directories: '$(FFI_BINDINGS_DIR)',
link_args: ['-L$(DEPS_LIB_DIR)', '-L$(FFI_BUILD_DIR)', '-lthorvg', '-ldotlottie_ffi'],
link_args: ['-L$(DEPS_LIB_DIR)', '-L$(FFI_BUILD_DIR)', '-lthorvg', '-ldotlottie_player'],
)
else
message('The compiler is not Emscripten.')
Expand All @@ -315,7 +315,7 @@ define SETUP_MESON
-Dloaders="lottie, png, jpg, webp" \
-Ddefault_library=static \
-Dbindings=capi \
-Dlog=$(LOG) \
-Dlog=false \
-Dthreads=false \
-Dstatic=$(STATIC) \
-Dextra=$(EXTRA) \
Expand Down Expand Up @@ -377,7 +377,7 @@ define UNIFFI_BINDINGS_BUILD
--manifest-path $(RUNTIME_FFI)/Cargo.toml \
--features=uniffi/cli \
--bin uniffi-bindgen \
generate $(RUNTIME_FFI)/src/dotlottie_uniffi.udl \
generate $(RUNTIME_FFI)/src/dotlottie_player.udl \
--language $(BINDINGS_LANGUAGE) \
--out-dir $(RUNTIME_FFI)/$(RUNTIME_FFI_UNIFFI_BINDINGS)/$(BINDINGS_LANGUAGE)
endef
Expand All @@ -387,7 +387,7 @@ define UNIFFI_BINDINGS_CPP_BUILD
$(UNIFFI_BINDGEN_CPP) \
--config $(RUNTIME_FFI)/uniffi.toml \
--out-dir $(RUNTIME_FFI)/$(RUNTIME_FFI_UNIFFI_BINDINGS)/$(CPLUSPLUS) \
$(RUNTIME_FFI)/src/dotlottie_uniffi_cpp.udl
$(RUNTIME_FFI)/src/dotlottie_player_cpp.udl
sed -i .bak 's/uint8_t/char/g' $(RUNTIME_FFI)/$(RUNTIME_FFI_UNIFFI_BINDINGS)/$(CPLUSPLUS)/*
cp $(RUNTIME_FFI)/emscripten_bindings.cpp $(RUNTIME_FFI)/$(RUNTIME_FFI_UNIFFI_BINDINGS)/$(CPLUSPLUS)/.
endef
Expand Down Expand Up @@ -592,7 +592,7 @@ $$($1_THORVG_DEP_BUILD_DIR)/$(NINJA_BUILD_FILE): export PKG_CONFIG_PATH := $(PWD
$$($1_THORVG_DEP_BUILD_DIR)/$(NINJA_BUILD_FILE): THORVG_DEP_SOURCE_DIR := $(DEPS_MODULES_DIR)/$(THORVG)
$$($1_THORVG_DEP_BUILD_DIR)/$(NINJA_BUILD_FILE): THORVG_DEP_BUILD_DIR := $$($1_THORVG_DEP_BUILD_DIR)
$$($1_THORVG_DEP_BUILD_DIR)/$(NINJA_BUILD_FILE): CROSS_FILE := --cross-file $$($1_THORVG_DEP_BUILD_DIR)/../$(MESON_CROSS_FILE)
$$($1_THORVG_DEP_BUILD_DIR)/$(NINJA_BUILD_FILE): LOG := $2
$$($1_THORVG_DEP_BUILD_DIR)/$(NINJA_BUILD_FILE): LOG := false
$$($1_THORVG_DEP_BUILD_DIR)/$(NINJA_BUILD_FILE): STATIC := $3
$$($1_THORVG_DEP_BUILD_DIR)/$(NINJA_BUILD_FILE): EXTRA := $4
$$($1_THORVG_DEP_BUILD_DIR)/$(NINJA_BUILD_FILE): $$($1_THORVG_DEP_BUILD_DIR)/../$(MESON_CROSS_FILE)
Expand Down Expand Up @@ -961,7 +961,7 @@ test: test-all
test-all:
$(info $(YELLOW)Running tests for workspace$(NC))
@cargo test --release --manifest-path $(CORE)/Cargo.toml -- --test-threads=1
@cargo test --release --manifest-path $(RUNTIME_FFI)/Cargo.toml -- --test-threads=1
@cargo test --release --manifest-path $(RUNTIME_FFI)/Cargo.toml -- --test-threads=1

.PHONY: bench
bench:
Expand Down
1 change: 1 addition & 0 deletions dotlottie-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ panic = "abort"

[lib]
crate-type = ["staticlib", "cdylib", "rlib"]
name = "dotlottie_player"

[[bin]]
name = "uniffi-bindgen"
Expand Down
1 change: 1 addition & 0 deletions dotlottie-ffi/Cargo.wasm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ panic = "abort"

[lib]
crate-type = ["staticlib", "cdylib", "rlib"]
name = "dotlottie_player"

[[bin]]
name = "uniffi-bindgen"
Expand Down
4 changes: 2 additions & 2 deletions dotlottie-ffi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ fn apply_build_settings(build_settings: &BuildSettings) {

fn main() {
if is_wasm_build() {
uniffi::generate_scaffolding("src/dotlottie_uniffi_cpp.udl").unwrap();
uniffi::generate_scaffolding("src/dotlottie_player_cpp.udl").unwrap();
} else {
uniffi::generate_scaffolding("src/dotlottie_uniffi.udl").unwrap();
uniffi::generate_scaffolding("src/dotlottie_player.udl").unwrap();
}

// Apply build settings
Expand Down
4 changes: 2 additions & 2 deletions dotlottie-ffi/emscripten_bindings.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "dotlottie_uniffi.hpp"
#include "dotlottie_player.hpp"
#include <emscripten/bind.h>

using namespace emscripten;
using namespace dotlottie_uniffi;
using namespace dotlottie_player;

val buffer(DotLottiePlayer &player)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace dotlottie_uniffi {
namespace dotlottie_player {
Layout create_default_layout();
Config create_default_config();
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace dotlottie_uniffi {
namespace dotlottie_player {
Layout create_default_layout();
Config create_default_config();
};
Expand Down
4 changes: 2 additions & 2 deletions dotlottie-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ pub fn create_default_config() -> Config {

cfg_if::cfg_if! {
if #[cfg(target_arch = "wasm32")] {
uniffi::include_scaffolding!("dotlottie_uniffi_cpp");
uniffi::include_scaffolding!("dotlottie_player_cpp");
} else {
uniffi::include_scaffolding!("dotlottie_uniffi");
uniffi::include_scaffolding!("dotlottie_player");
}
}
12 changes: 6 additions & 6 deletions knope.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ versioned_files = ["dotlottie-ffi/Cargo.toml"]
changelog = "CHANGELOG.md"

[[package.assets]]
path = "release/dotlottie-ffi.darwin.tar.gz"
name = "dotlottie-ffi.darwin.tar.gz"
path = "release/dotlottie-player.darwin.tar.gz"
name = "dotlottie-player.darwin.tar.gz"

[[package.assets]]
path = "release/dotlottie-ffi.android.tar.gz"
name = "dotlottie-ffi.android.tar.gz"
path = "release/dotlottie-player.android.tar.gz"
name = "dotlottie-player.android.tar.gz"

[[package.assets]]
path = "release/dotlottie-ffi.wasm.tar.gz"
name = "dotlottie-ffi.wasm.tar.gz"
path = "release/dotlottie-player.wasm.tar.gz"
name = "dotlottie-player.wasm.tar.gz"

[[workflows]]
name = "prepare-release"
Expand Down

0 comments on commit 83d84f9

Please sign in to comment.