Skip to content

Latest commit

 

History

History
1203 lines (844 loc) · 43 KB

CHANGELOG.md

File metadata and controls

1203 lines (844 loc) · 43 KB

Changelog

[0.20.1] - 2023-08-06Z

Fixed

  • Fixed --exclude-atcoder-202301-crates. (#200)

    Previously, it was for the "7/3 freeze".

[0.20.0] - 2023-08-06Z

Added

  • Added --exclude-atcoder-202301-crates. (#197)

            --exclude-atcoder-202301-crates               Alias for `--exclude {crates available on AtCoder 202301}`
  • Added --toolchain-for-proc-macro-srv. (#195)

            --toolchain-for-proc-macro-srv <TOOLCHAIN>    Toolchain for expanding procedural macros

Changed

  • Updated the embedded Rust Analyzer to 2023-07-31 (0.0.166). (#195)

    For Rust <1.64, --toolchain-for-proc-macro-srv is required for macro expansion.

    cargo +1.42.0 equip 2>&1 | tail -n 1
      Rust ≧1.64.0 is required for expanding procedural macros. Specify one with `--toolchain-for-proc-macro-srv`

    This update should fix the issue where macro expansion segfaults.

  • Renamed --toolchain to --toolchain-for-udeps. (#195)

    cargo equip --toolchain nightly
    warning: `--toolchain` was renamed to `--toolchain-for-udeps`
  • cargo-equip now warns for resolver = "2" and edition = "2015". (#196)

    Note that both has been unsupported.

    warning: Currently cargo-equip only support Feature Resovler v1, and may go search more crates than real Cargo does. Please watch https://github.com/qryxip/cargo-equip/issues/94
    warning: Rust 2015 is unsupported

Fixed

[0.19.0] - 2022-03-26Z

Added

Changed

  • Embedded rust-analyzer for expanding procedural macros. (#183)

    Previously, cargo-equip downloaded rust-analyzer(.exe) from GitHub Releases and used it.

  • Requires additional 1.48+ toolchain for compiling proc-macro crates when cargo-equip is used for an old toolchain such as 1.42. (#183)

    Previously, 1.47 was compatible.

Fixed

[0.18.1] - 2021-12-23Z

Added

Fixed

  • Now outputs from lib/bin crates are checked without test flag. (#177)

    Previously, #[test]s without #[cfg(test)] are unintentionally checked.

  • Fixed a problem where file paths are not masked in the # License and Copyright Notices section. (#178 by @SGThr7)

[0.18.0] - 2021-09-07Z

Added

  • Added --mod-path <MODULE_PATH> option. (#159)

    +        --mod-path <MODULE_PATH>           Expand the libraries to the module [default: crate::__cargo_equip]
  • Added --mine <DOMAIN_AND_USERNAME>... option. (#169)

    +        --mine <DOMAIN_AND_USERNAME>...
    +            Do not include license and copyright notices for the users.
    +
    +            Supported formats:
    +            * github.com/{username}
    +            * gitlab.com/{username}

Changed

  • Enabled running for a lib crate. (#156)

    Now you can easily produce standalone Rust source files like my_library.rs.

    cargo metadata --format-version 1 | jq -r .resolve.root | awk '{ print $1, $2 }'
    proconio 0.4.3cargo equip --minify libs --remove docs -o ./proconio.rs
  • Changed potition of the generated doc comment. (#161)

    -//! # Bundled libraries
    -//! ⋮
     use __cargo_equip::prelude::*;
    
     fn main() {}
    +/// # Bundled libraries
    +/// ⋮
     #[allow(unused)]
     mod __cargo_equip {
         // ⋮
     }
  • cargo-equip no longer uses package.authors to skip Copyright and License Notices. (#164)

    Instead, add --mine github.com/your-username to the arguments.

  • Now uses rust-analyzer 2021-07-12 for Rust 1.47 and 2021-08-09 for Rust 1.48+. (#163)

Fixed

  • #[macro_export]ed macros will remain in textual scope. (#170)

     #[macro_export]
    -macro_rules! hello {
    +macro_rules! /*hello*/__cargo_equip_macro_lib_hello {
         () => {
             ::std::println!("Hello!")
         };
     }
    +macro_rules!hello{($($tt:tt)*)=>(crate::__cargo_equip_macro_lib_hello!{$($tt)*})}
  • Improved the minification function. (#153, #157)

    -let _=| |();
    +let _=||();
  • (also applied to the previous versions unless --locked) Updated syn to v1.0.74. (#155)

    Now accepts dyn for<'a> Trait<'a>.

  • Enabled reading license files from git/path package sources. (#156)

    Previously cargo-equip reaches a todo!.

  • Now handles path dependencies correctly when checking an output. (#156, #166)

[0.17.0] - 2021-07-03Z

Changed

  • Improved the help. (#143)

    Now you can read the detailed help with --help while cargo equip -h still prints a short and concise overview.

  • Changed the format. (#144)

    • Moved __bundled to __cargo_equip::crates.
    • Moved __bundled::*::__macros to __cargo_equip::macros.
    • Now creates __cargo_equip::prelude and glob-uses it instead of declaring __prelude_for_main_crate!.
    • Unified __bundled::*::{__external_local_inner_macros, __pseudo_extern_prelude} into __cargo_equip::preludes.
    //! # Bundled libraries
    //! ︙
    
    pub use __cargo_equip::prelude::*;
    
    // ︙
    
    // The following code was expanded by `cargo-equip`.
    
    mod __cargo_equip {
        pub(crate) mod crates {/* … */}
        pub(crate) mod macros {/* … */}
        pub(crate) mod prelude {/* … */}
        mod preludes {/* … */}
    }
    
    #[cfg_attr(any(), rustfmt::skip)]
    const _: () = {
        // ︙
    };
  • Updated rust-analyzer to 2021-06-28. (#145)

[0.16.0] - 2021-06-26Z

Changed

  • --resolve-cfgs --rustfmt --check by default. (#139)

    Instead, added --no-resolve-cfgs, --no-rustfmt, and --no-check.

    cargo-equip --resolve-cfgs --rustfmt --check
    warning: `--resolve-cfgs` is deprecated. `#[cfg(..)]`s are resolved by default
    warning: `--rustfmt` is deprecated. the output is formatted by default
    warning: `--check` is deprecated. the output is checked by default
  • Removed the warning message for pub(crate) in libraries. (#138)

  • Updated --exclude-{atcoder, codingame}-crates. (#140)

    Added …#proconio:0.3.8 to --exclude-atcoder-crates.

  • Updated rust-analyzer to 2021-06-21. (#141)

[0.15.0] - 2021-06-11Z

Changed

  • cargo-equip now inserts #[allow(unused_imports)] for only seemingly procedural macros.

    use proconio::{fastout, input};

    use proconio::{/*fastout,*/ input};
    #[allow(unused_imports)]
    use proconio::fastout;

[0.14.0] - 2021-06-06Z

Added

  • Scopes for macros are now preserved. (#126)

    Now you can use macros anywhere.

    use proconio::input;
    
    fn main() {
        input! {
            n: usize,
        }
    }
  • Dummy macros are now expanded for proc-macro crates. (#126)

    Now you can also use procedural macros.

    use proconio::fastout;
    
    #[fastout]
    fn main() {
        println!("Hi");
    }
  • Now #[[warn/deny/forbid](missing-(crate-level-)docs)] attributes are removed when --remove docs is enabled. (#126)

    Now you can remove doc comments from smallvec.

  • Modules in main crates are now supported. (#129)

    mod sub {
        use smallvec::{smallvec, SmallVec};
    
        pub(crate) fn f() {
            let _: SmallVec<[(); 0]> = smallvec![];
        }
    }

Changed

  • Dropped the support for Rust 2015. (#126)

  • #[allow(unused_imports)] will be always inserted. (#126)

  • Updated rust-analyzer to 2021-05-31. (#130)

Fixed

[0.13.1] - 2021-05-22Z

Fixed

[0.13.0] - 2021-05-15Z

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)

[0.12.2] - 2021-05-11Z

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)

[0.12.1] - 2021-05-02Z

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

[0.12.0] - 2021-05-01Z

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.

[0.11.1] - 2021-03-30Z

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)

[0.11.0] - 2021-03-27Z

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.

[0.10.0] - 2021-02-28Z

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.

[0.9.3] - 2021-02-13Z

Fixed

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

[0.9.2] - 2020-12-23Z

Added

  • Enabled expanding procedural macros. (#76)

    The proc_macro crates need to use watt and have package.metadata like this.

    [package.metadata.cargo-equip.watt.proc-macro]
    input = "$OUT_DIR/macros_impl.wasm"
    
    [package.metadata.cargo-equip.watt.proc-macro-attribute]
    fastout = "$OUT_DIR/macros_impl.wasm"

    Example

    [dependencies]
    qryxip-competitive-fastout = { git = "https://github.com/qryxip/competitive-programming-library" }
    #[macro_use]
    extern crate fastout as _;
    
    #[fastout]
    fn main() {
        for i in 0..10 {
            println!("{}", i);
        }
    }

Changed

  • Changed the format of "# Bundled libraries". (#77)

    //! # Bundled libraries
    //!
    //! - `ac-library-rs-parted-internal-math 0.1.0 (git+https://github.com/qryxip/ac-library-rs-parted#0b35cf2fd575eaf8ace84340722d6cefb7e82d14)`                                    licensed under `CC0-1.0` as `crate::__ac_library_rs_parted_internal_math_0_1_0`
    //! - `ac-library-rs-parted-modint 0.1.0 (git+https://github.com/qryxip/ac-library-rs-parted#0b35cf2fd575eaf8ace84340722d6cefb7e82d14)`                                           licensed under `CC0-1.0` as `crate::acl_modint`
    //! - `local 0.0.0 (path+██████████████████████████████████████████████████)`                                                                            published in **missing** licensed under `CC0-1.0` as `crate::local`
    //! - `qryxip-competitive-input 0.0.0 (git+https://github.com/qryxip/competitive-programming-library#0d98777f6af8d6174419bf9b9a202c7f023d6857)`                                   licensed under `CC0-1.0` as `crate::input`
    //! - `qryxip-competitive-tonelli-shanks 0.0.0 (git+https://github.com/qryxip/competitive-programming-library#0d98777f6af8d6174419bf9b9a202c7f023d6857)`                          licensed under `CC0-1.0` as `crate::tonelli_shanks`
    //! - `qryxip-competitive-xorshift 0.0.0 (git+https://github.com/qryxip/competitive-programming-library#0d98777f6af8d6174419bf9b9a202c7f023d6857)`                                licensed under `CC0-1.0` as `crate::__qryxip_competitive_xorshift_0_0_0`
    //!
    //! # Procedural macros
    //!
    //! - `qryxip-competitive-fastout 0.0.0 (git+https://github.com/qryxip/competitive-programming-library#0d98777f6af8d6174419bf9b9a202c7f023d6857)` licensed under `CC0-1.0`

[0.9.1] - 2020-12-07Z

Changed

  • Changed the format of "# Bundled libraries". (#72)

    //! - `ac-library-rs-parted-internal-math 0.1.0 (git+https://github.com/qryxip/ac-library-rs-parted#3fc14c009609d8f0a3db8332493dafe457c3460f)`                      as `crate::__ac_library_rs_parted_internal_math_0_1_0`               (license: `CC0-1.0`, repository: https://github.com/qryxip/ac-library-rs-parted)
    //! - `ac-library-rs-parted-modint 0.1.0 (git+https://github.com/qryxip/ac-library-rs-parted#3fc14c009609d8f0a3db8332493dafe457c3460f)`                             as `crate::acl_modint`                                               (license: `CC0-1.0`, repository: https://github.com/qryxip/ac-library-rs-parted)
    //! - `maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)`                                                                                        as `crate::maplit`                                                   (license: `MIT/Apache-2.0`, repository: https://github.com/bluss/maplit)
    //! - `qryxips-competitive-programming-library-buffered-print 0.0.0 (path+█████████████████████████████████████████████████████████████████████████████████████)`   as `crate::buffered_print`                                           (license: `CC0-1.0`, repository: https://github.com/qryxip/oj-verify-playground)
    //! - `qryxips-competitive-programming-library-input 0.0.0 (path+████████████████████████████████████████████████████████████████████████████)`                     as `crate::input`                                                    (license: `CC0-1.0`, repository: https://github.com/qryxip/oj-verify-playground)
    //! - `qryxips-competitive-programming-library-tonelli-shanks 0.0.0 (path+███████████████████████████████████████████████████████████████████████████████████████)` as `crate::tonelli_shanks`                                           (license: `CC0-1.0`, repository: https://github.com/qryxip/oj-verify-playground)
    //! - `qryxips-competitive-programming-library-xorshift 0.0.0 (path+████████████████████████████████████████████████████████████████████████████)`                  as `crate::__qryxips_competitive_programming_library_xorshift_0_0_0` (license: `CC0-1.0`, repository: https://github.com/qryxip/oj-verify-playground)

[0.9.0] - 2020-11-27Z

Added

  • Added --exclude-atcoder-crates, --exclude-codingame-crates, and --exclude <SPEC>... options. (#68)

            --exclude <SPEC>...           Exclude library crates from bundling
            --exclude-atcoder-crates      Alias for `--exclude https://github.com/rust-lang/crates.io-index#alga:0.9.3 ..`
            --exclude-codingame-crates    Alias for `--exclude https://github.com/rust-lang/crates.io-index#chrono:0.4.9 ..`

Changed

  • Changed format of the "# Bundled libraries". (#64)

    //! # Bundled libraries
    //!
    //! - `ac-library-rs-parted-internal-math v0.1.0` → `crate::__ac_library_rs_parted_internal_math_0_1_0` (source: `git+https://github.com/qryxip/ac-library-rs-parted#3fc14c009609d8f0a3db8332493dafe457c3460f`, license: `CC0-1.0`)
    //! - `ac-library-rs-parted-modint v0.1.0` → `crate::acl_modint` (source: `git+https://github.com/qryxip/ac-library-rs-parted#3fc14c009609d8f0a3db8332493dafe457c3460f`, license: `CC0-1.0`)
    //! - `input v0.0.0` → `crate::input` (source: `git+https://github.com/qryxip/oj-verify-playground#63ddefa84d96b16cdb7f85e70dcdc4f283f57391`, license: `CC0-1.0`)
    //! - `output v0.0.0` → `crate::output` (source: `git+https://github.com/qryxip/oj-verify-playground#63ddefa84d96b16cdb7f85e70dcdc4f283f57391`, license: `CC0-1.0`)
    //! - `tonelli_shanks v0.0.0` → `crate::tonelli_shanks` (source: `git+https://github.com/qryxip/oj-verify-playground#63ddefa84d96b16cdb7f85e70dcdc4f283f57391`, license: `CC0-1.0`)
    //! - `xorshift v0.0.0` → `crate::__xorshift_0_0_0` (source: `git+https://github.com/qryxip/oj-verify-playground#63ddefa84d96b16cdb7f85e70dcdc4f283f57391`, license: `CC0-1.0`)
  • Now cargo-equip adds "License and copyright notices" to the output when you are using other people's libraries. (#64, #68)

    //! # License and Copyright Notices
    //!
    //! - `maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)`
    //!
    //!     ```text
    //!     Copyright (c) 2015
    //!
    //!     Permission is hereby granted, free of charge, to any
    //!     person obtaining a copy of this software and associated
    //!     documentation files (the "Software"), to deal in the
    //!     Software without restriction, including without
    //!     limitation the rights to use, copy, modify, merge,
    //!     publish, distribute, sublicense, and/or sell copies of
    //!     the Software, and to permit persons to whom the Software
    //!     is furnished to do so, subject to the following
    //!     conditions:
    //!
    //!     The above copyright notice and this permission notice
    //!     shall be included in all copies or substantial portions
    //!     of the Software.
    //!
    //!     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
    //!     ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
    //!     TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
    //!     PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
    //!     SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
    //!     CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
    //!     OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
    //!     IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    //!     DEALINGS IN THE SOFTWARE.
    //!     ```

    Currently, only CC0-1.0, Unlicense, MIT and Apache-2.0 are supported.

  • Now cargo-equip considers platform specific dependencies. (#66)

  • The 39 crate available on AtCoder are no longer automatically excluded from bundling. (#68)

    Enable --exlude-atcoder-crates to exclude them.

    note: attempted to bundle with the following crate(s), which are available on AtCoder. to exclude them from bundling, run with `--exclude-atcoder-crates`
    
    - `im-rc 14.3.0 (registry+https://github.com/rust-lang/crates.io-index)`
    - `rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)`

Fixed

  • extern crate {core, alloc, std}; will be just ignored. (#67)

  • Replaced -p <libraries>... for cargo check with --bin <binary> when obtaining $OUT_DIRs. (#69)

    Previously, cargo check sometimes failed.

[0.8.0] - 2020-11-13Z

Changed

  • cargo-equip now creates "pseudo extern prelude" in each library. (#60)

    Unless you use AIZU ONLINE JUDGE or yukicoder, you no longer need to declare extern crate in libraries.

    +mod __pseudo_extern_prelude {
    +    pub(super) use crate::{another_lib1, another_lib2};
    +}
    +use self::__pseudo_extern_prelude::*;
    +
     use another_lib1::A;
     use another_lib2::B;
  • Declaring extern crate .. as .. in a root module will produce a warning. (#58)

    To make your libraries compatible with Rust 2015, create a sub module and declare in it.

    mod extern_crates {
        pub(super) extern crate __another_lib as another_lib;
    }
    
    use self::extern_crates::another_lib::foo::Foo;
  • Changed #[allow(dead_code)] to #[allow(unused)]. (#60)

    unused is a group of dead-code, unused-imports, and so on.

    -#[allow(dead_code)]
    +#[allow(unused)]
     mod my_lib {
         // ...
     }

Fixed

  • Now libraries are expanded as pub mod. (#58)

     #[allow(unused)]
    -mod my_lib {
    +pub mod my_lib {
         // ...
     }

[0.7.2] - 2020-11-07Z

Added

  • Now you can skip the processes except --check. (#48)

    #![cfg_attr(cargo_equip, cargo_equip::skip)]
  • Enabled expanding code generated in custom-build. (#49)

    ::core::include!(::core::concat!(::core::env!("OUT_DIR", "/generated.rs")));

    Now you can use qryxip/ac-library-rs-parted with cargo-equip.

Fixed

  • Fixed the problem where cargo-equip did not treat proc-macro crate as libraries. (#50)

[0.7.1] - 2020-11-07Z

Added

  • Now it gives pseudo extern_crate_names like "__internal_lib_0_1_0" to dependencies of dependencies. (#43)

    You no longer need to include all of the libraries in [dependencies].

  • Supports extern crate $name as $rename in bins. (#41)

    extern crate foo as foo_;

Fixed

[0.7.0] - 2020-11-03Z

Changed

  • cargo-equip no longer consider modules. (#41)

    Split your library into separate small crates.

    .
    ├── input
    │   ├── Cargo.lock
    │   ├── Cargo.toml
    │   └── src
    │       └── lib.rs
    ├── output
    │   ├── Cargo.lock
    │   ├── Cargo.toml
    │   └── src
    │       └── lib.rs
    
  • Stopped erasing non mod items just below each lib crates. (#41)

  • Now cargo-equip inserts pub use crate::{ exported_macros } just below each mod lib_name.

  • Stopped excluding $ crate :: ident ! parts in macro_rules!. (#41)

  • Now processes #[macro_use] extern crate $name as _; in bins. (#41)

    // in main source code
    #[macro_use]
    extern crate input as _;

    // in main source code
    /*#[macro_use]
    extern crate input as _;*/
  • #![cfg_attr(cargo_equip, cargo_equip::equip)] no longer requried. (#41)

    -#![cfg_attr(cargo_equip, cargo_equip::equip)]
  • #![cfg_attr(cargo_equip, cargo_equip::use_another_lib)] no longer requried. (#41)

    -#[cfg_attr(cargo_equip, cargo_equip::use_another_lib)]
     extern crate __another_lib as another_lib;
  • #![cfg_attr(cargo_equip, cargo_equip::translate_dolalr_crates)] no longer requried. (#41)

    -#[cfg_attr(cargo_equip, cargo_equip::translate_dollar_crates)]
     #[macro_export]
     macro_rules! foo { .. }

[0.6.0] - 2020-10-24Z

Added

  • Added --resolve-cfgs option. (#35)

    This option removes:

    1. #[cfg(always_true_condition)] (e.g. cfg(feature = "enabled-feature"))
    2. Items with #[cfg(always_false_condition)] (e.g. cfg(test), cfg(feature = "disable-feature"))

Removed

  • Removed --remove test-items option. (#35)

    Use --resolve-cfgs instead.

[0.5.3] - 2020-10-24Z

Fixed

  • Fixed the minification function. (#33)

    Previously, x < -y was converted into x<-y.

[0.5.2] - 2020-10-22Z

Added

  • Improved the minification function. (#31)

[0.5.1] - 2020-10-17Z

Added

  • Now cargo-equip replaces crate path prefixes in library code with crate::extern_crate_name_in_main_crate. (#29)

[0.5.0] - 2020-10-03Z

Changed

  • Changed the process of bundling. (#27)

    Now cargo-equip "expands" each mods in lib.rs, remove unused ones, then minify the code by lib.

  • #[cfg_attr(cargo_equip, cargo_equip::equip)] now targets root modules instead of use statements. (#27)

    All of the use statements in the crate root that start with :: are expanded.

    #![cfg_attr(cargo_equip, cargo_equip::equip)]
    
    use ::__foo::{a::A, b::B};
    use ::__bar::{c::C, d::D};
  • Renamed --minify mods to --minify libs. (#27)

[0.4.1] - 2020-09-28Z

Added

  • Enabled writing package.metadata.cargo-equip.module-dependencies also in libraries. (#25)

    They are merged into one graph.

    [package.metadata.cargo-equip.module-dependencies]
    "crate::a" = []
    "crate::b" = ["crate::b"]
    "crate::c" = ["::__another_lib::d"]
    "::__another_lib::d" = ["::__another_lib::e"]

[0.4.0] - 2020-09-27Z

Added

  • Now cargo-equip supports libraries that depend on each other. (#23)

    Statements like this will be converted to use crate::..;.

    #[cfg_attr(cargo_equip, cargo_equip::use_another_lib)]
    extern crate __another_lib as another_lib;
    

Changed

  • Each library will be expanded in mod. (#23)

    More constraints were introduced. See README-ja for more details.

    #[allow(dead_code)]
    pub mod __lib {
        pub mod a {}
        pub mod b {}
        pub mod c {}
    }
  • cargo-equip will use [package.metadata.cargo-equip.module-dependencies] in the main crate. (#23)

    Package metadata in libraries is no longer read.

    And the format was also changed.

    [package.metadata.cargo-equip.module-dependencies]
    "::__atcoder::convolution" = ["::__atcoder::internal_bit", "::__atcoder::modint"]
    "::__atcoder::internal_bit" = []
    "::__atcoder::internal_math" = []
    "::__atcoder::internal_queue" = []
    "::__atcoder::internal_scc" = []
    "::__atcoder::internal_type_traits" = []
    "::__atcoder::lazysegtree" = ["::__atcoder::internal_bit", "::__atcoder::segtree"]
    "::__atcoder::math" = ["::__atcoder::internal_math"]
    "::__atcoder::maxflow" = ["::__atcoder::internal_type_traits", "::__atcoder::internal_queue"]
    "::__atcoder::mincostflow" = ["::__atcoder::internal_type_traits"]
    "::__atcoder::modint" = ["::__atcoder::internal_math"]
    "::__atcoder::scc" = ["::__atcoder::internal_scc"]
    "::__atcoder::segtree" = ["::__atcoder::internal_bit", "::__atcoder::internal_type_traits"]
    "::__atcoder::twosat" = ["::__atcoder::internal_scc"]
  • Renamed --oneline option to --minify. --oneline remains as an alias for --minify. (#21)

    With --minify option, cargo-equip removes spaces as much as possible.

    #[allow(clippy::deprecated_cfg_attr)]#[cfg_attr(rustfmt,rustfmt::skip)]pub mod factorial{pub fn factorial(n:u64)->u64{match n{0=>1,n=>n*factorial(n-1),}}}

[0.3.4] - 2020-09-21Z

Fixed

  • Fixed the problem where --remove comments ruined code that contains tuple types. (#19)

[0.3.3] - 2020-09-19Z

Fixed

  • --remove option now works for code that contains non-ASCII characters. (#16)

[0.3.2] - 2020-09-17Z

Added

  • Added --remove option. (#13)

    Now you can remove

    • Items with #[cfg(test)]
    • Doc comments (//! .., /// .., /** .. */, #[doc = ".."])
    • Comments (// .., /* .. */)

    from the output.

    pub mod a {
        //! A.
    
        /// A.
        pub struct A; // aaaaa
    
        #[cfg(test)]
        mod tests {
            #[test]
            fn it_works() {
                assert_eq!(2 + 2, 4);
            }
        }
    }

    pub mod a {
        pub struct A;
    }

[0.3.1] - 2020-09-15Z

Added

  • Enabled bundling multiple libraries.

    #[cfg_attr(cargo_equip, cargo_equip::equip)]
    use ::{
        __lib1::{a::A, b::B, c::C},
        __lib2::{d::D, e::E, f::F},
    };

[0.3.0] - 2020-09-03Z

Added

  • cargo_equip_marker is no longer required.

    #[cfg_attr(cargo_equip, cargo_equip::equip)]
    use ::__my_lib::{a::A, b::B, c::C};

Changed

  • Appends the "# Bundled libralies" section to existing doc comment.
  • Changed the format of "# Bundled libralies".

[0.2.0] - 2020-09-02Z

Changed

  • Now it includes the used module list in the output.

Fixed

  • --check option will work with { path = ".." } dependencies.