Skip to content

Commit

Permalink
Implements string list formatting
Browse files Browse the repository at this point in the history
A couple of changes were made:

- Implemented the basic formatting functionality, and added basic
  testing.
- Makefile was updated to include new crate for uprev and publish.
- Workflow was updated to cover various feature combinations that were
  previously not tested correctly.
- Updated all Cargo.toml files to propagate all features correctly.
  Specifically the "icu_version_64_plus" and friends were not propagated
  correctly, leading to the build simply ignoring the said features.
- Updated build.rs and in lock-step also run_bindgen.sh for rust_icu_sys
  to generate new bindings.
- Ran `make static-bindgen` to generate the new bindings.

Fixed: #115
  • Loading branch information
filmil committed Jun 10, 2020
1 parent 321c06b commit fb7c8b6
Show file tree
Hide file tree
Showing 30 changed files with 13,135 additions and 12,217 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: rust_icu default feature set
name: Test
on:
push:
branches: [ master ]
Expand All @@ -19,11 +19,28 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# This test matrix should be backfilled with more version/feature combos.
# I think any other combinations will fail today. We should fix those
# combinations, then expand this matrix.
icu_version: [63, 64, 65, 67]
feature_set: ["renaming icu_version_in_env"]
feature_set: ["renaming,icu_version_in_env"]
steps:
- uses: actions/checkout@v2
- name: Test ICU version ${{ matrix.icu_version }}
run: make DOCKER_TEST_ENV=rust_icu_testenv-${{ matrix.icu_version }} RUST_ICU_MAJOR_VERSION_NUMBER=${{ matrix.icu_version }} DOCKER_TEST_CARGO_TEST_ARGS="--no-default-features --features ${{ matrix.feature_set }}" docker-test
test-64-plus-features:
runs-on: ubuntu-latest
strategy:
matrix:
icu_version: [64, 65]
feature_set: ["renaming,icu_version_in_env,icu_version_64_plus"]
steps:
- uses: actions/checkout@v2
- name: Test ICU version ${{ matrix.icu_version }}
run: make DOCKER_TEST_ENV=rust_icu_testenv-${{ matrix.icu_version }} RUST_ICU_MAJOR_VERSION_NUMBER=${{ matrix.icu_version }} DOCKER_TEST_CARGO_TEST_ARGS="--no-default-features --features ${{ matrix.feature_set }}" docker-test
test-67-plus-features:
runs-on: ubuntu-latest
strategy:
matrix:
icu_version: [67]
feature_set: ["renaming,icu_version_in_env,icu_version_64_plus,icu_version_67_plus"]
steps:
- uses: actions/checkout@v2
- name: Test ICU version ${{ matrix.icu_version }}
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ members = [
"rust_icu_udat",
"rust_icu_udata",
"rust_icu_uenum",
"rust_icu_ulistformatter",
"rust_icu_uloc",
"rust_icu_umsg",
"rust_icu_ustring",
"rust_icu_utext",
]

2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ publish:
$(call publish,rust_icu_udata)
$(call publish,rust_icu_ucol)
$(call publish,rust_icu_umsg)
$(call publish,rust_icu_ulistformatter)
$(call publish,rust_icu)

# A helper to up-rev the cargo crate versions.
Expand Down Expand Up @@ -154,6 +155,7 @@ uprev:
$(call uprev,rust_icu_umsg)
$(call uprev,rust_icu_intl)
$(call uprev,rust_icu_ucol)
$(call uprev,rust_icu_ulistformatter)
$(call uprev,rust_icu)

cov:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

