Replace build script with cargo-px

korrat
May 10, 2023, 3:41 PM
6MR76MLLBLJUVM4K4VI3SVDYLN67FDG3VTLP4S2QD4Q2QO5UKPKAC

Dependencies

  • [2] KBSTC23N Clean up testing using new builder methods on types
  • [3] 2ZQIXNEI Fix build script after dependency update
  • [4] 4W4CDACX Upgrade dependencies
  • [5] ND7GASJ4 track current column position when writing
  • [6] M7VINXOF use fixed_decimal for decimal formatting
  • [7] Q54Z5TPA reduce amount of generated data
  • [8] L7SULPX7 only rerun build script if it changes
  • [9] UESS5YZE migrate dependencies into workspace manifest
  • [10] 2Z4EGCWQ Update dependencies
  • [11] SFTEXCM4 Update dependencies
  • [12] 2JBFREZG enable additional warnings
  • [13] ONRIF4V7 add basic snapshot test for pretty printer
  • [14] MG46NYAC enable deserialization of configuration for common utilities
  • [15] 5S4MZHL5 pretty print decimals using icu
  • [16] R7S2CWF7 Add type for account segments
  • [17] QRIJE4AQ add a simple pretty printer for beancount directives
  • [18] 24CCPM5O Update dependencies
  • [19] NSWL54NM allow deriving pretty printing config from a set of directives
  • [*] 5PYSO4HI
  • [*] I2P2FTLE add basic parser for german decimals

