Repository navigation
ICU-21165 Produce units.txt resource file (with data from CLDR's units.xml) - #1173
Conversation
| //supplementalData/unitConstants/unitConstant[@constant="(%W)"][@value="(%A)"] | ||
| ; /unitConstants/$1 ; values="$2" | ||
|
|
||
| //supplementalData/unitConstants/unitConstant[@constant="(%W)"][@value="(%A)"][@status="(%W)"] |
There was a problem hiding this comment.
use (?:...)? for optional attributes you just ignore.
I.e. you can roll up this rule into the parent one.
Same for other rules further down.
| } | ||
| } | ||
| cldrVersion{"37"} | ||
| cldrVersion{"38"} |
There was a problem hiding this comment.
I don't know if this is wanted. You should be able to force the cldr version from the Ant build file.
There are lots of options there you might want to read up on.
There was a problem hiding this comment.
-DcldrVersion=37 cleaned this up, thanks!
| preferred{"H"} | ||
| } | ||
| } | ||
| unitPreferenceData{ |
There was a problem hiding this comment.
I can't really review the generated data, but the rest looks good (barring the small regex change).
There was a problem hiding this comment.
Generated data: tests pass, so I'm not too worried about (re)moving of data, and the new data produced is already working well for us (dev branch).
|
|
||
| # units.xml | ||
|
|
||
| //supplementalData/unitConstants/unitConstant[@constant="(%W)"][@value="(%A)"](?:[@status="(?:%W)"])? |
There was a problem hiding this comment.
You don't need the inner "(?:%W)", just "%W" will do (here and below).
| //supplementalData/unitConstants/unitConstant[@constant="(%W)"][@value="(%A)"](?:[@status="(?:%W)"])? | ||
| ; /unitConstants/$1 ; values="$2" | ||
|
|
||
| //supplementalData/unitQuantities/unitQuantity[@baseUnit="(%W)"][@quantity="(%W)"](?:[@status="(?:%W)"])? |
There was a problem hiding this comment.
Sorry this is such a repetitive slog :(
There was a problem hiding this comment.
No worries, doesn't bother me: I feel a (readable) little bit of repetition is way better than over-complication due to excessive application of "DRY" principles. ;-)
Update supplementalData.txt and units.txt from upstream PR unicode-org#1173
|
Thanks, squashing! |
66b488b to
51b2711
Compare
|
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
- Produce new supplementalData.txt and units.txt with:
ant -f build-icu-data.xml -DoutDir=/tmp/new_dir \
-DcldrVersion=37 -DoutputTypes=UNITS,SUPPLEMENTAL_DATA
51b2711 to
015d24f
Compare
|
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
Data files produced with:
Once good, commits will be squashed and approval (re-)requested for submission. Before that, only new commits added to aid code review. That's probably best-practice under just about all circumstances, right?
Checklist