| Item | Description |
| ---- | ----------- |
| ICU 64..67 | [![Build Status `master`](https://travis-ci.org/google/rust_icu.svg?branch=master)](https://travis-ci.org/google/rust_icu) |
| ICU 64..67 | [![Test status](https://github.com/google/rust_icu/workflows/Test/badge.svg)](https://github.com/google/rust_icu/workflows/Test/badge.svg) |
| Source | https://github.com/google/rust_icu |
| README | https://github.com/google/rust_icu/blob/master/README.md |
| Coverage | [View report](/coverage/report.md)
Expand Down Expand Up @@ -48,6 +48,7 @@ coverage in the headers.
| [rust_icu](https://crates.io/crates/rust_icu)| Top-level crate. Include this if you just want to have all the functionality available for use. |
| [rust_icu_common](https://crates.io/crates/rust_icu_common)| Commonly used low-level wrappings of the bindings. |
| [rust_icu_intl](https://crates.io/crates/rust_icu_intl)| Implements ECMA 402 recommendation APIs. |
| [rust_icu_ulistformatter](https://crates.io/crates/rust_icu_ulistformatter)| Locale-sensitive list formatting support. Implements [`ulistformatter.h`](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ulistformatter_8h.html) C API header from the ICU library. |
| [rust_icu_sys](https://crates.io/crates/rust_icu_sys)| Low-level bindings code |
| [rust_icu_ucal](https://crates.io/crates/rust_icu_ucal)| ICU Calendar. Implements [`ucal.h`](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ucal_8h.html) C API header from the ICU library. |
| [rust_icu_ucol](https://crates.io/crates/rust_icu_ucol)| Collation support. Implements [`ucol.h`](https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/ucol_8h.html) C API header from the ICU library. |
Expand Down
35 changes: 34 additions & 1 deletion rust_icu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ paste = "0.1.5"
rust_icu_common = { path = "../rust_icu_common", version = "0.2.3", default-features = false }
rust_icu_sys = { path = "../rust_icu_sys", version = "0.2.3", default-features = false }
rust_icu_ucal = { path = "../rust_icu_ucal", version = "0.2.3", default-features = false }
rust_icu_ucol = { path = "../rust_icu_ucol", version = "0.2.3", default-features = false }
rust_icu_udat = { path = "../rust_icu_udat", version = "0.2.3", default-features = false }
rust_icu_udata = { path = "../rust_icu_udata", version = "0.2.3", default-features = false }
rust_icu_uenum = { path = "../rust_icu_uenum", version = "0.2.3", default-features = false }
rust_icu_ulistformatter = { path = "../rust_icu_ulistformatter", version = "0.2.3", default-features = false }
rust_icu_uloc = { path = "../rust_icu_uloc", version = "0.2.3", default-features = false }
rust_icu_ucol = { path = "../rust_icu_ucol", version = "0.2.3", default-features = false }
rust_icu_umsg = { path = "../rust_icu_umsg", version = "0.2.3", default-features = false }
rust_icu_ustring = { path = "../rust_icu_ustring", version = "0.2.3", default-features = false }
rust_icu_utext = { path = "../rust_icu_utext", version = "0.2.3", default-features = false }
Expand All @@ -43,6 +44,7 @@ use-bindgen = [
"rust_icu_udat/use-bindgen",
"rust_icu_udata/use-bindgen",
"rust_icu_uenum/use-bindgen",
"rust_icu_ulistformatter/use-bindgen",
"rust_icu_uloc/use-bindgen",
"rust_icu_umsg/use-bindgen",
"rust_icu_ustring/use-bindgen",
Expand All @@ -56,6 +58,7 @@ renaming = [
"rust_icu_udat/renaming",
"rust_icu_udata/renaming",
"rust_icu_uenum/renaming",
"rust_icu_ulistformatter/renaming",
"rust_icu_uloc/renaming",
"rust_icu_umsg/renaming",
"rust_icu_ustring/renaming",
Expand All @@ -69,6 +72,7 @@ icu_config = [
"rust_icu_udat/icu_config",
"rust_icu_udata/icu_config",
"rust_icu_uenum/icu_config",
"rust_icu_ulistformatter/icu_config",
"rust_icu_uloc/icu_config",
"rust_icu_umsg/icu_config",
"rust_icu_ustring/icu_config",
Expand All @@ -82,11 +86,40 @@ icu_version_in_env = [
"rust_icu_udat/icu_version_in_env",
"rust_icu_udata/icu_version_in_env",
"rust_icu_uenum/icu_version_in_env",
"rust_icu_ulistformatter/icu_version_in_env",
"rust_icu_uloc/icu_version_in_env",
"rust_icu_umsg/icu_version_in_env",
"rust_icu_ustring/icu_version_in_env",
"rust_icu_utext/icu_version_in_env",
]
icu_version_64_plus = [
"rust_icu_common/icu_version_64_plus",
"rust_icu_sys/icu_version_64_plus",
"rust_icu_ucal/icu_version_64_plus",
"rust_icu_ucol/icu_version_64_plus",
"rust_icu_udat/icu_version_64_plus",
"rust_icu_udata/icu_version_64_plus",
"rust_icu_uenum/icu_version_64_plus",
"rust_icu_ulistformatter/icu_version_64_plus",
"rust_icu_uloc/icu_version_64_plus",
"rust_icu_umsg/icu_version_64_plus",
"rust_icu_ustring/icu_version_64_plus",
"rust_icu_utext/icu_version_64_plus",
]
icu_version_67_plus = [
"rust_icu_common/icu_version_67_plus",
"rust_icu_sys/icu_version_67_plus",
"rust_icu_ucal/icu_version_67_plus",
"rust_icu_ucol/icu_version_67_plus",
"rust_icu_udat/icu_version_67_plus",
"rust_icu_udata/icu_version_67_plus",
"rust_icu_uenum/icu_version_67_plus",
"rust_icu_ulistformatter/icu_version_67_plus",
"rust_icu_uloc/icu_version_67_plus",
"rust_icu_umsg/icu_version_67_plus",
"rust_icu_ustring/icu_version_67_plus",
"rust_icu_utext/icu_version_67_plus",
]

[badges]
maintenance = { status = "actively-developed" }
Expand Down
2 changes: 2 additions & 0 deletions rust_icu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
//! | rust_icu_udat | icu::dat |
//! | rust_icu_udata | icu::data |
//! | rust_icu_uenum | icu::enums |
//! | rust_icu_ulistformatter | icu::listformatter |
//! | rust_icu_uloc | icu::loc |
//! | rust_icu_umsg | icu::msg |
//! | rust_icu_ustring | icu::string |
Expand All @@ -46,6 +47,7 @@ pub use rust_icu_ucol as col;
pub use rust_icu_udat as dat;
pub use rust_icu_udata as data;
pub use rust_icu_uenum as enums;
pub use rust_icu_ulistformatter as listformatter;
pub use rust_icu_uloc as loc;
pub use rust_icu_umsg as msg;
pub use rust_icu_ustring as string;
Expand Down
6 changes: 6 additions & 0 deletions rust_icu_common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ use-bindgen = ["rust_icu_sys/use-bindgen"]
renaming = ["rust_icu_sys/renaming"]
icu_config = ["rust_icu_sys/icu_config"]
icu_version_in_env = ["rust_icu_sys/icu_version_in_env"]
icu_version_64_plus = [
"rust_icu_sys/icu_version_64_plus",
]
icu_version_67_plus = [
"rust_icu_sys/icu_version_67_plus",
]

[badges]
maintenance = { status = "actively-developed" }
Expand Down
48 changes: 43 additions & 5 deletions rust_icu_intl/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,54 @@ paste = "0.1.5"
rust_icu_common = { path = "../rust_icu_common", version = "0.2.3", default-features = false }
rust_icu_sys = { path = "../rust_icu_sys", version = "0.2.3", default-features = false }
rust_icu_uloc = { path = "../rust_icu_uloc", version = "0.2.3", default-features = false }
rust_icu_ustring = { path = "../rust_icu_ustring", version = "0.2.3", default-features = false }
rust_icu_umsg = { path = "../rust_icu_umsg", version = "0.2.3", default-features = false }
rust_icu_ustring = { path = "../rust_icu_ustring", version = "0.2.3", default-features = false }
thiserror = "1.0.9"

# See the feature description in ../rust_icu_sys/Cargo.toml for details.
[features]
default = ["use-bindgen", "renaming", "icu_config"]

use-bindgen = ["rust_icu_sys/use-bindgen", "rust_icu_common/use-bindgen"]
renaming = ["rust_icu_sys/renaming", "rust_icu_common/renaming"]
icu_config = ["rust_icu_sys/icu_config", "rust_icu_common/icu_config"]
icu_version_in_env = ["rust_icu_sys/icu_version_in_env", "rust_icu_common/icu_version_in_env"]
use-bindgen = [
"rust_icu_common/use-bindgen",
"rust_icu_sys/use-bindgen",
"rust_icu_uloc/use-bindgen",
"rust_icu_umsg/use-bindgen",
"rust_icu_ustring/use-bindgen",
]
renaming = [
"rust_icu_common/renaming",
"rust_icu_sys/renaming",
"rust_icu_uloc/renaming",
"rust_icu_umsg/renaming",
"rust_icu_ustring/renaming",
]
icu_config = [
"rust_icu_common/icu_config",
"rust_icu_sys/icu_config",
"rust_icu_uloc/icu_config",
"rust_icu_umsg/icu_config",
"rust_icu_ustring/icu_config",
]
icu_version_in_env = [
"rust_icu_common/icu_version_in_env",
"rust_icu_sys/icu_version_in_env",
"rust_icu_uloc/icu_version_in_env",
"rust_icu_umsg/icu_version_in_env",
"rust_icu_ustring/icu_version_in_env",
]
icu_version_64_plus = [
"rust_icu_common/icu_version_64_plus",
"rust_icu_sys/icu_version_64_plus",
"rust_icu_uloc/icu_version_64_plus",
"rust_icu_umsg/icu_version_64_plus",
"rust_icu_ustring/icu_version_64_plus",
]
icu_version_67_plus = [
"rust_icu_common/icu_version_67_plus",
"rust_icu_sys/icu_version_67_plus",
"rust_icu_uloc/icu_version_67_plus",
"rust_icu_umsg/icu_version_67_plus",
"rust_icu_ustring/icu_version_67_plus",
]

3 changes: 3 additions & 0 deletions rust_icu_sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ use-bindgen = ["bindgen"]
renaming = []
icu_config = []
icu_version_in_env = []
icu_version_64_plus = []
icu_version_67_plus = []


[badges]
maintenance = { status = "actively-developed" }
Expand Down
Loading

0 comments on commit fb7c8b6

Please sign in to comment.