Change contents

  • file addition: generators (d--r------)
    [21.1]
  • file addition: src (d--r------)
    [0.22]
  • file addition: bin (d--r------)
    [0.39]
  • file addition: icu-data.rs (---r------)
    [0.56]
    use std::error::Error;
    use icu_datagen::BakedOptions;
    use icu_datagen::CldrLocaleSubset;
    use icu_datagen::Out;
    use icu_datagen::SourceData;
    use icu_decimal::provider::DecimalSymbolsV1Marker;
    use icu_locid::langid;
    use icu_provider::marker::KeyedDataMarker as _;
    fn main() -> Result<(), Box<dyn Error>> {
    let source_data = SourceData::default()
    .with_cldr_for_tag(SourceData::LATEST_TESTED_CLDR_TAG, CldrLocaleSubset::Modern)?
    .with_icuexport_for_tag(SourceData::LATEST_TESTED_ICUEXPORT_TAG)?;
    let mod_directory = {
    let mut package_path = cargo_px_env::generated_pkg_manifest_path()?;
    package_path.pop();
    package_path.push("src");
    package_path.push("icu_data");
    package_path
    };
    let outputs = vec![{
    let mut options = BakedOptions::default();
    options.pretty = true;
    options.use_separate_crates = true;
    options.overwrite = true;
    Out::Baked {
    mod_directory,
    options,
    }
    }];
    icu_datagen::datagen(
    Some(&[langid!("en")]),
    &[DecimalSymbolsV1Marker::KEY],
    &source_data,
    outputs,
    )?;
    Ok(())
    }
  • file addition: Cargo.toml (---r------)
    [0.22]
    [package]
    name = "beancount-importers-generators"
    publish = false
    edition.workspace = true
    rust-version.workspace = true
    version.workspace = true
    [dependencies]
    # inherited dependencies
    camino.workspace = true
    cargo_px_env.workspace = true
    icu_datagen.workspace = true
    icu_decimal.workspace = true
    icu_locid.workspace = true
    icu_provider.workspace = true
    icu_testdata.workspace = true
  • file deletion: build.rs (---r------)
    [5.36][5.911:943](),[5.943][5.944:944]()
    //! Build script
    use icu_datagen::BakedOptions;
    use std::error::Error;
    use icu_datagen::CldrLocaleSubset;
    use icu_datagen::Out;
    use icu_datagen::SourceData;
    use icu_decimal::provider::DecimalSymbolsV1Marker;
    use icu_locid::langid;
    use icu_provider::marker::KeyedDataMarker as _;
    use std::path::PathBuf;
    // Prevent rerunning unless build script changes
    println!("cargo:rerun-if-changed=build.rs");
    let source_data = SourceData::default()
    icu_datagen::datagen(
    Some(&[langid!("en")]),
    &[DecimalSymbolsV1Marker::KEY],
    &source_data,
    }
    outputs,
    )?;
    Ok(())
    .with_cldr_for_tag(SourceData::LATEST_TESTED_CLDR_TAG, CldrLocaleSubset::Modern)?
    .with_icuexport_for_tag(SourceData::LATEST_TESTED_ICUEXPORT_TAG)?;
    let outputs = vec![{
    let mut options = BakedOptions::default();
    options.pretty = true;
    options.use_separate_crates = true;
    options.overwrite = true;
    Out::Baked {
    mod_directory: PathBuf::from("src/icu_data/"),
    options,
    }
    }];
    fn main() -> Result<(), Box<dyn Error>> {
  • replacement in common/beancount-pretty-printer/Cargo.toml at line 4
    [5.5146][5.767:792](),[5.792][5.23374:23399]()
    edition.workspace = true
    publish.workspace = true
    [5.5146]
    [5.792]
    edition.workspace = true
    publish.workspace = true
  • replacement in common/beancount-pretty-printer/Cargo.toml at line 7
    [5.822][5.822:847]()
    version.workspace = true
    [5.822]
    [5.5243]
    version.workspace = true
  • replacement in common/beancount-pretty-printer/Cargo.toml at line 14
    [5.1011][5.1011:1033](),[5.1033][5.744:775](),[5.775][5.1602:1740](),[5.1740][5.7610:7633](),[5.775][5.1033:1063](),[5.1740][5.1033:1063](),[5.7633][5.1033:1063](),[5.1033][5.1033:1063]()
    bstr.workspace = true
    fixed_decimal.workspace = true
    icu_decimal.workspace = true
    icu_locid.workspace = true
    icu_provider.workspace = true
    litemap.workspace = true
    once_cell.workspace = true
    rayon.workspace = true
    rust_decimal.workspace = true
    [5.1011]
    [5.7634]
    bstr.workspace = true
    fixed_decimal.workspace = true
    icu_decimal.workspace = true
    icu_locid.workspace = true
    icu_provider.workspace = true
    litemap.workspace = true
    once_cell.workspace = true
    rayon.workspace = true
    rust_decimal.workspace = true
    serde.workspace = true
  • replacement in common/beancount-pretty-printer/Cargo.toml at line 25
    [5.7672][5.1985:2008](),[5.2008][5.1741:1766](),[5.7672][5.1741:1766](),[5.1063][5.1741:1766]()
    serde.workspace = true
    zerovec.workspace = true
    [5.7672]
    [5.2221]
    zerovec.workspace = true
  • replacement in common/beancount-pretty-printer/Cargo.toml at line 29
    [5.873][5.2241:2264](),[5.2241][5.2241:2264]()
    insta.workspace = true
    [5.873]
    [5.1874]
    insta.workspace = true
  • replacement in common/beancount-pretty-printer/Cargo.toml at line 31
    [5.1911][2.733:754](),[2.754][5.2264:2286](),[5.1911][5.2264:2286](),[5.2264][5.2264:2286]()
    tap.workspace = true
    time.workspace = true
    [5.1911]
    [5.874]
    tap.workspace = true
    time.workspace = true
  • replacement in common/beancount-pretty-printer/Cargo.toml at line 34
    [5.875][5.875:1006](),[5.1006][5.23400:23430]()
    [build-dependencies]
    # Inherited dependencies
    icu_datagen.workspace = true
    icu_decimal.workspace = true
    icu_locid.workspace = true
    icu_provider.workspace = true
    [5.875]
    [package.metadata.px.generate]
    # The generator is a binary in the current workspace.
    # It's the only generator type we support at the moment.
    generator_type = "cargo_workspace_binary"
    # The name of the binary.
    generator_name = "icu-data"
  • edit in Cargo.toml at line 7
    [5.5454]
    [5.5454]
    "generators",
  • replacement in Cargo.toml at line 12
    [5.2350][5.1007:1026](),[5.24320][5.24320:24365](),[5.24365][5.1057:1078](),[5.1057][5.1057:1078](),[5.1078][5.24366:24416](),[5.24416][4.65:89](),[4.89][5.24440:24460](),[5.24440][5.24440:24460](),[5.24460][4.90:200](),[4.200][5.24570:24607](),[5.24570][5.24570:24607](),[5.20][5.1142:1163](),[5.11910][5.1142:1163](),[5.24607][5.1142:1163](),[5.1142][5.1142:1163](),[5.1163][5.24608:24646](),[5.24646][4.201:219](),[4.219][5.11911:11926](),[5.24664][5.11911:11926](),[5.2018][5.11911:11926](),[5.11926][4.220:237](),[4.237][5.24682:24703](),[5.24682][5.24682:24703](),[5.64][5.11944:11972](),[5.17789][5.11944:11972](),[5.24703][5.11944:11972](),[5.2039][5.11944:11972](),[5.11972][5.24704:24739](),[5.24739][4.238:254](),[4.254][5.1221:1235](),[5.17822][5.1221:1235](),[5.24755][5.1221:1235](),[5.1221][5.1221:1235](),[5.1235][5.24756:24811](),[5.24811][4.255:277](),[4.277][5.87:103](),[5.24833][5.87:103](),[5.87][5.87:103](),[5.103][5.1252:1280](),[5.11989][5.1252:1280](),[5.1252][5.1252:1280](),[5.1280][5.17879:17893](),[5.17893][4.278:298](),[4.298][5.11990:12009](),[5.24854][5.11990:12009](),[5.1300][5.11990:12009](),[5.12009][5.1319:1365](),[5.1319][5.1319:1365](),[5.1365][4.299:317]()
    arrayvec = "0.7.2"
    bstr = "1.4.0"
    clap-verbosity-flag = "2.0.1"
    color-eyre = "0.6.2"
    csv = "1.2.1"
    delegate = "0.9.0"
    extend = "1.2.0"
    fixed_decimal = "0.5.3"
    hard-xml = "1.21.0"
    icu_datagen = "1.2.5"
    icu_decimal = "1.2.0"
    icu_locid = "1.2.0"
    icu_provider = "1.2.0"
    icu_testdata = "1.2.0"
    insta = "1.29.0"
    inventory = "0.3.5"
    itertools = "0.10.5"
    lazy-regex = "2.5.0"
    linkme = "0.3.9"
    litemap = "0.7.0"
    momo = "0.2.2"
    miette = "5.8.0"
    once_cell = "1.17.1"
    pretty_assertions = "1.3.0"
    proptest = "1.1.0"
    rayon = "1.7.0"
    regex = "1.8.1"
    ron = "0.8.0"
    rust_decimal = "1.29.1"
    rust_decimal_macros = "1.29.1"
    serde_json = "1.0.96"
    snafu = "0.7.4"
    static_assertions = "1.1.0"
    tap = "1.0.1"
    test-case = "3.1.0"
    tracing = "0.1.37"
    tracing-error = "0.2.0"
    tracing-log = "0.1.3"
    typetag = "0.2.8"
    [5.2350]
    [5.24873]
    arrayvec = "0.7.2"
    beef = "0.5.2"
    bstr = "1.4.0"
    cargo_px_env = "0.1.0"
    clap-verbosity-flag = "2.0.1"
    color-eyre = "0.6.2"
    csv = "1.2.1"
    delegate = "0.9.0"
    extend = "1.2.0"
    fixed_decimal = "0.5.3"
    hard-xml = "1.21.0"
    icu_datagen = "1.2.5"
    icu_decimal = "1.2.0"
    icu_locid = "1.2.0"
    icu_provider = "1.2.0"
    icu_testdata = "1.2.0"
    insta = "1.29.0"
    inventory = "0.3.5"
    itertools = "0.10.5"
    lazy-regex = "2.5.0"
    linkme = "0.3.9"
    litemap = "0.7.0"
    miette = "5.8.0"
    momo = "0.2.2"
    once_cell = "1.17.1"
    pretty_assertions = "1.3.0"
    proptest = "1.1.0"
    rayon = "1.7.0"
    regex = "1.8.1"
    ron = "0.8.0"
    rust_decimal = "1.29.1"
    rust_decimal_macros = "1.29.1"
    serde_json = "1.0.96"
    snafu = "0.7.4"
    static_assertions = "1.1.0"
    tap = "1.0.1"
    test-case = "3.1.0"
    tracing = "0.1.37"
    tracing-error = "0.2.0"
    tracing-log = "0.1.3"
    typetag = "0.2.8"
  • replacement in Cargo.toml at line 54
    [5.24905][4.318:336]()
    zerovec = "0.9.4"
    [5.24905]
    [5.1366]
    zerovec = "0.9.4"
  • replacement in Cargo.toml at line 58
    [5.1421][5.24924:24942]()
    version = "1.1.4"
    [5.1421]
    [5.2422]
    version = "1.1.4"
  • replacement in Cargo.toml at line 62
    [5.1492][4.337:355]()
    version = "4.2.5"
    [5.1492]
    [5.2059]
    version = "4.2.5"
  • replacement in Cargo.toml at line 66
    [5.1565][5.1565:1583]()
    version = "5.4.0"
    [5.1565]
    [5.1583]
    version = "5.4.0"
  • replacement in Cargo.toml at line 70
    [5.1637][4.356:376]()
    version = "1.0.160"
    [5.1637]
    [5.1657]
    version = "1.0.160"
  • replacement in Cargo.toml at line 74
    [5.25046][5.25046:25065]()
    version = "0.3.20"
    [5.25046]
    [5.17973]
    version = "0.3.20"
  • replacement in Cargo.toml at line 78
    [5.18035][5.18035:18053]()
    version = "1.0.2"
    [5.18035]
    [5.1659]
    version = "1.0.2"
  • replacement in Cargo.toml at line 82
    [5.1730][4.377:396]()
    version = "0.3.17"
    [5.1730]
    [4.396]
    version = "0.3.17"
  • replacement in Cargo.toml at line 86
    [4.454][4.454:472]()
    version = "0.8.6"
    [4.454]
    [5.1749]
    version = "0.8.6"
  • replacement in Cargo.toml at line 89
    [5.1770][5.12140:12190](),[5.12190][5.1770:1787](),[5.1770][5.1770:1787](),[5.1787][5.23443:23459]()
    authors = ["Markus Haug <korrat@protonmail.com>"]
    edition = "2021"
    publish = false
    [5.1770]
    [4.473]
    authors = ["Markus Haug <korrat@protonmail.com>"]
    edition = "2021"
    publish = false
  • replacement in Cargo.toml at line 93
    [4.495][5.1809:1833](),[5.1809][5.1809:1833]()
    version = "0.0.0-dev.0"
    [4.495]
    [5.23460]
    version = "0.0.0-dev.0"
  • replacement in Cargo.toml at line 97
    [5.23501][5.145:165](),[5.165][5.23501:23535](),[5.23501][5.23501:23535]()
    incremental = false
    inherits = "release"
    lto = "thin"
    [5.23501]
    incremental = false
    inherits = "release"
    lto = "thin"