Skip to content

Mavenize UnicodeTools (#64) #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 1, 2021
Merged

Mavenize UnicodeTools (#64) #91

merged 6 commits into from
Oct 1, 2021

Conversation

srl295
Copy link
Member

@srl295 srl295 commented Jul 5, 2021

  • update unicodetools/ to be built with Maven
  • move data.picker data and classes into source, all other data in data/ is left where it is.
  • restructure tests to be JUnit

Fixes #64

@srl295 srl295 self-assigned this Jul 5, 2021
@srl295 srl295 closed this Jul 5, 2021
@srl295 srl295 reopened this Jul 5, 2021
@srl295 srl295 changed the title #64 ⚠️ danger danger ⚠️ #64 ⚠️ danger danger ⚠️ (Mavenize unicodetools) Jul 12, 2021
@srl295
Copy link
Member Author

srl295 commented Jul 12, 2021

snapshot of disabled tests. I think all of these were not-working under Eclipse.

unicodetools/src/test/java//org/unicode/draft/MessageFormatCheck.java:@Disabled("All Broken")
unicodetools/src/test/java//org/unicode/draft/TestSourceTarget.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/draft/TestCalendar.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/draft/TestCalendar.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/draft/TestCalendar.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/draft/TestCalendar.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/unittest/TestIdnaTest.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/unittest/TestIdnaTest.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/unittest/TestIdnaTest.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/unittest/TestIdnaTest.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/unittest/TestLocaleConstruction.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/unittest/TestSettings.java:     @Disabled("Broken")
unicodetools/src/test/java//org/unicode/unittest/TestLocaleCanonicalization.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/unittest/TestLocaleValidity.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/unittest/TestSegmenter.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/tools/emoji/unittest/TestEmojiDataConsistency.java:    @Disabled("Broken? data load issue")
unicodetools/src/test/java//org/unicode/tools/emoji/unittest/TestEmojiDataConsistency.java:    @Disabled("Broken? data load issue")
unicodetools/src/test/java//org/unicode/tools/emoji/unittest/TestEmojiOrder.java:@Disabled("Broken? data load issue")
unicodetools/src/test/java//org/unicode/tools/emoji/unittest/TestCandidateData.java:@Disabled("broken?")
unicodetools/src/test/java//org/unicode/tools/emoji/unittest/TestCandidateData.java: @Disabled("broken?")
unicodetools/src/test/java//org/unicode/tools/emoji/unittest/TestProposalData.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/tools/emoji/unittest/TestProposalData.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/tools/emoji/unittest/TestProposalData.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/tools/emoji/unittest/TestProposalData.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/tools/emoji/unittest/TestEmojiData.java:@Disabled("data will not load")
unicodetools/src/test/java//org/unicode/tools/emoji/unittest/TestEmojiData.java:    @Disabled("Not working yet")
unicodetools/src/test/java//org/unicode/test/TestUnicodeMapParser.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/test/TestUnicodeMapParser.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/idna/TestTransform.java:    @Disabled("Broken - Requested array size exceeds VM limit in org.unicode.idna.FilteredUnicodeTransform.transform(FilteredUnicodeTransform.java:31)    ")
unicodetools/src/test/java//org/unicode/propstest/TestXUnicodeSet.java: @Disabled("Broken")
unicodetools/src/test/java//org/unicode/propstest/TestImmutableUnicodeMap.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/propstest/TestImmutableUnicodeMap.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/propstest/TestScriptInfo.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/propstest/TestInvariants.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/propstest/TestProperties.java:    @Disabled("Broken")
unicodetools/src/test/java//org/unicode/propstest/TestScriptMetadata.java:    @Disabled("Broken")

@srl295 srl295 force-pushed the srl295/issue64 branch 4 times, most recently from 656903a to 3a2f404 Compare July 13, 2021 15:23
@srl295 srl295 changed the title #64 ⚠️ danger danger ⚠️ (Mavenize unicodetools) Mavenize UnicodeTools (#64) Phase I Jul 17, 2021
@srl295
Copy link
Member Author

srl295 commented Aug 16, 2021

merge to keep this up to date. Will squash it later into fewer commits.

@srl295 srl295 force-pushed the srl295/issue64 branch 2 times, most recently from 379e679 to 78f05c6 Compare August 16, 2021 20:39
@srl295 srl295 marked this pull request as ready for review September 20, 2021 19:49
@srl295
Copy link
Member Author

srl295 commented Sep 20, 2021

Lots of commits to enable review… some of the commits are bulk renames.

Ready, if tests pass…

@srl295
Copy link
Member Author

srl295 commented Sep 20, 2021

todo:

  • Update docs
  • push icu.version and cldr.version properties or even dependencymanagement into the parent pom ( from jsp: move to Maven #41 )
  • update icu.version and cldr.version

@markusicu windows-setup.md seems to be very svn-centric… is it still up to date and/or needed? At least the parts about building (ant, etc) could be removed.

@srl295
Copy link
Member Author

srl295 commented Sep 21, 2021

Added docs

@markusicu
Copy link
Member

@markusicu windows-setup.md seems to be very svn-centric… is it still up to date and/or needed? At least the parts about building (ant, etc) could be removed.

I don't work on Windows. When I moved the docs into GitHub, I touched that page just lightly, leaving the rest for Laurentiu or whoever else is using Windows.

@srl295
Copy link
Member Author

srl295 commented Sep 28, 2021

todo:

  • review comments (thanks!)
  • Squash the squashable.
  • update ALL commit metadata so each commit could standalone metadata wise if need be.
  • Merge it

srl295 added a commit that referenced this pull request Sep 28, 2021
- bump surefire and other tests
- at least make sure it can compile

Fixes: #64
X-PR-URL: #91
srl295 added a commit that referenced this pull request Sep 28, 2021
- bump surefire and other tests
- at least make sure it can compile
- build all branches
- keep name thesame because of github bug
- wonderful settings fix
- even more fun with settings
- .. and credentials

Fixes: #64
X-PR-URL: #91
srl295 added a commit that referenced this pull request Sep 28, 2021
@srl295
Copy link
Member Author

srl295 commented Sep 28, 2021

@echeran I've restructured the commits, should be ready to go

I think i'd like to get this in and then start getting folks testing it

@echeran
Copy link
Contributor

echeran commented Sep 29, 2021

@echeran I've restructured the commits, should be ready to go

I think i'd like to get this in and then start getting folks testing it

Ok, sounds fine.

Kudos for the inclusion of command-line instructions -- this is important because if Maven instructions work at the command line, then pretty much any major IDE can easily import the project and behave similarly without us having a hard dependency on Eclipse. Other IDEs these days are much snappier for Java, in my experience.

I tried following along to see if I could follow along with the instructions (gh pr checkout 91 --repo unicode-org/unicodetools; mkdir -p ../Generated; mvn exec:java -Dexec.mainClass= ...) but I ended up having to spy on the Github Actions workflow and guess at which commands to cherry pick and how to modify them in order to get something to run....

If not in this PR, then soon after, we should try to spruce up the instructions so that even someone like me can follow -- something that takes no more critical thinking than "1) open pouch 2) place in toaster 3) eat" -- I'm happy to help, so feel free to file a followup issue and assign to me. That may or may not help others test out, too.

echeran
echeran previously approved these changes Sep 29, 2021
@srl295
Copy link
Member Author

srl295 commented Sep 29, 2021

pretty much any major IDE can easily import the project and behave similarly without us having a hard dependency on Eclipse.

Yes exactly this! I use vs code mostly.

open pouch, put in toaster

I think this mostly has to do with the settings situation. Should be follow up prs.

The GitHub actions only exercises one path I was able to make work, may not be the best for testing.

Will merge thanks 🎉

@srl295
Copy link
Member Author

srl295 commented Sep 29, 2021

Oh I did conflict with myself. Oops.

@srl295
Copy link
Member Author

srl295 commented Sep 29, 2021

@markusicu can i get a RSLGTM?

@srl295
Copy link
Member Author

srl295 commented Sep 29, 2021

@markusicu or may I promote @echeran to a comitter?

@@ -199,7 +199,7 @@ public void remove() {
}
}

private final class PrimaryIterable implements Iterable<UCA.Primary> {
public final class PrimaryIterable implements Iterable<UCA.Primary> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why public if we didn't need that before?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was to work around a JDK issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ERROR] /Users/srl295/src/unicodetools/unicodetools/src/main/java/org/unicode/text/UCA/WriteCollationData.java:[1805,74] org.unicode.text.UCA.UCA.PrimaryIterable.iterator() is defined in an inaccessible class or interface

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. getIgnorableAndRegularPrimaries() returns a PrimaryIterable, and WriteCollationData tries to iterate over it. I hate to ask but how did this work before? Maybe getIgnorableAndRegularPrimaries() should return the interface Iterable<UCA.Primary> if the class was meant to be kept private?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it did work this summer when I generated UCA data files several times.
I wonder if a later JDK got stricter? (Since you are upgrading to 11 I think.)

If the call sites don't need to know the specific impl class, then returning Iterable<UCA.Primary> would be fine.

Copy link
Member

@markusicu markusicu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly lgtm

Thanks for all of this work, and also moving the tests to JUnit!
(But now I have to learn a new flavor of JUnit...)


The message on the second commit does not seem to describe the few changes there. Worth fixing? Or squash with the third commit?

There are still some unresolved/unreplied comments/questions from Elango.

@srl295
Copy link
Member Author

srl295 commented Oct 1, 2021

mostly lgtm

Thanks for all of this work, and also moving the tests to JUnit! (But now I have to learn a new flavor of JUnit...)

👍

just to distinguish, you can use the prior (TestFmwk) style of asserts still if preferred.

The message on the second commit does not seem to describe the few changes there. Worth fixing? Or squash with the third commit?

  • I'll take a look.

There are still some unresolved/unreplied comments/questions from Elango.

  • Will also take a look

srl295 added 5 commits October 1, 2021 15:15
- tests: rename many test files
- pom: bump surefire and other tests
- workflow: at least make sure it can compile, build all branches, credentials

Fixes: #64
X-PR-URL: #91
- move additional test files around

Fixes: #64
X-PR-URL: #91
- disable more tests that did not work previously
- fix compile issues
- use JDK11 to avoid build issue

> unicodetools/unicodetools/src/test/java/org/unicode/propstest/RegexWordBreak.java:[133,44] incompatible types: inference variable T has incompatible equality constraints java.lang.Enum,capture#1 of ? extends java.lang.Enum

- improve how CLDR dir is checked out
- mkdir Generated/BIN etc when needed
- try to generate unicode data on CI
- create output dir first
- fix Generated path

Documentation:

- bump CLDR/ICU deps into top level
- update docs on how to use maven
- add docs on updating CLDR/ICU versions
- update workflows to use top level maven file
- update docs on setup/updating
- pom versions to 1.0.0

Fixes: #64
X-PR-URL: #91
- fix broken lines in CharData.java
- cleanup maven poms
Move more configuration into the top level pom.xml, add some comments

Fixes: #64
X-PR-URL: #91
@srl295 srl295 requested a review from markusicu October 1, 2021 20:17
@srl295
Copy link
Member Author

srl295 commented Oct 1, 2021

@markusicu @echeran Ok -

  • reworded 2nd commit (squashed the two 'move tests around' commits together, one was a delta of the other)
  • merged today's 'review comment' changes into the last commit

@srl295
Copy link
Member Author

srl295 commented Oct 1, 2021

btw,

Thanks for all of this work

being on either side of the Review button on these mega-changes is never a walk in the park, so thank you. I'm optimistic that easier onboarding to this project will really benefit ucd-dev and thus Unicode.

@srl295 srl295 changed the title Mavenize UnicodeTools (#64) Phase I Mavenize UnicodeTools (#64) Oct 1, 2021
@srl295
Copy link
Member Author

srl295 commented Oct 1, 2021

Also I don't have a "Phase II" planned, so I took out the "Phase I". I think I originally thought there might be some smaller steps, but they didn't make as much sense.

Followons will include the deduplicating of code by making UnicodeJsps depend on unicodetools, but that's for #66

srl295 added a commit that referenced this pull request Oct 1, 2021
Fixes #58
(note that #91 already corrects the Java part of this)
Copy link
Contributor

@echeran echeran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@markusicu markusicu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

<configuration>
<systemPropertyVariables>
<!-- These are variables which are picked up by test runs -->
<UVERSION>13.0.0</UVERSION>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

14? later PR?

@srl295 srl295 merged commit 8d6bd2e into main Oct 1, 2021
@srl295 srl295 deleted the srl295/issue64 branch October 1, 2021 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

move main tools to maven
3 participants