Skip to content

Comments

Release 0.1.0 - REST API sample + CC/AR env vars + path fix#35

Merged
andrefigas merged 4 commits intomainfrom
feature/restapi-sample-and-cc-env-vars
Feb 7, 2026
Merged

Release 0.1.0 - REST API sample + CC/AR env vars + path fix#35
andrefigas merged 4 commits intomainfrom
feature/restapi-sample-and-cc-env-vars

Conversation

@andrefigas
Copy link
Owner

Summary

  • Fix: Rust path resolution in ReflectionJVM/ReflectionNative now resolves relative to project root instead of Gradle daemon directory
  • Feature: Pass CC_ and AR_ env vars to cargo build, enabling cross-compilation of Rust crates with C dependencies (ring, openssl-sys, libsqlite3-sys, etc.)
  • Sample: New REST API sample (sample/restapi) using Tokio + reqwest + serde calling the Dog API
  • Release: Version bump to 0.1.0 across plugin and all samples, changelog and README updated

Test plan

  • Build sample/restapi with gradlew assembleDebug (exercises CC/AR env vars)
  • Build sample/kotlin to verify path resolution fix
  • Verify version 0.1.0 in all build.gradle.kts files
  • Confirm CHANGELOG.md has 0.1.0 section with date
  • Confirm README.md lists REST API sample

ReflectionJVM and ReflectionNative used File(extension.rustPath) which
resolved relative to the Gradle daemon working directory instead of
the project root, causing "Could not find lib.rs" errors.

Changed to FileUtils.getRustDir(project, extension) which correctly
resolves relative to project.rootProject.projectDir.
Pass CC_<target> and AR_<target> env vars to cargo build, pointing to
the NDK clang and llvm-ar. This enables compilation of Rust crates
that depend on C code via cc-rs (e.g. ring, openssl-sys, libsqlite3-sys)
which was previously failing with "failed to find tool clang.exe".
@andrefigas andrefigas force-pushed the feature/restapi-sample-and-cc-env-vars branch from 3afa51c to 9b3b167 Compare February 6, 2026 19:32
New sample demonstrating HTTP client implemented purely in Rust using
Tokio runtime, reqwest with rustls-tls, and serde for JSON parsing.
Calls the Dog API (dog.ceo) with three JNI functions: getRandomDog,
listBreeds, and getBreedImage. This sample exercises the new CC/AR
env var support since reqwest depends on ring (C/ASM via cc-rs).
@andrefigas andrefigas merged commit 1a9225d into main Feb 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant