Skip to content

Commit 10aa1ce

Browse files
Baked data for icu_plurals, icu_timezone (#3462)
1 parent aa9a747 commit 10aa1ce

40 files changed

+2311
-1450
lines changed

.github/workflows/build-test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ jobs:
269269
with:
270270
key: download-cache
271271
path: /tmp/icu4x-source-cache
272+
- name: Install rustfmt
273+
run: rustup component add rustfmt
272274

273275
# Actual job
274276
- name: Run `cargo make ci-job-full-datagen`

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ members = [
1616
"components/locid_transform",
1717
"components/locid",
1818
"components/normalizer",
19+
"components/plurals/data",
1920
"components/plurals",
2021
"components/properties",
2122
"components/segmenter",
23+
"components/timezone/data",
2224
"components/timezone",
2325
"experimental/bies",
2426
"experimental/casemapping",

Makefile.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ dependencies = [
9797
description = "Run full data generation on latest CLDR and ICU"
9898
category = "CI"
9999
dependencies = [
100+
"bakeddata-check",
100101
"full-data",
101102
]
102103

components/plurals/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ zerovec = { version = "0.9.4", path = "../../utils/zerovec", features = ["yoke"]
3838
databake = { version = "0.1.3", path = "../../utils/databake", features = ["derive"], optional = true}
3939
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"], optional = true }
4040

41+
icu_plurals_data = { path = "data", optional = true }
42+
4143
[dev-dependencies]
4244
criterion = "0.4"
4345
icu = { path = "../icu" }
@@ -53,6 +55,7 @@ serde = ["dep:serde", "zerovec/serde", "icu_locid/serde", "icu_provider/serde"]
5355
datagen = ["serde", "zerovec/databake", "dep:databake"]
5456
experimental = []
5557
bench = ["serde"]
58+
data = ["dep:icu_plurals_data"]
5659

5760
[lib]
5861
path = "src/lib.rs"

components/plurals/README.md

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/plurals/data/Cargo.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This file is part of ICU4X. For terms of use, please see the file
2+
# called LICENSE at the top level of the ICU4X source tree
3+
# (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4+
[package]
5+
name = "icu_plurals_data"
6+
version = "0.0.0"
7+
description = "Data for the icu_plurals crate"
8+
rust-version = "1.61.0"
9+
authors = ["The ICU4X Project Developers"]
10+
edition = "2021"
11+
readme = "README.md"
12+
repository = "https://github.com/unicode-org/icu4x"
13+
homepage = "https://icu4x.unicode.org"
14+
license = "Unicode-DFS-2016"
15+
categories = ["internationalization"]
16+
# Keep this in sync with other crates unless there are exceptions
17+
include = [
18+
"data/**/*",
19+
"src/**/*",
20+
"examples/**/*",
21+
"benches/**/*",
22+
"tests/**/*",
23+
"Cargo.toml",
24+
"LICENSE",
25+
"README.md"
26+
]
27+
28+
[dependencies]

components/plurals/data/LICENSE

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE
2+
3+
See Terms of Use <https://www.unicode.org/copyright.html>
4+
for definitions of Unicode Inc.’s Data Files and Software.
5+
6+
NOTICE TO USER: Carefully read the following legal agreement.
7+
BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S
8+
DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"),
9+
YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
10+
TERMS AND CONDITIONS OF THIS AGREEMENT.
11+
IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE
12+
THE DATA FILES OR SOFTWARE.
13+
14+
COPYRIGHT AND PERMISSION NOTICE
15+
16+
Copyright © 1991-2022 Unicode, Inc. All rights reserved.
17+
Distributed under the Terms of Use in https://www.unicode.org/copyright.html.
18+
19+
Permission is hereby granted, free of charge, to any person obtaining
20+
a copy of the Unicode data files and any associated documentation
21+
(the "Data Files") or Unicode software and any associated documentation
22+
(the "Software") to deal in the Data Files or Software
23+
without restriction, including without limitation the rights to use,
24+
copy, modify, merge, publish, distribute, and/or sell copies of
25+
the Data Files or Software, and to permit persons to whom the Data Files
26+
or Software are furnished to do so, provided that either
27+
(a) this copyright and permission notice appear with all copies
28+
of the Data Files or Software, or
29+
(b) this copyright and permission notice appear in associated
30+
Documentation.
31+
32+
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
33+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
34+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
35+
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
36+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
37+
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
38+
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
39+
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
40+
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
41+
PERFORMANCE OF THE DATA FILES OR SOFTWARE.
42+
43+
Except as contained in this notice, the name of a copyright holder
44+
shall not be used in advertising or otherwise to promote the sale,
45+
use or other dealings in these Data Files or Software without prior
46+
written authorization of the copyright holder.
47+
48+
49+
50+
Portions of ICU4X may have been adapted from ICU4C and/or ICU4J.
51+
ICU 1.8.1 to ICU 57.1 © 1995-2016 International Business Machines Corporation and others.

components/plurals/data/README.md

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/plurals/data/build.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This file is part of ICU4X. For terms of use, please see the file
2+
// called LICENSE at the top level of the ICU4X source tree
3+
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4+
5+
fn main() {
6+
if std::env::var("ICU4X_DATA_DIR").is_ok() {
7+
println!("cargo:rustc-cfg=icu4x_custom_data");
8+
}
9+
println!("cargo:rerun-if-env-changed=ICU4X_DATA_DIR");
10+
}

components/plurals/data/config.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"keys": {
3+
"Explicit": [
4+
"plurals/ordinal@1",
5+
"plurals/cardinal@1"
6+
]
7+
},
8+
"locales": {
9+
"CldrSet": [
10+
"modern"
11+
]
12+
},
13+
"cldr": "Latest",
14+
"icu_export": "Latest",
15+
"segmenter_lstm": "Latest",
16+
"export": {
17+
"Baked": {
18+
"output_path": "data",
19+
"use_separate_crates": true,
20+
"pretty": true
21+
}
22+
},
23+
"overwrite": true
24+
}

components/plurals/data/data/any.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// @generated
2+
impl_any_provider!(BakedDataProvider);
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// @generated
2+
#[macro_use]
3+
#[path = "macros/plurals_cardinal_v1.data.rs"]
4+
mod plurals_cardinal_v1;
5+
#[doc(inline)]
6+
pub use __impl_plurals_cardinal_v1 as impl_plurals_cardinal_v1;
7+
#[macro_use]
8+
#[path = "macros/plurals_ordinal_v1.data.rs"]
9+
mod plurals_ordinal_v1;
10+
#[doc(inline)]
11+
pub use __impl_plurals_ordinal_v1 as impl_plurals_ordinal_v1;

0 commit comments

Comments
 (0)