Skip to content

Commit

Permalink
ICU-21757 Stop sharing utilities-for-cldr
Browse files Browse the repository at this point in the history
Moves UnicodeMap and related classes to core.
Also removes `CollectionUtilities`, `UOption`, and `ElapsedTimer`.
They will end up in UnicodeTools, CLDR, and CLDR respectively.
  • Loading branch information
mihnita committed May 6, 2024
1 parent c92c188 commit 9369b7a
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 1,324 deletions.
25 changes: 5 additions & 20 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
version="`mvn help:evaluate -Dexpression=project.version -q -DforceStdout`"
echo "version=$version" # debug/info logging for our own purposes, before sending to Github
echo "version=$version" >> "$GITHUB_OUTPUT"
# Set version-type=snapshot for tags that contain SNAPSHOT,
# as well as for unicode-org-internal artifacts with a dash like `icu4j-for-cldr`.
# Set version-type=snapshot for tags that contain SNAPSHOT,
# as well as for unicode-org-internal artifacts with a dash like `icu4j-for-cldr`.
- name: Assess Maven version release/snapshot
id: mvn-proj-version-type
run: |
Expand All @@ -49,33 +49,18 @@ jobs:
run: |
echo "Manual deployments of publishing artifacts should only be attempted for snapshot versions"
exit 1;
- name: Build artifacts (icu4j, utilities-for-cldr)
- name: Build artifacts (icu4j)
run: |
cd icu4j
mvn ${SHARED_MVN_ARGS} clean install -DskipTests -DskipIT -P with_sources
# For snapshot versions, publish icu4j & utilities-for-cldr
# For snapshot versions, publish icu4j
- name: Deploy to Github (snapshot version)
if: steps.mvn-proj-version-type.outputs.version-type == 'snapshot'
run: |
echo Github Ref ${GITHUB_REF} @ ${GITHUB_SHA};
cd icu4j
mvn deploy ${SHARED_MVN_ARGS} \
-pl :icu4j,:utilities-for-cldr,:icu4j-root \
-DaltDeploymentRepository=github::https://maven.pkg.github.com/${GITHUB_REPOSITORY} \
-P cldr_utilities,with_sources
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# For release versions, publish utilities-for-cldr,
# but do not publish icu4j because the Maven artifact "coordinates"
# will conflict with the public-facing coordinates on Maven Central
# ("coordinates" = groupId, artifactId, version)
- name: Deploy to Github (release version)
if: steps.mvn-proj-version-type.outputs.version-type == 'release'
run: |
echo Github Ref ${GITHUB_REF} @ ${GITHUB_SHA};
cd icu4j
mvn deploy ${SHARED_MVN_ARGS} \
-pl :utilities-for-cldr,:icu4j-root \
-pl :icu4j,:icu4j-root \
-DaltDeploymentRepository=github::https://maven.pkg.github.com/${GITHUB_REPOSITORY} \
-P cldr_utilities,with_sources
env:
Expand Down
4 changes: 0 additions & 4 deletions docs/devsetup/java/maven.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ To import into IntelliJ:
Navigating the source code files between main code and test code, and running tests individually or for an entire module,
work as they do normally in IntelliJ.

> :point_right: **Note**: Currently, Maven cannot build the entire project due to settings for `tools/utilities-for-cldr`. To work around this so that `Build > Build Project` works: in the "Project" toolbar, navigate to the `tools/utilities-for-cldr` folder, right click for the contextual menu, then `Maven > Ignore Projects`.
>
> When this workaround is no longer needed, the project can be reenabled by: `View > Tool Windows > Maven`, then expand "International Components for Unicode (ICU)", right click on `utilities-for-cldr`, then select `Unignore Projects`.
### Eclipse

