#cargo-version #gradle #version #cargo

gradle-sync

Small utility to synchronize the gradle version with the cargo version

5 releases

Uses old Rust 2015

0.2.0 Sep 8, 2018
0.1.4 Sep 2, 2018
0.1.2 Sep 2, 2018
0.1.1 Sep 2, 2018
0.1.0 Sep 2, 2018

#1156 in Development tools

Download history 2/week @ 2023-11-27 14/week @ 2024-02-19 19/week @ 2024-02-26 11/week @ 2024-03-04 20/week @ 2024-03-11

64 downloads per month

MIT/Apache

25KB
629 lines

Gradle-Sync

Build Status Build status codecov Latest version

Small utility to synchronize the gradle version with the cargo version.

Usage

First, add build dependency in Cargo.toml:

[build-dependencies]
gradle-sync = "0.2.0"

and secondly, add the following code snippet to build.rs (with a reference to the build.gradle file):

extern crate gradle_sync;
use gradle_sync::BuildGradleFile;
use gradle_sync::GradlePropertiesFile;

fn main() {
    BuildGradleFile::new("./app/build.gradle").unwrap()
      .sync_with_cargo().unwrap();
    GradlePropertiesFile::new("./gradle.properties").unwrap()
      .sync_with_cargo().unwrap();
}

When you now build your project, the version specified in Cargo.toml file is used as versionName in the build.gradle file. If required, the versionCode is also incremented.

License

gradle-sync is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in gradle-sync by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~2.3–3.5MB
~56K SLoC