Skip to content

Commit aed4fba

Browse files
committed
Merge remote-tracking branch 'la-vache/main' into jh-tolong-siki
2 parents 4399c42 + 69a376c commit aed4fba

File tree

554 files changed

+4029226
-297471
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

554 files changed

+4029226
-297471
lines changed

.github/workflows/build-jsp.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: Build JSP
22

33
env:
4-
CURRENT_UVERSION: 16.0.0
5-
PREVIOUS_UVERSION: 15.1.0 # not used at present
4+
CURRENT_UVERSION: 17.0.0 # FIX_FOR_NEW_VERSION
5+
PREVIOUS_UVERSION: 16.0.0 # not used at present
66

77
on:
88
push:
@@ -69,7 +69,7 @@ jobs:
6969
env:
7070
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7171
- name: Upload UnicodeJsps.war
72-
uses: actions/upload-artifact@v2
72+
uses: actions/upload-artifact@v3
7373
with:
7474
name: UnicodeJsps
7575
path: UnicodeJsps/target/UnicodeJsps.war

.github/workflows/cli-build-instructions.yml

Lines changed: 103 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
- '*'
1010

1111
env:
12-
CURRENT_UVERSION: 16.0.0
13-
PREVIOUS_UVERSION: 15.1.0
12+
CURRENT_UVERSION: 17.0.0 # FIX_FOR_NEW_VERSION
13+
PREVIOUS_UVERSION: 16.0.0
1414

1515
jobs:
1616

@@ -88,7 +88,7 @@ jobs:
8888
# change anything, which makes little sense; but that is the job of the
8989
# other job.
9090
- name: Run invariant tests
91-
run: MAVEN_OPTS="-ea" mvn -s .github/workflows/mvn-settings.xml test -am -pl unicodetools -Dtest=TestTestUnicodeInvariants -DfailIfNoTests=false -DCLDR_DIR=$(cd ../cldr ; pwd) -DUNICODETOOLS_GEN_DIR=$(cd Generated; pwd) -DUNICODETOOLS_REPO_DIR=$(pwd) -DUVERSION=$CURRENT_UVERSION
91+
run: MAVEN_OPTS="-ea" mvn -s .github/workflows/mvn-settings.xml test -am -pl unicodetools -Dtest=TestTestUnicodeInvariants#testUnicodeInvariants -DfailIfNoTests=false -DCLDR_DIR=$(cd ../cldr ; pwd) -DUNICODETOOLS_GEN_DIR=$(cd Generated; pwd) -DUNICODETOOLS_REPO_DIR=$(pwd) -DUVERSION=$CURRENT_UVERSION
9292
env:
9393
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9494

@@ -170,7 +170,7 @@ jobs:
170170
- name: Run command - Build and Test
171171
run: |
172172
cd unicodetools/mine/src
173-
MAVEN_OPTS="-ea" mvn -s .github/workflows/mvn-settings.xml package -DCLDR_DIR=$(cd ../../../cldr/mine/src ; pwd) -DUNICODETOOLS_GEN_DIR=$(cd ../Generated ; pwd) -DUNICODETOOLS_REPO_DIR=$(pwd) -DUVERSION=$CURRENT_UVERSION -DEMIT_GITHUB_ERRORS
173+
MAVEN_OPTS="-ea" mvn -s .github/workflows/mvn-settings.xml package -Dtest=!TestTestUnicodeInvariants#testSecurityInvariants -DCLDR_DIR=$(cd ../../../cldr/mine/src ; pwd) -DUNICODETOOLS_GEN_DIR=$(cd ../Generated ; pwd) -DUNICODETOOLS_REPO_DIR=$(pwd) -DUVERSION=$CURRENT_UVERSION -DEMIT_GITHUB_ERRORS
174174
env:
175175
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
176176

@@ -275,6 +275,22 @@ jobs:
275275
with:
276276
repository: unicode-org/unicodetools
277277
path: unicodetools/mine/src
278+
- name: Checkout base UnicodeData.txt
279+
if: ${{ github.event_name == 'pull_request'}}
280+
uses: actions/checkout@v3
281+
with:
282+
ref: ${{ github.event.pull_request.base.sha }}
283+
path: base
284+
sparse-checkout: unicodetools/data/ucd/dev/UnicodeData.txt
285+
- name: Compare repertoire
286+
if: ${{ github.event_name == 'pull_request'}}
287+
run: |
288+
# Look for changes affecting the first two fields of UnicodeData.txt (code point and name).
289+
sed 's/^\([^;]*;[^;]*\);.*$/\1/' unicodetools/mine/src/unicodetools/data/ucd/dev/UnicodeData.txt > merged-repertoire.txt
290+
sed 's/^\([^;]*;[^;]*\);.*$/\1/' base/unicodetools/data/ucd/dev/UnicodeData.txt > base-repertoire.txt
291+
set +e
292+
diff base-repertoire.txt merged-repertoire.txt
293+
echo "REPERTOIRE_CHANGED=$?" >> "$GITHUB_ENV"
278294
- name: Get the CLDR_REF from pom.xml
279295
id: cldr_ref
280296
run: echo "CLDR_REF="$(mvn --file unicodetools/mine/src/pom.xml help:evaluate -Dexpression=cldr.version -q -DforceStdout | cut -d- -f3) >> $GITHUB_OUTPUT && cat ${GITHUB_OUTPUT}
@@ -316,9 +332,92 @@ jobs:
316332
- name: Run command - UCA - collation validity log
317333
run: |
318334
cd unicodetools/mine/src
335+
echo "REPERTOIRE_CHANGED=$REPERTOIRE_CHANGED"
336+
if [[ ${REPERTOIRE_CHANGED:-0} -ne 0 ]]
337+
then set +e
338+
fi
319339
# invoke main() in class ...UCA.Main
320340
mvn -s .github/workflows/mvn-settings.xml compile exec:java -Dexec.mainClass="org.unicode.text.UCA.Main" -Dexec.args="writeCollationValidityLog ICU" -am -pl unicodetools -DCLDR_DIR=$(cd ../../../cldr/mine/src ; pwd) -DUNICODETOOLS_GEN_DIR=$(cd ../Generated ; pwd) -DUNICODETOOLS_REPO_DIR=$(pwd) -DUVERSION=$CURRENT_UVERSION
321341
# check for output file
322342
compgen -G "../Generated/UCA/*/CheckCollationValidity.html"
323343
env:
324344
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
345+
346+
# Out-of-source build.
347+
security:
348+
name: Check security data invariants
349+
runs-on: ubuntu-latest
350+
steps:
351+
- name: Checkout Unicode Tools
352+
uses: actions/checkout@v3
353+
with:
354+
repository: unicode-org/unicodetools
355+
path: unicodetools/mine/src
356+
- name: Checkout base UnicodeData.txt
357+
if: ${{ github.event_name == 'pull_request'}}
358+
uses: actions/checkout@v3
359+
with:
360+
ref: ${{ github.event.pull_request.base.sha }}
361+
path: base
362+
sparse-checkout: unicodetools/data/ucd/dev/UnicodeData.txt
363+
- name: Compare repertoire
364+
if: ${{ github.event_name == 'pull_request'}}
365+
run: |
366+
# Look for changes affecting the first two fields of UnicodeData.txt (code point and name).
367+
sed 's/^\([^;]*;[^;]*\);.*$/\1/' unicodetools/mine/src/unicodetools/data/ucd/dev/UnicodeData.txt > merged-repertoire.txt
368+
sed 's/^\([^;]*;[^;]*\);.*$/\1/' base/unicodetools/data/ucd/dev/UnicodeData.txt > base-repertoire.txt
369+
set +e
370+
diff base-repertoire.txt merged-repertoire.txt
371+
echo "REPERTOIRE_CHANGED=$?" >> "$GITHUB_ENV"
372+
- name: Get the CLDR_REF from pom.xml
373+
id: cldr_ref
374+
run: echo "CLDR_REF="$(mvn --file unicodetools/mine/src/pom.xml help:evaluate -Dexpression=cldr.version -q -DforceStdout | cut -d- -f3) >> $GITHUB_OUTPUT && cat ${GITHUB_OUTPUT}
375+
- name: Verify CLDR checkout ref
376+
run: echo CLDR_REF="${{ steps.cldr_ref.outputs.CLDR_REF }}" && [ "${{ steps.cldr_ref.outputs.CLDR_REF }}x" != "x" ] # fail if empty
377+
- name: Cache CLDR repository
378+
uses: actions/cache@v3
379+
with:
380+
path: cldr/mine/src
381+
key: cldr-${{ steps.cldr_ref.outputs.CLDR_REF }}
382+
restore-keys: |
383+
cldr
384+
- name: Check out CLDR
385+
uses: actions/checkout@v3
386+
with:
387+
repository: unicode-org/cldr
388+
path: cldr/mine/src
389+
ref: main
390+
fetch-depth: 0
391+
- name: Switch CLDR to CLDR_REF
392+
run: cd cldr/mine/src && git fetch && git checkout ${{ steps.cldr_ref.outputs.CLDR_REF }}
393+
- name: Set up JDK 11
394+
uses: actions/setup-java@v1
395+
with:
396+
java-version: 11
397+
- name: Cache local Maven repository
398+
uses: actions/cache@v2
399+
with:
400+
path: ~/.m2/repository
401+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
402+
restore-keys: |
403+
${{ runner.os }}-maven-
404+
- name: Set up out-of-source output dir
405+
run: |
406+
mkdir -p unicodetools/mine/Generated/BIN
407+
408+
- name: Run invariant tests
409+
run: |
410+
cd unicodetools/mine/src
411+
echo "REPERTOIRE_CHANGED=$REPERTOIRE_CHANGED"
412+
if [[ ${REPERTOIRE_CHANGED:-0} -ne 0 ]]
413+
then ERROR="::notice"
414+
else ERROR="::error"
415+
fi
416+
MAVEN_OPTS="-ea" mvn -s .github/workflows/mvn-settings.xml test -am -pl unicodetools -Dtest=TestTestUnicodeInvariants#testSecurityInvariants -DCLDR_DIR=$(cd ../../../cldr/mine/src ; pwd) -DUNICODETOOLS_GEN_DIR=$(cd ../Generated ; pwd) -DUNICODETOOLS_REPO_DIR=$(pwd) -DUVERSION=$CURRENT_UVERSION -DfailIfNoTests=false -DEMIT_GITHUB_ERRORS 2>&1 | sed "s/^::error/$ERROR/"
417+
STATUS=${PIPESTATUS[0]}
418+
if [[ ${REPERTOIRE_CHANGED:-0} -ne 0 ]]
419+
then exit 0
420+
else exit $STATUS
421+
fi
422+
env:
423+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
uses: actions/checkout@v3
5454
with:
5555
sparse-checkout: py/pipeline-workflow
56-
- name: Check L2 document
56+
- name: Check L2 document and WG references
5757
run: |
5858
python3 py/pipeline-workflow/check-l2-document.py
5959
utc-decision:

