ICU-22324 Mavenization, building the CLDR utilities

This commit is contained in:
Mihai Nita 2023-09-26 15:49:25 -07:00 committed by Mihai Nita
parent c670bbd5b0
commit 7a0373411e
6 changed files with 100 additions and 24 deletions

View file

@ -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.

View file

@ -25,7 +25,7 @@ import java.util.Locale;
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;
/**

View file

@ -27,6 +27,7 @@
<module>demos</module>
<module>samples</module>
<module>tools/misc</module>
<module>tools/utilities-for-cldr</module>
<module>perf-tests</module>
</modules>
@ -258,6 +259,11 @@
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.0</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.4.0</version>
</plugin>
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.1</version>

View file

@ -32,7 +32,7 @@ import org.xml.sax.InputSource;
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 {

View file

@ -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

View file

@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
* © 2023 and later: Unicode, Inc. and others.
* License & terms of use: http://www.unicode.org/copyright.html
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j-root</artifactId>
<version>74.1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>utilities-for-cldr</artifactId>
<packaging>jar</packaging>
<properties>
<proj.displayname>Utilities</proj.displayname>
<mf.Automatic-Module-Name>com.ibm.icu.utilities</mf.Automatic-Module-Name>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>../misc/src/main/java/com/ibm/icu/dev/tool/shared</source>
<source>../../main/framework/src/test/java/com/ibm/icu/dev/util</source>
<source>../../main/translit/src/test/java/com/ibm/icu/dev/util</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>translit</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>cldr_tools</id>
<build>
<plugins>
<plugin>
<!-- Only deploy when the `cldr_tools` profile is active,
otherwise it will also be deployed to Maven Central.
We can also try to specify `altDeploymentRepository` here.
-->
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>