Brendonovich / swift-rs

Call Swift functions from Rust with ease!
Apache License 2.0
253 stars 30 forks source link

Fix build failure, and miscellaneous cleanups #13

Closed amodm closed 1 year ago

amodm commented 1 year ago

Currently, there's a build failure when link_swift_package() is called with package_root not ending in /. This happens because cargo:rustc-link-search is determined using string concatenation. This PR modifies it to use std::path join methods instead.

When trying to test this change, I realised that there were the following other miscellaneous issues, which I've fixed as well:

  1. Removed Cargo.lock. This file is supposed to be committed to repo only by end binaries. Given that this crate is a library, it shouldn't be having this.
  2. Add tests to the repo. Without this it would be difficult to continue to expand the work of this crate. cargo test now works.
  3. Add Github Actions workflows to run cargo build and cargo test on every push to master branch, and for PRs.
  4. Include crates.io, license and build status badges in README header. The build status would start working only after you've merged this PR.
  5. Miscellaneous changes to code to satisfy rustfmt and clippy.

Thank you for this useful crate.

Brendonovich commented 1 year ago

Wowow thankyou! I haven't touched this crate in a while but it's been in need of some maintenance. CI work is great, and the package_root problem was just me being silly.