ajoklar / makepad-library-sample

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Makepad Library Sample

This PoC showcases how to reuse Rust view components created with Makepad in native Android and iOS (Kotlin and Swift) projects. For iOS this project depends on my fork of Makepad. You should not use it in production.

Makepad is a cross-platform app framework written in Rust. It allows to build complete app artifacts. At this stage it is not intended to build reusable native libraries, so I'm doing some experimentation. Other cross-platform frameworks with that feature include:

Screen Recordings

The Makepad example news_feed is presented within a Jetpack Compose / SwiftUI view hierarchy.

recording_android.webm
recording_ios.mp4

Build Instructions

  • Make sure to have cargo make and Android NDK 25.2.9519653 installed
  • Run cargo make all (or cargo make android / cargo make ios for a single platform) to build the shared Rust libraries
  • Open the folder android in Android Studio and / or iosSample in Xcode. Those are normal native projects.

Known Issues

  • You can't use multiple Makepad views in your native project

iOS

  • When adding SVG resources, the application crashes:

    -[MTLDebugRenderCommandEncoder setRenderPipelineState:]:1615: failed assertion `Set Render Pipeline State Validation For depth attachment, the renderPipelineState pixelFormat must be MTLPixelFormatInvalid, as no texture is set.

Android

  • A hacky build.rs that does not work for x86 builds

About


Languages

Language:Kotlin 39.7%Language:Java 34.2%Language:Rust 22.1%Language:Swift 3.8%Language:C 0.2%