.github/workflows/push-jsp-on-tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
env:
5050
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5151
- name: Upload UnicodeJsps.war
52-
uses: actions/upload-artifact@v2
52+
uses: actions/upload-artifact@v3
5353
with:
5454
name: UnicodeJsps
5555
path: UnicodeJsps/target/UnicodeJsps.war

.github/workflows/pythonpackage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
python-version: [3.8]
18+
python-version: [3.12]
1919

2020
steps:
2121
- uses: actions/checkout@v3

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ The tools maintainers use GH issues for issues with the code in this repo.
2525

2626
Copyright © 2001-2024 Unicode, Inc. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the United States and other countries.
2727

28-
The project is released under [LICENSE](./LICENSE).
29-
3028
A CLA is required to contribute to this project - please refer to the [CONTRIBUTING.md](https://github.com/unicode-org/.github/blob/main/.github/CONTRIBUTING.md) file (or start a Pull Request) for more information.
29+
30+
The contents of this repository are governed by the Unicode [Terms of Use](https://www.unicode.org/copyright.html) and are released under [LICENSE](./LICENSE).

UnicodeJsps/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<!-- icu -->
3030
<dependency>
3131
<groupId>com.ibm.icu</groupId>
32-
<artifactId>icu4j-for-cldr</artifactId>
32+
<artifactId>icu4j</artifactId>
3333
</dependency>
3434

3535
<dependency>

UnicodeJsps/src/main/java/org/unicode/cldr/tool/TablePrinter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ private int findIdentical(Comparable[][] sortedFlat, int rowIndex, int colIndex)
451451
}
452452
return sortedFlat.length - rowIndex;
453453
}
454+
454455
// to-do: prevent overlap when it would cause information to be lost.
455456
private BitSet breaksSpans = new BitSet();
456457

UnicodeJsps/src/main/java/org/unicode/jsp/Confusables.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.unicode.jsp;
22

