mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-05 21:45:37 +00:00
ICU-22324 Mavenization, updating the cldr-to-icu scripts and instructions
This commit is contained in:
parent
869713b65f
commit
5fb2a6ad06
26 changed files with 156 additions and 76 deletions
|
@ -105,7 +105,7 @@ The project is released under [LICENSE](./LICENSE).
|
|||
[bugs]: https://icu.unicode.org/bugs
|
||||
[cintltst]: ./icu4c/source/test/cintltst/
|
||||
[coding-guidelines]: docs/userguide/dev/codingguidelines.md
|
||||
[com.ibm.icu.dev.test]: ./icu4j/main/tests/framework/src/com/ibm/icu/dev/test/
|
||||
[com.ibm.icu.dev.test]: ./icu4j/main/framework/src/test/java/com/ibm/icu/dev/test/
|
||||
[contacts]: https://icu.unicode.org/contacts
|
||||
[copyright]: http://www.unicode.org/copyright.html
|
||||
[design]: docs/userguide/icu/design.md
|
||||
|
|
|
@ -87,7 +87,7 @@ considerations:
|
|||
|
||||
There are several environment variables that need to be defined.
|
||||
|
||||
1. Java- and ant-related variables
|
||||
1. Java-, ant-, and maven-related variables
|
||||
|
||||
* `JAVA_HOME`: Path to JDK (a directory, containing e.g. `bin/java`, `bin/javac`,
|
||||
etc.); on many systems this can be set using the output of `/usr/libexec/java_home`.
|
||||
|
@ -95,6 +95,9 @@ There are several environment variables that need to be defined.
|
|||
* `ANT_OPTS`: You may want to set `-Xmx8192m` to give Java more memory; otherwise
|
||||
it may run out of heap.
|
||||
|
||||
* `MAVEN_ARGS`: You may want to set `--no-transfer-progress` to reduce the noise
|
||||
from the download progress.
|
||||
|
||||
2. CLDR-related variables
|
||||
|
||||
* `CLDR_DIR`: This is the path to the to root of standard CLDR sources, below
|
||||
|
@ -123,10 +126,11 @@ There are several environment variables that need to be defined.
|
|||
|
||||
## 1 Environment variables
|
||||
|
||||
1a. Java and ant variables, adjust for your system
|
||||
1a. Java, ant, and maven variables, adjust for your system
|
||||
```
|
||||
export JAVA_HOME=`/usr/libexec/java_home`
|
||||
export JAVA_HOME=/usr/libexec/java_home
|
||||
export ANT_OPTS="-Xmx8192m"
|
||||
export MAVEN_ARGS="--no-transfer-progress"
|
||||
```
|
||||
|
||||
1b. CLDR variables, adjust for your setup; with cygwin it might be e.g.
|
||||
|
@ -154,6 +158,11 @@ export NOTES=...(some directory)...
|
|||
mkdir -p $NOTES
|
||||
```
|
||||
|
||||
1e. The name of the icu data directory for Java (for example `icudt74b`)
|
||||
```
|
||||
export ICU_DATA_VER=icudt(version)b
|
||||
```
|
||||
|
||||
## 2 Initial builds of ICU4C and ICU4J
|
||||
|
||||
2a. Configure ICU4C, build and test without new data first, to verify that
|
||||
|
@ -173,16 +182,8 @@ there are no pre-existing errors (or at least to have the pre-existing errors
|
|||
as a base for comparison):
|
||||
```
|
||||
cd $ICU4J_ROOT
|
||||
ant clean
|
||||
ant check 2>&1 | tee $NOTES/icu4j-oldData-antCheck.txt
|
||||
```
|
||||
|
||||
2c. Additionally for ICU4J, repeat the same as 2b, but for building with
|
||||
Maven instead of with Ant.
|
||||
```
|
||||
cd $ICU4J_ROOT/maven-build
|
||||
mvn clean
|
||||
mvn verify 2>&1 | tee $NOTES/icu4j-oldData-mvnVerify.txt
|
||||
mvn verify 2>&1 | tee $NOTES/icu4j-oldData-mvnCheck.txt
|
||||
```
|
||||
|
||||
## 3 Make pre-adjustments
|
||||
|
@ -272,9 +273,9 @@ ant copy-cldr-testdata
|
|||
5d. Copy localeCanonicalization.txt from CLDR testData and add a source reference line:
|
||||
```
|
||||
cp -p $CLDR_DIR/common/testData/localeIdentifiers/localeCanonicalization.txt $ICU4C_DIR/source/test/testdata/
|
||||
cp -p $CLDR_DIR/common/testData/localeIdentifiers/localeCanonicalization.txt $ICU4J_ROOT/main/tests/core/src/com/ibm/icu/dev/data/unicode/
|
||||
cp -p $CLDR_DIR/common/testData/localeIdentifiers/localeCanonicalization.txt $ICU4J_ROOT/main/core/src/test/resources/com/ibm/icu/dev/data/unicode/
|
||||
open $ICU4C_DIR/source/test/testdata/localeCanonicalization.txt
|
||||
open $ICU4J_ROOT/main/tests/core/src/com/ibm/icu/dev/data/unicode/localeCanonicalization.txt
|
||||
open $ICU4J_ROOT/main/core/src/test/resources/com/ibm/icu/dev/data/unicode/localeCanonicalization.txt
|
||||
```
|
||||
At the beginning of each file add the following line:\
|
||||
```
|
||||
|
@ -283,7 +284,7 @@ At the beginning of each file add the following line:\
|
|||
|
||||
5e. For now, manually re-add the `lstm` entries in `data/brkitr/root.txt`
|
||||
```
|
||||
open $ICU4C_DIR/source/data/brkitr/root.txt
|
||||
open $ICU4C_DIR/source/data/brkitr/root.txt
|
||||
```
|
||||
Paste the following block after the dictionaries block and before the final closing '}':
|
||||
```
|
||||
|
@ -340,7 +341,7 @@ cd test/intltest
|
|||
DYLD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$DYLD_LIBRARY_PATH ./intltest -e -G format/NumberTest/NumberPermutationTest
|
||||
cd ../..
|
||||
|
||||
cd build/test/cintltst
|
||||
cd test/cintltst
|
||||
DYLD_LIBRARY_PATH=../../lib:../../stubdata:../../tools/ctestfw:$DYLD_LIBRARY_PATH ./cintltst /tsformat/ccaltst
|
||||
cd ../../..
|
||||
```
|
||||
|
@ -411,22 +412,28 @@ make icu4j-data-install
|
|||
|
||||
12d. Update the extracted {main, test} data files in the Maven build
|
||||
```
|
||||
cd $ICU4J_ROOT/maven-build
|
||||
sh ./extract-data-files.sh
|
||||
cd $ICU4J_ROOT
|
||||
./extract-data-files.sh
|
||||
```
|
||||
|
||||
## 13 Rebuild ICU4J with new data, run tests
|
||||
|
||||
13a. Run the tests using the ant build
|
||||
13a. Run the tests using the maven build
|
||||
```
|
||||
cd $ICU4J_ROOT
|
||||
ant clean
|
||||
ant check 2>&1 | tee $NOTES/icu4j-newData-antCheck.txt
|
||||
mvn clean
|
||||
mvn verify 2>&1 | tee $NOTES/icu4j-newData-mvnCheck.txt
|
||||
```
|
||||
|
||||
To re-run a specific test if necessary when fixing bugs; for example:
|
||||
It is possible to re-run a specific test class or method if necessary when fixing bugs.
|
||||
|
||||
For example (using artifactId, full class name, test all methods):
|
||||
```
|
||||
ant checkTest -Dtestclass='com.ibm.icu.dev.test.format.MeasureUnitTest'
|
||||
mvn test -pl :core -Dtest=com.ibm.icu.dev.test.util.LocaleBuilderTest
|
||||
```
|
||||
or (example of using module path, class name, one method):
|
||||
```
|
||||
mvn test -pl main/common_tests -Dtest=MeasureUnitTest#TestGreek
|
||||
```
|
||||
|
||||
13b. Optionally run the tests in exhautive mode
|
||||
|
@ -435,22 +442,15 @@ Optionally run before committing changes, or run to diagnose failures from
|
|||
running exhastive CI tests in the PR using `/azp run CI-Exhaustive`:
|
||||
```
|
||||
cd $ICU4J_ROOT
|
||||
ant exhaustiveCheck 2>&1 | tee $NOTES/icu4j-newData-antCheckEx.txt
|
||||
mvn verify -DICU.exhaustive=10 2>&1 | tee $NOTES/icu4j-newData-mvnCheckEx.txt
|
||||
```
|
||||
(Not sure there is a way to re-run a specific test in exhaustive mode)
|
||||
|
||||
13c. Run the tests using the Maven build
|
||||
Running a specific test is the same as above:
|
||||
```
|
||||
cd $ICU4J_ROOT/maven-build
|
||||
mvn verify 2>&1 | tee $NOTES/icu4j-newData-mavenVerify.txt
|
||||
mvn test --pl :core -DICU.exhaustive=10 -Dtest=ExhaustiveNumberTest
|
||||
```
|
||||
Currently (due to maven sync issues?) there may be errors in these
|
||||
local maven tests even if there are no errors in the ant check tests.
|
||||
Such maven errors should not be blockers for a commit and push; they
|
||||
may not show up in the CI maven tests (but if they do and do not go
|
||||
away after re-running the CI test, then they need investigation).
|
||||
|
||||
## 14 Investigate and fix ant check test failures
|
||||
## 14 Investigate and fix maven check test failures
|
||||
|
||||
Fix test cases and repeat from step 13, or fix CLDR data and repeat from
|
||||
step 4, as appropriate, until there are no more failures in ICU4C or ICU4J.
|
||||
|
@ -477,7 +477,7 @@ com.ibm.icu.dev.test.format.PluralRulesTest (TestLocales)
|
|||
|
||||
To address these requires updating the LOCALE_SNAPSHOT data in
|
||||
```
|
||||
$ICU4J_ROOT/main/tests/core/src/com/ibm/icu/dev/test/format/PluralRulesTest.java
|
||||
$ICU4J_ROOT/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/PluralRulesTest.java
|
||||
```
|
||||
by modifying the TestLocales() test there to run `generateLOCALE_SNAPSHOT()` and
|
||||
then copying in the updated data.
|
||||
|
@ -488,7 +488,7 @@ then copying in the updated data.
|
|||
cd $ICU4C_DIR/source
|
||||
make clean
|
||||
cd $ICU4J_ROOT
|
||||
ant clean
|
||||
mvn clean
|
||||
cd ..
|
||||
git status
|
||||
```
|
||||
|
|
|
@ -472,7 +472,7 @@ usually done just before publishing release candidate.
|
|||
3. Run - `ant serialTestData`
|
||||
4. Copy a folder with ICU version (e.g. ICU_61.1) generated under <icu4j
|
||||
root>/out/serialTestData to <icu4j
|
||||
root>/main/tests/core/src/com/ibm/icu/dev/test/serializable/data.
|
||||
root>/main/core/src/test/resources/com/ibm/icu/dev/test/serializable/data.
|
||||
5. Delete the oldest serialization test data after ICU 3.6 (do not delete ICU_3.6) from the directory.
|
||||
the oldest one - ICU_3.6).
|
||||
6. Run `ant check` again before committing the changes.
|
||||
|
|
|
@ -39,7 +39,7 @@ and use it for future testing.
|
|||
2. The target generates test data and runs some serialization test cases.
|
||||
3. Once you confirm the test runs clean, copy
|
||||
`out/serialTestData/ICU_<version>` to
|
||||
`main/tests/core/src/com/ibm/icu/dev/test/serializable/data/ICU_<version>`.
|
||||
`main/core/src/test/resources/com/ibm/icu/dev/test/serializable/data/ICU_<version>`.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ After syncing CLDR data with ICU do the following. This documentation assumes
|
|||
that you are updating the MeasureUnit clases for ICU 68.
|
||||
|
||||
* Check out
|
||||
$GIT_ROOT/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java
|
||||
$GIT_ROOT/icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/MeasureUnitTest.java
|
||||
* Open MeasureUnitTest.java.
|
||||
* Find the `testZZZ` test, its code should all be commented out. This test will
|
||||
execute last and will run the desired code.
|
||||
|
@ -57,7 +57,7 @@ that you are updating the MeasureUnit clases for ICU 68.
|
|||
* Change `testZZZ` to run `generateConstants(“68”); // ICU 68.`
|
||||
* Run MeasureUnitTest.java, copy the generated code (see instructions above).
|
||||
* Open MeasureUnit.java:
|
||||
$GIT_ROOT/icu4j/main/classes/core/src/com/ibm/icu/util/MeasureUnit.java
|
||||
$GIT_ROOT/icu4j/main/core/src/main/java/com/ibm/icu/util/MeasureUnit.java
|
||||
* Look for line containing:
|
||||
|
||||
`// Start generated MeasureUnit constants`
|
||||
|
|
|
@ -146,7 +146,7 @@ For updating ICU version numbers, follow the steps below.
|
|||
number such as "60.1" for official releases, "61.1-SNAPSHOT" until 61.1
|
||||
release, after 60.1.
|
||||
|
||||
3. [icu4j/main/classes/core/src/com/ibm/icu/util/VersionInfo.java](https://github.com/unicode-org/icu/blob/main/icu4j/main/classes/core/src/com/ibm/icu/util/VersionInfo.java)
|
||||
3. [icu4j/main/core/src/main/java/com/ibm/icu/util/VersionInfo.java](https://github.com/unicode-org/icu/blob/main/icu4j/main/core/src/main/java/com/ibm/icu/util/VersionInfo.java)
|
||||
|
||||
There is a static block starting at line 501 (as of 54.1) in the source file -
|
||||
|
||||
|
@ -270,7 +270,7 @@ For updating ICU version numbers, follow the steps below.
|
|||
example, see
|
||||
[tags/release-4-4-2-eclipse37-20110208/eclipse-build/build.properties](http://source.icu-project.org/repos/icu/tags/icu4j/release-4-4-2-eclipse37-20110208/eclipse-build/build.properties).
|
||||
|
||||
7. [DebugUtilitiesData.java](https://github.com/unicode-org/icu/blob/main/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/DebugUtilities.java)
|
||||
7. [DebugUtilitiesData.java](https://github.com/unicode-org/icu/blob/main/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/util/DebugUtilities.java)
|
||||
|
||||
This file is automatically generated when data is generated for ICU4J. The
|
||||
ICU4C version number string should be check to ensure that the correct
|
||||
|
|
|
@ -50,9 +50,9 @@ Often ICU will implement draft versions of proposed specification updates, to ch
|
|||
|||
|
||||
| icu/icu4j/...
|
||||
| .../main/shared/data/icudata.jar | Data jar, includes break rules. Derived from ICU4C.
|
||||
| .../main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt | Test data, copied from ICU4C.
|
||||
| .../main/tests/core/src/com/ibm/icu/dev/test/rbbi/break_rules/* | Monkey test rules, copied from ICU4C.
|
||||
| .../main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITestMonkey.java | Monkey test w rules as code. Port from ICU4C.
|
||||
| .../main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/rbbitst.txt | Test data, copied from ICU4C.
|
||||
| .../main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/break_rules/* | Monkey test rules, copied from ICU4C.
|
||||
| .../main/core/src/test/java/com/ibm/icu/dev/test/rbbi/RBBITestMonkey.java | Monkey test w rules as code. Port from ICU4C.
|
||||
|
||||
|
||||
## ICU4C
|
||||
|
@ -90,7 +90,7 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
|
|||
probably means that some earlier change to ICU4C was not fully ported to ICU4J, and this
|
||||
needs to be resolved before proceeding.
|
||||
|
||||
diff icu4c/source/test/testdata/rbbitst.txt icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt
|
||||
diff icu4c/source/test/testdata/rbbitst.txt icu4j/main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/rbbitst.txt
|
||||
|
||||
Should show no difference.
|
||||
|
||||
|
@ -250,7 +250,7 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
|
|||
Copy the file `rbbitst.txt` from ICU4C to ICU4J, and run the Java test. It should fail until the rules are updated.
|
||||
|
||||
cd <top level icu directory>
|
||||
cp icu4c/source/test/testdata/rbbitst.txt icu4j/main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt
|
||||
cp icu4c/source/test/testdata/rbbitst.txt icu4j/main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/rbbitst.txt
|
||||
|
||||
Run the test from Eclipse.
|
||||
|
||||
|
@ -272,7 +272,7 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
|
|||
|
||||
ICU4C file to port from: `source/test/intltest/rbbitst.cpp`
|
||||
|
||||
ICU4J file to port to: `main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBITestMonkey.java`
|
||||
ICU4J file to port to: `main/core/src/test/java/com/ibm/icu/dev/test/rbbi/RBBITestMonkey.java`
|
||||
|
||||
To conveniently run the individual tests, look for the test functions `TestCharMonkey()`, `TestWordMonkey()`, etc. in `RBBITestMonkey.java`.
|
||||
|
||||
|
@ -288,9 +288,9 @@ The rule updates are done first for ICU4C, and then ported (code changes) or mov
|
|||
|
||||
ICU4C directory, to copy from: `source/test/testdata/break_rules/`
|
||||
|
||||
ICU4J directory, to copy to: `main/tests/core/src/com/ibm/icu/dev/test/rbbi/break_rules/`
|
||||
ICU4J directory, to copy to: `main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/break_rules/`
|
||||
|
||||
Then rerun the rule based monkey test, in the file `main/tests/core/src/com/ibm/icu/dev/test/rbbi/RBBIMonkeyTest.java`. Find the test function `TestMonkey()`; it include comments describing how to run it with parameters from Eclipse.
|
||||
Then rerun the rule based monkey test, in the file `main/core/src/test/java/com/ibm/icu/dev/test/rbbi/RBBIMonkeyTest.java`. Find the test function `TestMonkey()`; it include comments describing how to run it with parameters from Eclipse.
|
||||
|
||||
Run the test(s) for the changed rules for an extended amount of time (with Dloop=-1).
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ plural selectors (`plural` and `selectordinal`),
|
|||
and general selector (`select`),
|
||||
very similar to what MessageFormat offers.
|
||||
|
||||
The [ICU test code](https://github.com/unicode-org/icu/tree/main/icu4j/main/tests/core/src/com/ibm/icu/dev/test/message2)
|
||||
The [ICU test code](https://github.com/unicode-org/icu/tree/main/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/message2)
|
||||
covers most features, and has examples of how to make custom placeholder formatters;
|
||||
you can look for classes that implement `com.ibm.icu.message2.FormatterFactory`
|
||||
(they are named `Custom*Test.java`).
|
||||
|
@ -272,7 +272,7 @@ You can experiment with more messages using as inspiration:
|
|||
|
||||
- the [syntax document](https://github.com/unicode-org/message-format-wg/blob/main/spec/syntax.md)
|
||||
- the official [ICU4J javadoc](https://unicode-org.github.io/icu-docs/apidoc/released/icu4j//index.html?com/ibm/icu/message2/)
|
||||
- the [ICU4J unit tests](https://github.com/unicode-org/icu/tree/main/icu4j/main/tests/core/src/com/ibm/icu/dev/test/message2)
|
||||
- the [ICU4J unit tests](https://github.com/unicode-org/icu/tree/main/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/message2)
|
||||
|
||||
You should be able to use your preferred IDE (Eclipse, IntelliJ, Visual Studio Code, more), use a different build system, etc.
|
||||
|
||||
|
|
|
@ -71,12 +71,8 @@ icutzdata.jar in $icu4j_root/main/shared/data.
|
|||
|
||||
*Java*
|
||||
|
||||
3. After the ICU4C-side steps above, build the main target of the
|
||||
ICU4J ant build to unpack the jar files with the following commands:
|
||||
3. After the ICU4C-side steps above, build the ICU4J artifacts and run
|
||||
the tests locally to make sure they pass:
|
||||
|
||||
cd $icu4j_root
|
||||
ant main
|
||||
|
||||
Run the tests locally and make sure they pass:
|
||||
|
||||
ant check
|
||||
mvn verify
|
||||
|
|
|
@ -362,7 +362,7 @@ generate-data: GODATA "$(ICUOUT)\$(ICUPKG).dat" uni-core-data
|
|||
|
||||
## Compare to: source\data\Makefile.in and source\test\testdata\Makefile.in
|
||||
|
||||
DEBUGUTILITIESDATA_DIR=main\tests\core\src\com\ibm\icu\dev\test\util
|
||||
DEBUGUTILITIESDATA_DIR=main\core\src\test\java\com\ibm\icu\dev\test\util
|
||||
DEBUGUTILITIESDATA_SRC=DebugUtilitiesData.java
|
||||
|
||||
# Build DebugUtilitiesData.java
|
||||
|
|
|
@ -1728,7 +1728,7 @@ static void TestGetKeywordValuesForLocale() {
|
|||
|
||||
/*
|
||||
* Weekend tests, ported from
|
||||
* icu4j/trunk/main/tests/core/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java
|
||||
* icu4j/main/core/src/test/java/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java
|
||||
* and extended a bit. Notes below from IBMCalendarTest.java ...
|
||||
* This test tests for specific locale data. This is probably okay
|
||||
* as far as US data is concerned, but if the Arabic/Yemen data
|
||||
|
|
|
@ -38,7 +38,7 @@ static void Verify(ULocaleBuilder* bld, const char* expected, const char* msg) {
|
|||
static void TestLocaleBuilder() {
|
||||
|
||||
// The following test data are copy from
|
||||
// icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/LocaleBuilderTest.java
|
||||
// icu4j/main/core/src/test/java/com/ibm/icu/dev/test/util/LocaleBuilderTest.java
|
||||
// "L": +1 = language
|
||||
// "S": +1 = script
|
||||
// "R": +1 = region
|
||||
|
|
|
@ -83,7 +83,7 @@ void LocaleBuilderTest::Verify(LocaleBuilder& bld, const char* expected, const c
|
|||
|
||||
void LocaleBuilderTest::TestLocaleBuilder() {
|
||||
// The following test data are copy from
|
||||
// icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/LocaleBuilderTest.java
|
||||
// icu4j/main/core/src/test/java/com/ibm/icu/dev/test/util/LocaleBuilderTest.java
|
||||
// "L": +1 = language
|
||||
// "S": +1 = script
|
||||
// "R": +1 = region
|
||||
|
|
|
@ -75,7 +75,7 @@ static const double kNumbersToTest[]{0, 91827.3645, -0.22222};
|
|||
* On Linux, from icu4c/source:
|
||||
* make -j -l2.5 tests && (cd test/intltest && LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./intltest -e -G format/NumberTest/NumberPermutationTest)
|
||||
* After re-generating the file, copy it into icu4j:
|
||||
* cp test/testdata/numberpermutationtest.txt ../../icu4j/main/tests/core/src/com/ibm/icu/dev/data/numberpermutationtest.txt
|
||||
* cp test/testdata/numberpermutationtest.txt ../../icu4j/main/core/src/test/resources/com/ibm/icu/dev/data/numberpermutationtest.txt
|
||||
*/
|
||||
void NumberPermutationTest::testPermutations() {
|
||||
IcuTestErrorCode status(*this, "testPermutations");
|
||||
|
|
2
icu4c/source/test/testdata/Makefile.in
vendored
2
icu4c/source/test/testdata/Makefile.in
vendored
|
@ -167,7 +167,7 @@ $(OUTDIR)/icu4j/testdata.jar: build-dir testdata $(TESTOUTDIR)/testdata.dat
|
|||
$(JAR) cf $(OUTDIR)/icu4j/testdata.jar -C $(OUTDIR)/icu4j com/ibm/icu/dev/data/testdata
|
||||
|
||||
|
||||
DEBUGUTILITIESDATA_DIR=main/tests/core/src/com/ibm/icu/dev/test/util
|
||||
DEBUGUTILITIESDATA_DIR=main/core/src/test/java/com/ibm/icu/dev/test/util
|
||||
DEBUGUTILITIESDATA_SRC=DebugUtilitiesData.java
|
||||
|
||||
ICU4J_DATA=$(OUTDIR)/icu4j/src/$(DEBUGUTILITIESDATA_SRC) $(OUTDIR)/icu4j/testdata.jar
|
||||
|
|
|
@ -12,7 +12,7 @@ The rules in this directory track the boundary rules from Unicode UAX 14 and 29.
|
|||
to provide an expected set of boundary positions to compare with the results from ICU break iteration.
|
||||
|
||||
ICU4J also includes copies of the test reference rules, located in the directory
|
||||
main/tests/core/src/com/ibm/icu/dev/test/rbbi/break_rules/
|
||||
main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/break_rules/
|
||||
The copies should be kept synchronized; there should be no differences.
|
||||
|
||||
Each set of reference break rules lives in a separate file.
|
||||
|
|
2
icu4c/source/test/testdata/rbbitst.txt
vendored
2
icu4c/source/test/testdata/rbbitst.txt
vendored
|
@ -30,7 +30,7 @@
|
|||
#
|
||||
# There are two copies of this file in the source repository,
|
||||
# [ICU4C] source/test/testdata/rbbitst.txt
|
||||
# [ICU4J] main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt
|
||||
# [ICU4J] main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/rbbitst.txt
|
||||
#
|
||||
# ICU4C's copy is the primary one. If any changes are made to ICU4J's copy, make sure they
|
||||
# are merged back into ICU4C's copy of the file, lest they get overwritten later.
|
||||
|
|
84
icu4j/extract-data-files.sh
Executable file
84
icu4j/extract-data-files.sh
Executable file
|
@ -0,0 +1,84 @@
|
|||
#!/usr/bin/env bash
|
||||
# Copyright (C) 2023 and later: Unicode, Inc. and others.
|
||||
# License & terms of use: http://www.unicode.org/copyright.html
|
||||
|
||||
if [ -z "$ICU_DATA_VER" ]; then
|
||||
echo "ICU_DATA_VER must be set to the icu folder name (for example icudt74b)"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Check that all the .jar files are present
|
||||
JAR_FILE=main/shared/data/icudata.jar
|
||||
if [ ! -f "$JAR_FILE" ]; then
|
||||
echo "Missing $JAR_FILE"
|
||||
exit
|
||||
fi
|
||||
JAR_FILE=main/shared/data/icutzdata.jar
|
||||
if [ ! -f "$JAR_FILE" ]; then
|
||||
echo "Missing $JAR_FILE"
|
||||
exit
|
||||
fi
|
||||
JAR_FILE=main/shared/data/testdata.jar
|
||||
if [ ! -f "$JAR_FILE" ]; then
|
||||
echo "Missing $JAR_FILE"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Unpack the pre-built .jar files with data only
|
||||
|
||||
echo "Unpacking icudata.jar"
|
||||
rm -fr main/core/src/main/resources/com/ibm/icu/impl/data/icudt*
|
||||
unzip -q -d main/core/src/main/resources/ main/shared/data/icudata.jar
|
||||
rm -fr main/core/src/main/resources/META-INF
|
||||
|
||||
echo " Moving charset data"
|
||||
rm -fr main/charset/src/main/resources/com/ibm/icu/impl/data/icudt*
|
||||
mkdir -p main/charset/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/
|
||||
mv main/core/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/*.cnv main/charset/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/
|
||||
mv main/core/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/cnvalias.icu main/charset/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/
|
||||
|
||||
echo " Moving currency data"
|
||||
rm -fr main/currdata/src/main/resources/com/ibm/icu/impl/data/icudt*
|
||||
mkdir -p main/currdata/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/
|
||||
mv main/core/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/curr main/currdata/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/curr
|
||||
|
||||
echo " Moving collate data"
|
||||
rm -fr main/collate/src/main/resources/com/ibm/icu/impl/data/icudt*
|
||||
mkdir -p main/collate/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/
|
||||
mv main/core/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/coll main/collate/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/coll
|
||||
|
||||
echo " Moving langdata data"
|
||||
rm -fr main/langdata/src/main/resources/com/ibm/icu/impl/data/icudt*
|
||||
mkdir -p main/langdata/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/
|
||||
mv main/core/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/lang main/langdata/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/lang
|
||||
|
||||
echo " Moving regiondata data"
|
||||
rm -fr main/regiondata/src/main/resources/com/ibm/icu/impl/data/icudt*
|
||||
mkdir -p main/regiondata/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/
|
||||
mv main/core/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/region main/regiondata/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/region
|
||||
|
||||
echo " Moving translit data"
|
||||
rm -fr main/translit/src/main/resources/com/ibm/icu/impl/data/icudt*
|
||||
mkdir -p main/translit/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/
|
||||
mv main/core/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/translit main/translit/src/main/resources/com/ibm/icu/impl/data/${ICU_DATA_VER}/translit
|
||||
|
||||
echo "Unpacking icutzdata.jar"
|
||||
# This unzips together with other existing core files
|
||||
# So we don't remove the folder
|
||||
unzip -q -d main/core/src/main/resources/ main/shared/data/icutzdata.jar
|
||||
rm -fr main/core/src/main/resources/META-INF
|
||||
|
||||
echo "Unpacking testdata.jar"
|
||||
rm -fr main/core/src/test/resources/com/ibm/icu/dev/data/testdata/
|
||||
unzip -q -d main/core/src/test/resources/ main/shared/data/testdata.jar
|
||||
rm -fr main/core/src/test/resources/META-INF
|
||||
|
||||
echo "Removing jar files"
|
||||
echo " icudata.jar"
|
||||
rm main/shared/data/icudata.jar
|
||||
echo " icutzdata.jar"
|
||||
rm main/shared/data/icutzdata.jar
|
||||
echo " testdata.jar"
|
||||
rm main/shared/data/testdata.jar
|
||||
|
||||
echo DONE
|
|
@ -383,7 +383,7 @@ public final class CollationKey implements Comparable<CollationKey>
|
|||
* also match "Smithsonian" and similar.
|
||||
* <p>
|
||||
* For more on usage, see example in test procedure
|
||||
* <a href="https://github.com/unicode-org/icu/blob/main/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationAPITest.java">
|
||||
* <a href="https://github.com/unicode-org/icu/blob/main/icu4j/main/collate/src/test/java/com/ibm/icu/dev/test/collator/CollationAPITest.java">
|
||||
* src/com/ibm/icu/dev/test/collator/CollationAPITest/TestBounds.
|
||||
* </a>
|
||||
* <p>
|
||||
|
|
|
@ -86,7 +86,7 @@ import com.ibm.icu.util.VersionInfo;
|
|||
* <p>
|
||||
* Further detail on differences can be determined using the program
|
||||
* <a href=
|
||||
* "https://github.com/unicode-org/icu/blob/main/icu4j/main/tests/core/src/com/ibm/icu/dev/test/lang/UCharacterCompare.java">
|
||||
* "https://github.com/unicode-org/icu/blob/main/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/lang/UCharacterCompare.java">
|
||||
* com.ibm.icu.dev.test.lang.UCharacterCompare</a>
|
||||
* <p>
|
||||
* In addition to Java compatibility functions, which calculate derived properties,
|
||||
|
|
|
@ -127,7 +127,7 @@ import java.util.Map;
|
|||
* and general selector ({@code select}),
|
||||
* very similar to what MessageFormat offers.</p>
|
||||
*
|
||||
* <p>The <a target="github" href="https://github.com/unicode-org/icu/tree/main/icu4j/main/tests/core/src/com/ibm/icu/dev/test/message2">ICU test code</a>
|
||||
* <p>The <a target="github" href="https://github.com/unicode-org/icu/tree/main/icu4j/main/core/src/test/java/com/ibm/icu/dev/test/message2">ICU test code</a>
|
||||
* covers most features, and has examples of how to make custom placeholder formatters;
|
||||
* you can look for classes that implement {@code com.ibm.icu.message2.FormatterFactory}
|
||||
* (they are named {@code Custom*Test.java}).</p>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
file: main/tests/core/src/com/ibm/icu/dev/test/rbbi/break_rules/readme.txt
|
||||
file: main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/break_rules/readme.txt
|
||||
Copyright (C) 2016 and later: Unicode, Inc. and others.
|
||||
License & terms of use: http://www.unicode.org/copyright.html
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#
|
||||
# There are two copies of this file in the source repository,
|
||||
# [ICU4C] source/test/testdata/rbbitst.txt
|
||||
# [ICU4J] main/tests/core/src/com/ibm/icu/dev/test/rbbi/rbbitst.txt
|
||||
# [ICU4J] main/core/src/test/resources/com/ibm/icu/dev/test/rbbi/rbbitst.txt
|
||||
#
|
||||
# ICU4C's copy is the primary one. If any changes are made to ICU4J's copy, make sure they
|
||||
# are merged back into ICU4C's copy of the file, lest they get overwritten later.
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<fail unless="cldrDir"
|
||||
message="Set the CLDR_DIR environment variable (or cldrDir property) to the top level CLDR source directory (containing 'common')."/>
|
||||
<property name="testDataDir4C" value="${basedir}/../../icu4c/source/test/testdata/cldr"/>
|
||||
<property name="testDataDir4J" value="${basedir}/../../icu4j/main/tests/core/src/com/ibm/icu/dev/data/cldr"/>
|
||||
<property name="testDataDir4J" value="${basedir}/../../icu4j/main/core/src/test/resources/com/ibm/icu/dev/data/cldr"/>
|
||||
</target>
|
||||
|
||||
<!-- Copies CLDR test data directories, after deleting previous
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
<!-- The output directory into which to write generated Java code. By default
|
||||
this will overwrite (without deletion) the generated Java files in this
|
||||
ICU release, so it is recommended that for testing, it be set to another value. -->
|
||||
<property name="genJavaCodeDir" value="${basedir}/../../../icu4j/main/classes/core"/>
|
||||
<property name="genJavaCodeDir" value="${basedir}/../../../icu4j/main/core"/>
|
||||
|
||||
<!-- Set this to true to prevent build-icu-data.xml from generating the generated
|
||||
ICU source files -->
|
||||
|
|
|
@ -37,7 +37,7 @@ public final class GenerateCodeTask extends Task {
|
|||
}
|
||||
|
||||
private GeneratedFileDef[] generatedFileDefs = {
|
||||
new GeneratedFileDef("common/localefallback_data.h", "src/com/ibm/icu/impl/LocaleFallbackData.java", new ResourceFallbackCodeGenerator()),
|
||||
new GeneratedFileDef("common/localefallback_data.h", "src/main/java/com/ibm/icu/impl/LocaleFallbackData.java", new ResourceFallbackCodeGenerator()),
|
||||
};
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
|
Loading…
Add table
Reference in a new issue