Skip to content
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

Use upstream #644

Open
wants to merge 86 commits into
base: master
Choose a base branch
from
Open

Conversation

Adrian-Devries
Copy link
Contributor

Currently, the project is not using current upstream sources; some resources are outdated, others are orphaned. Find details attached:

Sometimes, resources from upstream have been renamed and/or modified. Find the modifications already made in your original repository attached:

Note that the patches mentioned above do not ignore changes in white space. This way, it becomes obvious that the rule to keep the tab size has been ignored by the maintainers before.

This pull request removes orphaned resources and updates all resources to the most recent upstream. All resources from upstream are now located in folders reflecting the name of the distribution package. This way, it should be easier to maintain them. Documentation has been added to NOTICE.

With regards to visualization the upstream xrechnung-3.0.2-xrechnung-visualization-2024-06-20.zip has been extended as follows:

Note that I have filed a pull request against the upstream project as well (cf. itplr-kosit/xrechnung-visualization#23).

In addition, the Maven infrastructure has been normalized and modernized as in my previous pull request #623. The project is now using the most recent versions of all dependencies and plugins. Version information has been centralized in the top level POM. Two plugins have been added:

  • org.openrewrite.maven:rewrite-maven-plugin (for normalizing Maven and Java sources)
  • org.codehaus.mojo:xml-maven-plugin (for normalizing XML based resources)

The configuration of the plugin com.helger.maven:ph-schematron-maven-plugin has been changed to reflect the changes made in the resources tree. It is now not any longer necessary to rename sources from upstream and to modify them to reflect the renaming.

For the plugin org.codehaus.mojo:xml-maven-plugin a transformation script Normalize.xslt has been provided that not only normalizes white space etc., but also addresses certain issues, e.g., SXWN9009, SXWN9027 (find comments inside the file). This way, my previous pull request #621 is not needed anymore. Note that I have filed pull requests against upstream projects though (cf. #621 (comment)).

Currently, the plugin org.openrewrite.maven:rewrite-maven-plugin has been configured to do a dryRun only. Find an example of the output attached:

Java sources have been changed accordingly where necessary to reflect the changes made in the resources tree. In addition, certain typos (e.g., "Arithmetric") and other quirks have been corrected. Without claiming to be complete:

  • Main.java
    • performValidate: Parameter "String lang" added
  • ClasspathResolverURIAdapter.java
    • Logger added (to enable debug messages)
  • ClasspathResourceURIResolver.java
    • Class extracted from ZUGFeRDVisualizer (to enable usage from both classes ZUGFeRDVisualizer and ValidationLogVisualizer)
    • Certain constants moved to this class
    • Logger added (to enable debug messages)
    • Resolver modified (to reflect changes made in resources tree)
  • ELanguage.java
    • Class extracted from ZUGFeRDVisualizer (to enable usage from both classes ZUGFeRDVisualizer and ValidationLogVisualizer)
  • ValidationLogVisualizer.java
    • Using extracted classes (see above)
    • applyXSLTToPDF: Parameter "ELanguage lang" added, transformer parameter set (although the script result-pdf.xsl has not been localized yet)
    • toFOP: Parameter "ELanguage lang" added, signature with default value added
  • ZUGFeRDVisualizer.java
    • visualize: Using upstream HTML transformation
    • applyXSLTToHTML: Parameter "ELanguage lang" added, transformer parameter set
    • applyXSLTToPDF: Parameter "ELanguage lang" added, transformer parameter set
    • toFOP: Parameter "ELanguage lang" added, signature with default value added
  • EVersion.java
    • Class added
  • SchemesPerVersion.java
    • Class added
  • ScriptsPerVersion.java
    • Class added
  • XMLValidator.java
    • Various changes to reflect the changes made in resources tree
    • Handling for all flavors of OrderX added
    • Handling for UBL CreditNote added
    • Handling for other flavors of XRechnung added

Of course, the new script result-pdf.xsl has been kept, but typos have been corrected there as well.

All tests succeed. Find log files attached:

By the way, generating the XSLT scripts from Schematron files with the plugin com.helger.maven:ph-schematron-maven-plugin takes approximately 2 minutes, not more (cf. A_06_generate-resources.log).

Apply use upstream rule and keep tabsize rule
Apply use upstream rule and keep tabsize rule
Apply use upstream rule and keep tabsize rule
Apply use upstream rule and keep tabsize rule
Apply use upstream rule and keep tabsize rule
Apply use upstream rule and keep tabsize rule
Apply use upstream rule and keep tabsize rule
Apply use upstream rule and keep tabsize rule
Apply use upstream rule and keep tabsize rule
Apply use upstream rule and keep tabsize rule
Apply use upstream rule and keep tabsize rule
Apply use upstream rule and keep tabsize rule
….xsl

Apply use upstream rule and keep tabsize rule
Apply use upstream rule and keep tabsize rule
Apply use upstream rule and keep tabsize rule
Apply use upstream rule and keep tabsize rule
Apply use upstream rule and keep tabsize rule
Add some documentation
Correct some typos
Move some internal classes one level up so that both visualizer classes could use them
Add some documentation
@Adrian-Devries Adrian-Devries mentioned this pull request Jan 4, 2025
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.

1 participant