3-
import com.ibm.icu.dev.util.CollectionUtilities;
43
import com.ibm.icu.dev.util.UnicodeMap;
54
import com.ibm.icu.impl.Utility;
65
import com.ibm.icu.text.Normalizer;
@@ -41,7 +40,7 @@ public static UnicodeMap<String> getMap() {
4140
UnicodeMap<String> result = new UnicodeMap<String>();
4241
for (String s : equivalents) {
4342
Set<String> others = new TreeSet<String>(equivalents.getEquivalences(s));
44-
String list = "\u2051" + CollectionUtilities.join(others, "\u2051") + "\u2051";
43+
String list = "\u2051" + String.join("\u2051", others) + "\u2051";
4544
for (String other : others) {
4645
result.put(other, list);
4746
}

UnicodeJsps/src/main/java/org/unicode/jsp/Globe.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ private static void loadSourceMap(String sname) {
495495
}
496496
changeImage(frame);
497497
}
498+
498499
/**
499500
* @param frame
500501
*/
@@ -704,12 +705,14 @@ public Shape getClip() {
704705
}
705706
return clip;
706707
}
708+
707709
/**
708710
* @return
709711
*/
710712
public boolean usesOrigin() {
711713
return false;
712714
}
715+
713716
// must set before use
714717
Transform set(double srcW, double srcH, double dstW, double dstH) {
715718
this.srcW = srcW;
@@ -724,6 +727,7 @@ Transform set(double srcW, double srcH, double dstW, double dstH) {
724727
clip = null;
725728
return this;
726729
}
730+
727731
// Remember that the coordinate system is upside down so apply
728732
// the transform as if the angle were negated.
729733
// cos(-angle) = cos(angle)
@@ -750,6 +754,7 @@ public final boolean transform(double x, double y, DPoint retcoord) {
750754
retcoord.y = lat_dstH.map(retcoord.y);
751755
return retcoord.x >= 0.0 && retcoord.x <= dstW && retcoord.y >= 0 && retcoord.y <= dstH;
752756
}
757+
753758
// Remember that the coordinate system is upside down so apply
754759
// the transform as if the angle were negated. Since inverting
755760
// the transform is also the same as negating the angle, itransform
@@ -774,18 +779,21 @@ public final boolean itransform(double x, double y, DPoint retcoord) {
774779
retcoord.y = srcH_lat.back(retcoord.y);
775780
return retcoord.x >= 0.0 && retcoord.x <= srcW && retcoord.y >= 0 && retcoord.y <= srcH;
776781
}
782+
777783
/**
778784
* @param input and output: latitude in y (radians from -pi/2 to pi/2) and longitude in x
779785
* (radians from -pi to pi)
780786
*/
781787
protected abstract void _transform(DPoint retcoord);
788+
782789
/**
783790
* @param input and output: latitude in y (radians from -pi/2 to pi/2) and longitude in x
784791
* (radians from -pi to pi)
785792
*/
786793
protected abstract void _itransform(DPoint retcoord);
787794

788795
protected abstract Shape _getClip();
796+
789797
/**
790798
* @param style
791799
* @return
@@ -866,6 +874,7 @@ public void _transform(DPoint retcoord) {
866874
public void _itransform(DPoint retcoord) {
867875
// nothing
868876
}
877+
869878
/* (non-Javadoc)
870879
* @see Globe.Transform#_getClip()
871880
*/
@@ -979,6 +988,7 @@ public static class TransformEqualAreaEllipse extends Transform {
979988
debugTemp = false;
980989
}
981990
}
991+
982992
// Area of a spherical cap is 2 pi r^2 (1-sin(lat))
983993
// Area of a circular segment is r^2 ( acos(p) - p sqrt(1-p^2)), where p = dist to chord/r
984994
// Thus we get the itransform easily:
@@ -1016,6 +1026,7 @@ public void _itransform(DPoint retcoord) {
10161026
protected Shape _getClip() {
10171027
return new Ellipse2D.Double(0, 0, dstW, dstH);
10181028
}
1029+
10191030
/**
10201031
* @param in -1..1
10211032
* @return value in 0..PI
@@ -1573,6 +1584,7 @@ public void imageComplete(int status) {
15731584
consumer.imageComplete(status);
15741585
}
15751586
}
1587+
15761588
/*
15771589
public static double convertDegreesToDecimal(double degrees, double minutes, double seconds, boolean NorthOrEast) {
15781590
double result = (degrees + minutes / 60 + seconds / 3600);
@@ -1932,6 +1944,7 @@ void fixContents() {
19321944
lineContents[c.yStart].add(c);
19331945
}
19341946
}
1947+
19351948
/**
19361949
* @param c
19371950
* @return
@@ -2066,6 +2079,7 @@ private static void drawDegrees(
20662079
}
20672080

20682081
private static DPoint drawLineP1 = new DPoint();
2082+
20692083
/*
20702084
20712085
private static void drawLine(Graphics2D graphics2D, Transform trans, double x1, double y1, double x2, double y2) {
@@ -2111,6 +2125,7 @@ private static void drawLine2(Graphics2D graphics2D, Transform trans, double x,
21112125

21122126
abstract static class TTransform {
21132127
double x, y;
2128+
21142129
// t is 0..1
21152130
abstract void transform(double t);
21162131
}
@@ -2174,11 +2189,13 @@ static class LineDrawer {
21742189
transient double startX, startY, startT;
21752190
// transient double endX, endY, endT;
21762191
TTransform ttransform;
2192+
21772193
// int segments = 0;
21782194
LineDrawer(Graphics2D graphics2D, TTransform ttransform) {
21792195
this.graphics2D = graphics2D;
21802196
this.ttransform = ttransform;
21812197
}
2198+
21822199
// t is 0..1
21832200
void draw(double startT, double endT) {
21842201
this.startT = startT;

0 commit comments

Comments
 (0)