Skip to content

Releases: qryxip/cargo-equip

v0.13.0

15 May 09:44
8b023d9
Compare
Choose a tag to compare

Changed

  • Now cargo-equip replaces paths and use trees that have leading semicolons. (#113)

    use ::{lib1::A, lib2::B}

    use /*::*/crate::{/*lib1*/__lib1_0_1_0::A, /*lib2*/lib2_0_1_0::B}
  • Updated rust-analyzer to 2021-05-10. (#114)

v0.12.2

11 May 18:13
a5f8dcf
Compare
Choose a tag to compare

Changed

  • Removed #[allow(clippy::deprecated_cfg_attr)]. (#110)

    -#[allow(clippy::deprecated_cfg_attr)]#[cfg_attr(rustfmt,rustfmt::skip)]#[allow(unused)]pub mod lib{/* ... */}
    +                                     #[cfg_attr(any()  ,rustfmt::skip)]#[allow(unused)]pub mod lib{/* ... */}
  • Tokens from procedural macros will be minified. (#111)

v0.12.1

02 May 19:08
b9eb114
Compare
Choose a tag to compare

Fixed

  • Recognizes #[macro_export(local_inner_macros)]. (#105)

  • Fixed a problem where $crates are not replaced with $crate::lib_name in a certain case. (#106)

  • Fixed a problem where --remove option could not be used for CRLF code. (#106)

    With the above 3 fixtures, you can bundle proconio.

    cat <<EOF >./src/main.rs
    heredoc> #[macro_use]
    heredoc> extern crate proconio as _;
    heredoc>
    heredoc> #[fastout]
    heredoc> fn main() {
    heredoc>     input!(abs: [(u64, u64)]);
    heredoc>     for (a, b) in abs {
    heredoc>         println!("{}", a + b);
    heredoc>     }
    heredoc> }
    heredoc> EOFcargo equip \
    >       --resolve-cfgs \
    >       --remove docs \
    >       --minify libs \
    >       --rustfmt \
    >       --check \
    >       -o ./bundled.rs./run-cargo-equip.bash -o ./bundled.rs
         Running `/home/ryo/.cargo/bin/rustup run nightly cargo udeps --output json -p bundle-proconio --bin bundle-proconio`
        Checking bundle-proconio v0.1.0 (/home/ryo/src/local/bundle-proconio)
        Finished dev [unoptimized + debuginfo] target(s) in 0.45s
    info: Loading save analysis from "/home/ryo/src/local/bundle-proconio/target/debug/deps/save-analysis/bundle_proconio-31a013a4acd96cad.json"
         Running `/home/ryo/.cargo/bin/rustup run stable-x86_64-unknown-linux-gnu cargo check --message-format json -p 'bundle-proconio:0.1.0' --bin bundle-proconio`
        Checking bundle-proconio v0.1.0 (/home/ryo/src/local/bundle-proconio)
        Finished dev [unoptimized + debuginfo] target(s) in 0.44s
        Spawning `/home/ryo/.cache/cargo-equip/rust-analyzer-2021-03-29 proc-macro`
         Readied `#[derive_readable]`
         Readied `#[fastout]`
        Bundling the code
    warning: found `crate` paths. replacing them with `crate::proconio`
         Reading the license file of `lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)`
         Reading the license file of `proconio 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)`
        Checking cargo-equip-check-output-fs0en4z4r1d3gd3e v0.1.0 (/tmp/cargo-equip-check-output-fs0en4z4r1d3gd3e)
        Finished dev [unoptimized + debuginfo] target(s) in 0.19sstat -c %s ./bundled.rs
    18024

    Submission Info #46571 - Library Checker

v0.12.0

01 May 03:57
f9235e4
Compare
Choose a tag to compare

Added

  • Supports #[cfg(..)] extern crate ..; items.

    Now you can bundle lazy_static.

    cat >./src/main.rs <<EOF
    heredoc> #[macro_use]
    heredoc> extern crate lazy_static as _;
    heredoc>
    heredoc> fn main() {
    heredoc>     println!("{}", *N);
    heredoc> }
    heredoc>
    heredoc> lazy_static! {
    heredoc>     static ref N: u32 = 42;
    heredoc> }
    heredoc> EOFcargo equip \
    >       --resolve-cfgs \
    >       --check \
    >       --remove docs \
    >       --minify libs \
    >       --rustfmt \
    >       -o ./bundled.rs
         Running `/home/ryo/.cargo/bin/rustup run nightly cargo udeps --output json -p bundle-proconio --bin bundle-proconio`
        Checking bundle-proconio v0.1.0 (/home/ryo/src/local/bundle-proconio)
        Finished dev [unoptimized + debuginfo] target(s) in 0.43s
    info: Loading save analysis from "/home/ryo/src/local/bundle-proconio/target/debug/deps/save-analysis/bundle_proconio-65ed1cd2cb2d0758.json"
        Bundling the code
         Reading the license file of `lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)`
        Checking cargo-equip-check-output-7l11rus91rnoie88 v0.1.0 (/tmp/cargo-equip-check-output-7l11rus91rnoie88)
        Finished dev [unoptimized + debuginfo] target(s) in 0.45sstat -c %s ./bundled.rs
    4353rustc --edition 2018 -o /tmp/bundled ./bundled.rs && /tmp/bundled
    42
  • Clones Git repositories if license files are not found in manifest_dirs.

Changed

  • cargo-equip won't error for unresolved extern crate items.

v0.11.1

30 Mar 11:56
7fba6b8
Compare
Choose a tag to compare

Added

  • Enabled using aarch64 rust-analyzers. (#99)

  • Enabled running for example targets. (#100)

    cargo equip -h | head -n 9 | tail -5
    USAGE:
        cargo equip [OPTIONS]
        cargo equip [OPTIONS] --src <PATH>
        cargo equip [OPTIONS] --bin <NAME>
        cargo equip [OPTIONS] --example <NAME>
    cargo equip … --example atcoder-abc188-a

Changed

  • Updated rust-analzyer to 2021-03-29. (#99)

Fixed

  • lib/proc-macro crates in the same packages will be included. (#100)

v0.11.0

27 Mar 11:07
c99e790
Compare
Choose a tag to compare

Changed

  • Changed the process order for bin crates. (#92)

    extern crate items are replaced after procedural macros are expanded.

    let foo = /*foo!()*/{
        /*extern crate foo as __foo ;*/
        use crate::foo as __foo;
        __foo::Foo::new()
    };
  • Added https://github.com/rust-lang/crates.io-index#proconio:0.3.7 to --exclude-atcoder-crates. (#97)

    See statiolake/proconio-rs#18.

v0.10.0

28 Feb 21:35
2a4caa9
Compare
Choose a tag to compare

Changed

  • cargo-equip now expand procedural macros using rust-analyzer(.exe).

    #[macro_use]
    extern crate memoise as _;
    #[macro_use]
    extern crate proconio_derive as _;
    
    #[fastout]
    fn main() {
        for i in 0..=100 {
            println!("{}", fib(i));
        }
    }
    
    #[memoise(n <= 100)]
    fn fib(n: i64) -> i64 {
        if n == 0 || n == 1 {
            return n;
        }
        fib(n - 1) + fib(n - 2)
    }

    Output
    //! # Procedural macros
    //!
    //! - `memoise 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)`         licensed under `BSD-3-Clause`
    //! - `proconio-derive 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)` licensed under `MIT OR Apache-2.0`
    
    /*#[macro_use]
    extern crate memoise as _;*/
    /*#[macro_use]
    extern crate proconio_derive as _;*/
    
    /*#[fastout]
    fn main() {
        for i in 0..=100 {
            println!("{}", fib(i));
        }
    }*/
    fn main() {
        let __proconio_stdout = ::std::io::stdout();
        let mut __proconio_stdout = ::std::io::BufWriter::new(__proconio_stdout.lock());
        #[allow(unused_macros)]
        macro_rules ! print { ($ ($ tt : tt) *) => { { use std :: io :: Write as _ ; :: std :: write ! (__proconio_stdout , $ ($ tt) *) . unwrap () ; } } ; }
        #[allow(unused_macros)]
        macro_rules ! println { ($ ($ tt : tt) *) => { { use std :: io :: Write as _ ; :: std :: writeln ! (__proconio_stdout , $ ($ tt) *) . unwrap () ; } } ; }
        let __proconio_res = {
            for i in 0..=100 {
                println!("{}", fib(i));
            }
        };
        <::std::io::BufWriter<::std::io::StdoutLock> as ::std::io::Write>::flush(
            &mut __proconio_stdout,
        )
        .unwrap();
        return __proconio_res;
    }
    
    /*#[memoise(n <= 100)]
    fn fib(n: i64) -> i64 {
        if n == 0 || n == 1 {
            return n;
        }
        fib(n - 1) + fib(n - 2)
    }*/
    thread_local ! (static FIB : std :: cell :: RefCell < Vec < Option < i64 > > > = std :: cell :: RefCell :: new (vec ! [None ; 101usize]));
    fn fib_reset() {
        FIB.with(|cache| {
            let mut r = cache.borrow_mut();
            for r in r.iter_mut() {
                *r = None
            }
        });
    }
    fn fib(n: i64) -> i64 {
        if let Some(ret) = FIB.with(|cache| {
            let mut bm = cache.borrow_mut();
            bm[(n) as usize].clone()
        }) {
            return ret;
        }
        let ret: i64 = (|| {
            if n == 0 || n == 1 {
                return n;
            }
            fib(n - 1) + fib(n - 2)
        })();
        FIB.with(|cache| {
            let mut bm = cache.borrow_mut();
            bm[(n) as usize] = Some(ret.clone());
        });
        ret
    }
    
    // The following code was expanded by `cargo-equip`.
    
    #[allow(clippy::deprecated_cfg_attr)]#[cfg_attr(rustfmt,rustfmt::skip)]#[allow(unused)]pub mod memoise{}
    #[allow(clippy::deprecated_cfg_attr)]#[cfg_attr(rustfmt,rustfmt::skip)]#[allow(unused)]pub mod proconio_derive{}
    • watt crate no longer necessary.
    • rust-analyzer(.exe) is automatically downloaded.
    • proc-macro crates need to be compile with Rust 1.47.0+.
      If version of the active toolchain is less than 1.47.0, cargo-equip finds an alternative toolchain and uses it for compiling proc-macros.
    • procedural macros re-exported with pub use $name::*; are also able to be expanded.

Fixed

  • Enabled handling non-Meta attribute macros such as #[memoise(n <= 100)].

  • Fixed a problem where extern crate items in a bin crate are not removed properly.

v0.9.3

13 Feb 04:16
42b837c
Compare
Choose a tag to compare

Fixed

  • Fixed inability to cargo install cargo-equip without --locked. (#79)

v0.9.2

23 Dec 15:03
3bff7e7
Compare
Choose a tag to compare
Release v0.9.2

v0.9.1

07 Dec 13:38
fb601a5
Compare
Choose a tag to compare
Release v0.9.1