Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cpyskip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ icu4j/perf-tests/data/collation/ulyss10.txt
icu4j/perf-tests/data/collation/2drvb10.txt
icu4j/perf-tests/data/collation/vfear11a.txt
icu4j/perf-tests/data/collation/nvsbl10.txt
icu4j/tools/build/src/main/resources/com/ibm/icu/dev/tool/errorprone/sorttable.js
icu4j/tools/errorprone_report/src/main/resources/com/ibm/icu/dev/tool/errorprone/sorttable.js
#
# docs
#
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/icu4j.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ jobs:
grep '^\[ERROR\] ' /tmp/errorprone.log
# We need to build this sub-project. If maven fails in a previous sub-project the
# whole build stops and we never get to build the report tool, so we can't run it.
mvn install -f icu4j/tools/build/ -q
mvn exec:java -f icu4j/tools/build/ -P errorprone_report -DlogFile=/tmp/errorprone.log
mvn install -f icu4j/tools/errorprone_report/ -q
mvn exec:java -f icu4j/tools/errorprone_report/ -DlogFile=/tmp/errorprone.log
# Output messages and the error-prone report as workflow job summary
echo '**Run this command locally and fix all errors:**' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
import com.ibm.icu.impl.UnicodeMap;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/** Moved from UnicodeMapTest */
@RunWith(JUnit4.class)
public class UnicodeMapBoilerplateTest extends TestBoilerplate<UnicodeMap<String>> {

private static String[] TEST_VALUES = {"A", "B", "C", "D", "E", "F"};

public void TestUnicodeMapBoilerplate() throws Exception {}

@Test
public void test() throws Exception {
_test();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
import com.ibm.icu.text.UnicodeSet;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

/** Moved from UnicodeMapTest */
@RunWith(JUnit4.class)
public class UnicodeSetBoilerplateTest extends TestBoilerplate<UnicodeSet> {

public void TestUnicodeSetBoilerplate() throws Exception {}

@Test
public void test() throws Exception {
_test();
Expand Down
17 changes: 0 additions & 17 deletions icu4j/tools/build/manifest-utilities.stub

This file was deleted.

57 changes: 0 additions & 57 deletions icu4j/tools/build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,68 +13,11 @@

<artifactId>tools_build</artifactId>

<properties>
<!-- Arguments for the errorprone report generation -->
<logFile>/tmp/errorprone.log</logFile>
<outDir>${project.build.directory}/errorprone_report</outDir>
<srcBaseUrl>https://github.com/unicode-org/icu/blob/main/</srcBaseUrl>
</properties>

<dependencies>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
</dependency>
</dependencies>

<profiles>
<profile>
<!--
From icu4j:
mvn clean test -ntp -DskipTests -DskipITs -l /tmp/errorprone.log -P errorprone
mvn exec:java -f tools/build/ -P errorprone_report -DlogFile=/tmp/errorprone.log

The links to the source files go to the main GitHub repo (`main` branch).
But when we work locally, or in a fork / branch, the links might point to an incorrect file / line.
You can override the URL by passing -DsrcBaseUrl in the maven command line.
For local files it would be easy to do:
mvn exec:java -f tools/build/ -P errorprone_report -DsrcBaseUrl=$PWD/..
Note: jumping to a certain line does not work on local files.
This is a limitation in how browsers work.
So opening the file in an IDE is probably more practical.
-->
<id>errorprone_report</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.ibm.icu.dev.tool.errorprone.Main</mainClass>
<arguments>
<argument>--logFile</argument>
<argument>${logFile}</argument>
<argument>--srcBaseUrl</argument>
<argument>${srcBaseUrl}</argument>
<argument>--outDir</argument>
<argument>${outDir}</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
80 changes: 80 additions & 0 deletions icu4j/tools/errorprone_report/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?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-tools</artifactId>
<version>79.0.1-SNAPSHOT</version>
</parent>

<artifactId>errorprone_report</artifactId>

<properties>
<!-- Arguments for the errorprone report generation -->
<logFile>/tmp/errorprone.log</logFile>
<outDir>${project.build.directory}/errorprone_report</outDir>
<srcBaseUrl>https://github.com/unicode-org/icu/blob/main/</srcBaseUrl>
</properties>

<dependencies>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
</dependency>
</dependencies>

<profiles>
<profile>
<!--
From icu4j:
mvn clean test -ntp -DskipTests -DskipITs -l /tmp/errorprone.log -P errorprone
mvn exec:java -f tools/errorprone_report/ -DlogFile=/tmp/errorprone.log

The links to the source files go to the main GitHub repo (`main` branch).
But when we work locally, or in a fork / branch, the links might point to an incorrect file / line.
You can override the URL by passing -DsrcBaseUrl in the maven command line.
For local files it would be easy to do:
mvn exec:java -f tools/errorprone_report/ -DsrcBaseUrl=$PWD/..
Note: jumping to a certain line does not work on local files.
This is a limitation in how browsers work.
So opening the file in an IDE is probably more practical.
-->
<id>errorprone_report</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.ibm.icu.dev.tool.errorprone.Main</mainClass>
<arguments>
<argument>--logFile</argument>
<argument>${logFile}</argument>
<argument>--srcBaseUrl</argument>
<argument>${srcBaseUrl}</argument>
<argument>--outDir</argument>
<argument>${outDir}</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
13 changes: 13 additions & 0 deletions icu4j/tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,17 @@
<module>pmd</module>
</modules>

<profiles>
<profile>
<id>requires_jdk21</id>
<activation>
<!-- Using ${enforcer.requireJavaToolsVersion} does not work. Bug? -->
<jdk>[21,)</jdk>
</activation>
<modules>
<module>errorprone_report</module>
</modules>
</profile>
</profiles>

</project>
30 changes: 22 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,17 @@
- versions:set-property https://www.mojohaus.org/versions/versions-maven-plugin/set-property-mojo.html
-->

<!-- From the Maven web site, Dec. 2025 (https://maven.apache.org/docs/history.html)
"Maven 3.8.9 and before has now reached its end of life and is no longer supported in any way.
New plugin releases will require Maven 3.9.0 or later."
-->
<enforcer.requireMavenVersion>3.9.0</enforcer.requireMavenVersion>
<enforcer.requireJavaVersion>[11,)</enforcer.requireJavaVersion>
<enforcer.requireJavaToolsVersion>[21,)</enforcer.requireJavaToolsVersion>

<!-- Dependencies versions -->
<commons-cli.version>1.11.0</commons-cli.version>
<error_prone.version>2.25.0</error_prone.version>
<error_prone.version>2.49.0</error_prone.version>
<gson.version>2.13.2</gson.version>
<guava.version>33.5.0-jre</guava.version>
<jmh.version>1.37</jmh.version>
Expand Down Expand Up @@ -438,14 +446,10 @@
<configuration>
<rules>
<requireMavenVersion>
<!-- From the Maven web site, Dec. 2025 (https://maven.apache.org/docs/history.html)
"Maven 3.8.9 and before has now reached its end of life and is no longer supported in any way.
New plugin releases will require Maven 3.9.0 or later."
-->
<version>3.9.0</version>
<version>${enforcer.requireMavenVersion}</version>
</requireMavenVersion>
<requireJavaVersion>
<version>[11,)</version>
<version>${enforcer.requireJavaVersion}</version>
</requireJavaVersion>
</rules>
</configuration>
Expand Down Expand Up @@ -656,6 +660,9 @@
mvn clean test -DskipTests -DskipITs -P errorprone
-->
<id>errorprone</id>
<properties>
<enforcer.requireJavaVersion>${enforcer.requireJavaToolsVersion}</enforcer.requireJavaVersion>
</properties>
<build>
<plugins>
<plugin>
Expand All @@ -668,11 +675,13 @@
<!-- Use <compilerArg> to pass flags to errorprone. See https://errorprone.info/docs/flags -->
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
<arg>-XDaddTypeAnnotationsToSymbol=true</arg>
<arg>--should-stop=ifError=FLOW</arg>
<!--
WARNING: Do not wrap the line below, it will fail on Windows.
See https://github.com/google/error-prone/issues/4256
-->
<arg>-Xplugin:ErrorProne -Xep:UnicodeEscape:OFF -Xep:InvalidBlockTag:OFF</arg>
<arg>-Xplugin:ErrorProne -Xep:UnicodeEscape:OFF -Xep:InvalidBlockTag:OFF -Xep:LabelledBreakTarget:WARN</arg>
<arg>-Xmaxerrs</arg>
<arg>10000</arg>
<arg>-Xmaxwarns</arg>
Expand Down Expand Up @@ -710,6 +719,9 @@
You can then inspect the content of the errorprone.log file, or the reports in
the target folder (errorprone*.html, errorprone.md, errorprone.tsv) -->
<id>errorprone-all</id>
<properties>
<enforcer.requireJavaVersion>${enforcer.requireJavaToolsVersion}</enforcer.requireJavaVersion>
</properties>
<build>
<plugins>
<plugin>
Expand All @@ -723,6 +735,8 @@
<!-- Use <compilerArg> to pass flags to errorprone. See https://errorprone.info/docs/flags -->
<compilerArgs>
<arg>-XDcompilePolicy=simple</arg>
<arg>-XDaddTypeAnnotationsToSymbol=true</arg>
<arg>--should-stop=ifError=FLOW</arg>
<!--
-XepAllErrorsAsWarnings:
If we let errors be errors they fail and stop the build, so we don't get a full report.
Expand Down
Loading