From 7a0373411ea44e682565f91c6dfd1aa00135b6c0 Mon Sep 17 00:00:00 2001 From: Mihai Nita Date: Tue, 26 Sep 2023 15:49:25 -0700 Subject: [PATCH] ICU-22324 Mavenization, building the CLDR utilities --- .github/workflows/maven.yaml | 36 ++++----- .../com/ibm/icu/dev/test/perf/PerfTest.java | 2 +- icu4j/pom.xml | 6 ++ .../localeconverter/XLIFF2ICUConverter.java | 2 +- .../icu/dev/tool/{ => shared}/UOption.java | 2 +- icu4j/tools/utilities-for-cldr/pom.xml | 76 +++++++++++++++++++ 6 files changed, 100 insertions(+), 24 deletions(-) rename icu4j/tools/misc/src/main/java/com/ibm/icu/dev/tool/{ => shared}/UOption.java (99%) create mode 100644 icu4j/tools/utilities-for-cldr/pom.xml diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 716f3f0fe8b4..1a26f31bfd55 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -7,7 +7,7 @@ on: # https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow env: - MAVEN_ARGS: '--show-version --no-transfer-progress' + SHARED_MVN_ARGS: '--show-version --no-transfer-progress' permissions: contents: read @@ -25,28 +25,22 @@ jobs: with: distribution: 'temurin' java-version: '11' - - name: icu4j ant releaseCLDR - run: ant -noinput releaseCLDR -f icu4j/build.xml + - name: icu4j and releaseCLDR + run: | + cd icu4j + mvn ${SHARED_MVN_ARGS} clean install -DskipTests -DskipIT -P with_sources - name: deploy it run: | - MYVERSION=$(sed -n -e 's%^\s*maven.pom.ver[ =]*%%p' < icu4j/build.properties)-$(echo ${GITHUB_REF} | cut -d/ -f3- | tr ./ _-) - echo Github Ref ${GITHUB_REF} @ ${GITHUB_SHA}, version ${MYVERSION} - mvn deploy:deploy-file -DgroupId=com.ibm.icu \ - -DartifactId=icu4j-for-cldr \ - -Dversion=${MYVERSION} \ - -Dpackaging=jar \ - -Dfile=icu4j/release_cldr/icu4j.jar \ - -Dsources=icu4j/release_cldr/icu4j-src.jar \ - -DrepositoryId=github \ - -Durl=https://maven.pkg.github.com/${GITHUB_REPOSITORY} - mvn deploy:deploy-file -DgroupId=com.ibm.icu \ - -DartifactId=utilities-for-cldr \ - -Dversion=${MYVERSION} \ - -Dpackaging=jar \ - -Dfile=icu4j/release_cldr/utilities.jar \ - -Dsources=icu4j/release_cldr/utilities-src.jar \ - -DrepositoryId=github \ - -Durl=https://maven.pkg.github.com/${GITHUB_REPOSITORY} + echo Github Ref ${GITHUB_REF} @ ${GITHUB_SHA}; + cd icu4j + mvn deploy ${SHARED_MVN_ARGS} \ + -pl main/icu4j \ + -DaltDeploymentRepository=github::https://maven.pkg.github.com/${GITHUB_REPOSITORY} \ + -P with_sources + mvn deploy ${SHARED_MVN_ARGS} \ + -pl tools/utilities-for-cldr \ + -DaltDeploymentRepository=github::https://maven.pkg.github.com/${GITHUB_REPOSITORY} \ + -P cldr_tools,with_sources env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Note: can use 0.0.0-${GITHUB_SHA} as the version for hash-based. diff --git a/icu4j/perf-tests/src/main/java/com/ibm/icu/dev/test/perf/PerfTest.java b/icu4j/perf-tests/src/main/java/com/ibm/icu/dev/test/perf/PerfTest.java index 3bff196e9a63..9e9cef99e4f7 100644 --- a/icu4j/perf-tests/src/main/java/com/ibm/icu/dev/test/perf/PerfTest.java +++ b/icu4j/perf-tests/src/main/java/com/ibm/icu/dev/test/perf/PerfTest.java @@ -25,7 +25,7 @@ import java.util.Map; import java.util.Set; -import com.ibm.icu.dev.tool.UOption; +import com.ibm.icu.dev.tool.shared.UOption; import com.ibm.icu.impl.LocaleUtility; /** diff --git a/icu4j/pom.xml b/icu4j/pom.xml index b37c92385aea..6d3c0169b4f8 100644 --- a/icu4j/pom.xml +++ b/icu4j/pom.xml @@ -27,6 +27,7 @@ demos samples tools/misc + tools/utilities-for-cldr perf-tests @@ -258,6 +259,11 @@ maven-dependency-plugin 3.6.0 + + org.codehaus.mojo + build-helper-maven-plugin + 3.4.0 + maven-release-plugin 3.0.1 diff --git a/icu4j/tools/misc/src/main/java/com/ibm/icu/dev/tool/localeconverter/XLIFF2ICUConverter.java b/icu4j/tools/misc/src/main/java/com/ibm/icu/dev/tool/localeconverter/XLIFF2ICUConverter.java index 8a5ef0c443d0..093069aeea57 100644 --- a/icu4j/tools/misc/src/main/java/com/ibm/icu/dev/tool/localeconverter/XLIFF2ICUConverter.java +++ b/icu4j/tools/misc/src/main/java/com/ibm/icu/dev/tool/localeconverter/XLIFF2ICUConverter.java @@ -32,7 +32,7 @@ import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; -import com.ibm.icu.dev.tool.UOption; +import com.ibm.icu.dev.tool.shared.UOption; public final class XLIFF2ICUConverter { diff --git a/icu4j/tools/misc/src/main/java/com/ibm/icu/dev/tool/UOption.java b/icu4j/tools/misc/src/main/java/com/ibm/icu/dev/tool/shared/UOption.java similarity index 99% rename from icu4j/tools/misc/src/main/java/com/ibm/icu/dev/tool/UOption.java rename to icu4j/tools/misc/src/main/java/com/ibm/icu/dev/tool/shared/UOption.java index 8844ab3d4f54..df10d0bd2863 100644 --- a/icu4j/tools/misc/src/main/java/com/ibm/icu/dev/tool/UOption.java +++ b/icu4j/tools/misc/src/main/java/com/ibm/icu/dev/tool/shared/UOption.java @@ -10,7 +10,7 @@ * Since: ICU 2.4 ********************************************************************** */ -package com.ibm.icu.dev.tool; +package com.ibm.icu.dev.tool.shared; /** * A command-line option. A UOption specifies the name of an option diff --git a/icu4j/tools/utilities-for-cldr/pom.xml b/icu4j/tools/utilities-for-cldr/pom.xml new file mode 100644 index 000000000000..b0eaa4906a80 --- /dev/null +++ b/icu4j/tools/utilities-for-cldr/pom.xml @@ -0,0 +1,76 @@ + + + + 4.0.0 + + com.ibm.icu + icu4j-root + 74.1-SNAPSHOT + ../../pom.xml + + + utilities-for-cldr + jar + + + Utilities + com.ibm.icu.utilities + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-source + generate-sources + + add-source + + + + ../misc/src/main/java/com/ibm/icu/dev/tool/shared + ../../main/framework/src/test/java/com/ibm/icu/dev/util + ../../main/translit/src/test/java/com/ibm/icu/dev/util + + + + + + + + + + + com.ibm.icu + translit + ${project.version} + + + + + + cldr_tools + + + + + maven-deploy-plugin + + false + + + + + + + +