[Eclipse's Maven plugin](https://eclipse.dev/m2e/)
Expand Down
6 changes: 2 additions & 4 deletions docs/userguide/icu4j/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,10 @@ Once the JDK and Maven are installed, run the desired Maven target. For example:
[INFO] demos [jar]
[INFO] samples [jar]
[INFO] tools_misc [jar]
[INFO] utilities-for-cldr [jar]
[INFO] perf-tests [jar]
[INFO]
[INFO] -----------------------< com.ibm.icu:icu4j-root >-----------------------
[INFO] Building International Components for Unicode for Java (icu4j-root) 74.1-SNAPSHOT [1/17]
[INFO] Building International Components for Unicode for Java (icu4j-root) 74.1-SNAPSHOT [1/16]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:3.3.0:enforce (enforce-maven) @ icu4j-root ---
Expand Down Expand Up @@ -320,12 +319,11 @@ Once the JDK and Maven are installed, run the desired Maven target. For example:
[INFO] demos .............................................. SUCCESS [ 0.111 s]
[INFO] samples ............................................ SUCCESS [ 0.076 s]
[INFO] tools_misc ......................................... SUCCESS [ 0.079 s]
[INFO] utilities-for-cldr ................................. SUCCESS [ 1.284 s]
[INFO] perf-tests ......................................... SUCCESS [ 0.128 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:16 min
[INFO] Total time: 04:15 min
[INFO] Finished at: 2023-10-03T16:16:06-07:00
[INFO] ------------------------------------------------------------------------
~~~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* others. All Rights Reserved. *
*******************************************************************************
*/
package com.ibm.icu.dev.util;
package com.ibm.icu.impl;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* others. All Rights Reserved. *
*******************************************************************************
*/
package com.ibm.icu.dev.util;
package com.ibm.icu.impl;

import java.util.Collection;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* others. All Rights Reserved. *
*******************************************************************************
*/
package com.ibm.icu.dev.util;
package com.ibm.icu.impl;

import java.util.Iterator;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
* others. All Rights Reserved. *
*******************************************************************************
*/
package com.ibm.icu.dev.test.translit;
package com.ibm.icu.dev.test;

import java.util.List;

import org.junit.Test;

import com.ibm.icu.dev.test.TestBoilerplate;
import com.ibm.icu.dev.util.UnicodeMap;
import com.ibm.icu.impl.UnicodeMap;

/**
* Moved from UnicodeMapTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* others. All Rights Reserved.
*******************************************************************************
*/
package com.ibm.icu.dev.test.translit;
package com.ibm.icu.dev.test;

import java.util.Comparator;
import java.util.HashMap;
Expand All @@ -26,11 +26,8 @@
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import com.ibm.icu.dev.test.TestBoilerplate;
import com.ibm.icu.dev.test.TestFmwk;
import com.ibm.icu.dev.util.UnicodeMap;
import com.ibm.icu.dev.util.UnicodeMap.EntryRange;
import com.ibm.icu.dev.util.UnicodeMapIterator;
import com.ibm.icu.impl.UnicodeMap;
import com.ibm.icu.impl.UnicodeMapIterator;
import com.ibm.icu.impl.Utility;
import com.ibm.icu.lang.UCharacter;
import com.ibm.icu.lang.UProperty;
Expand Down Expand Up @@ -59,15 +56,15 @@ public void TestIterations() {
checkToString(foo, "0003=6.0\n0005=10.0\n10FFFF=666.0\n006E,0065,0067=-555.0\n");

double i = 0;
for (EntryRange<Double> entryRange : foo.entryRanges()) {
for (UnicodeMap.EntryRange<Double> entryRange : foo.entryRanges()) {
i += entryRange.value;
}
assertEquals("EntryRange<T>", 127d, i);
}

public void checkToString(UnicodeMap<Double> foo, String expected) {
StringJoiner joiner = new StringJoiner("\n");
for (EntryRange range : foo.entryRanges()) {
for (UnicodeMap.EntryRange range : foo.entryRanges()) {
joiner.add(range.toString());
}
assertEquals("EntryRange<T>", expected, joiner.toString() + (foo.size() == 0 ? "" : "\n"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* others. All Rights Reserved. *
*******************************************************************************
*/
package com.ibm.icu.dev.test.translit;
package com.ibm.icu.dev.test;

import java.util.List;

Expand Down

0 comments on commit 9369b7a

Please sign in to comment.