-
Notifications
You must be signed in to change notification settings - Fork 9
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
Enable recursive XSD adding text output compare (as JavaFX is not working) #10
Open
svanteschubert
wants to merge
33
commits into
yoep:develop
Choose a base branch
from
svanteschubert:develop
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
d1ece58
Adding a test case with recursive grammar causing the existing progra…
svanteschubert 1f30f05
Resolving loop during load and compare by unique element handling (co…
svanteschubert 22a7771
Added second newer grammar for complex comparison test!
svanteschubert e948579
Adding first milestone with element & attribute comparison for adding…
svanteschubert 8ae13a6
Updated regression test to write current output ./target directory wi…
svanteschubert 59ad475
Tweaking output and update for regression tests
svanteschubert 6e68746
Adding to Files.writeString StandardOpenOption.TRUNCATE_EXISTING
svanteschubert 2252e6b
Adding command line options
svanteschubert a0d18aa
Refactored the command-line into an own class without changing it by …
svanteschubert e8386d5
Now activating TextReport interface
svanteschubert b1aa6bc
Activating SingleLineChangeTextReport - now only its content has to b…
svanteschubert d235749
SingleLine output for each XSD change is activated
svanteschubert 9df3d12
Added regression test for single line per change report and removed d…
svanteschubert 6b01fd2
Minor Refactoring of method names
svanteschubert cd9ff4c
Joining duplicated fixedValue and fixedDefault facet
svanteschubert 03aa7d7
Adding XSDs of the FR/DE Factur-x profiles (comparison with D22B trig…
svanteschubert ecb390e
Adding the Dangerous Report for XSD changes being likely critical for…
svanteschubert 9eac408
Mandatory elements within a xsd:choice become optional (single child …
svanteschubert 7d032c9
Adding report for extension and restriction
svanteschubert f38874a
Added facets xs:maxInclusive xs:maxExcluisve xs:minInclusive xs:minEx…
svanteschubert e4d50fe
Extending tests
svanteschubert 7c39053
Adding change detection of compositor (xs:sequence, xs:choice, xs:all)
svanteschubert ea191ce
Improving the output of comparisons: Stating no semantic change if a …
svanteschubert e95897c
Reducing memory foot-print by 1) removing XPath property and creating…
svanteschubert 4dd9af5
Adding comparison of element content
svanteschubert 99df93e
Renamed uncefact xml xsd folder to draft instead date to ease compare…
svanteschubert f31d062
Added update of uncefact xml draft of 20230424 - after dos2unix norma…
svanteschubert 4a2adab
Adjusted test references with new XSD D22B draft - after test directo…
svanteschubert f511016
Updating the reports on enumerations: A new enumeration (a subset of …
svanteschubert 51db2e2
Exchanging XSD files from UN/CEFACT from D22B draft to final XSD D22B…
svanteschubert 01ade9c
Refactoring: Moving Factur-X to Factur-X 1.0.06 folder and renaming t…
svanteschubert 448cbf0
Adding draft version of Factur-X 1.0.07 for QA comparison
svanteschubert 161dd01
Adding regression test files from the output of comparison of 1.0.07
svanteschubert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.idea/ | ||
target/ | ||
buid/ | ||
|
||
**/*.iml | ||
build/ | ||
logs/ | ||
**/*.iml |
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
config.stopBubbling = true | ||
lombok.addLombokGeneratedAnnotation = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,106 @@ | ||
package com.compare.xsd; | ||
|
||
import com.compare.xsd.comparison.TextReport; | ||
import com.compare.xsd.comparison.XsdComparer; | ||
|
||
import java.io.File; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class XsdCompareStarter { | ||
public static void main(String[] args) { | ||
XsdCompareApplication.main(args); | ||
public static void main( String[] args ) throws Exception { | ||
System.exit(run(args)); | ||
} | ||
|
||
@SuppressWarnings("deprecation") | ||
public static int run( String[] args ) throws Exception { | ||
final List<String> fileNames = new ArrayList<String>(); | ||
|
||
boolean gui = false; | ||
/** For instance, the SingleLineChangeTextReport creates only a single text line for every XSD change | ||
* this harder to read, but assists to compare the result with other XSD comparison tools */ | ||
TextReport.implementation reportType = TextReport.implementation.MULTI_LINE_CHANGE; | ||
|
||
for (int i = 0; i < args.length; i++) { | ||
args[i] = args[i].trim(); | ||
if (args[i].equalsIgnoreCase("-h") | ||
|| args[i].equalsIgnoreCase("-help") | ||
|| args[i].equalsIgnoreCase("-?")) { | ||
usage(); | ||
return -1; | ||
} | ||
else if (args[i].equalsIgnoreCase("-single") | ||
|| args[i].equalsIgnoreCase("-s") | ||
|| args[i].equalsIgnoreCase("--single") | ||
|| args[i].equalsIgnoreCase("--s")) reportType = TextReport.implementation.SINGLE_LINE; | ||
else if (args[i].equalsIgnoreCase("-multi") | ||
|| args[i].equalsIgnoreCase("-m") | ||
|| args[i].equalsIgnoreCase("--multi") | ||
|| args[i].equalsIgnoreCase("--m")) reportType = TextReport.implementation.MULTI_LINE_CHANGE; | ||
else if (args[i].equalsIgnoreCase("--extensions-only") | ||
|| args[i].equalsIgnoreCase("-e") | ||
|| args[i].equalsIgnoreCase("-extensions-only") | ||
|| args[i].equalsIgnoreCase("--e")) reportType = TextReport.implementation.ONLY_EXTENSIONS; | ||
else if (args[i].equalsIgnoreCase("--restrictions-only") | ||
|| args[i].equalsIgnoreCase("-r") | ||
|| args[i].equalsIgnoreCase("-restrictions-only") | ||
|| args[i].equalsIgnoreCase("--r")) reportType = TextReport.implementation.ONLY_RESTRICTIONS; | ||
else if (args[i].equalsIgnoreCase("-gui") | ||
|| args[i].equalsIgnoreCase("-g") | ||
|| args[i].equalsIgnoreCase("--gui") | ||
|| args[i].equalsIgnoreCase("--g")) gui = true; | ||
else if (args[i].equalsIgnoreCase("-ui") | ||
|| args[i].equalsIgnoreCase("-u") | ||
|| args[i].equalsIgnoreCase("--ui") | ||
|| args[i].equalsIgnoreCase("--u")) gui = false; | ||
|
||
/* usually the version number was added ot manifest during build | ||
} else if (args[i].equalsIgnoreCase("-version") || args[i].equalsIgnoreCase("-v")) { | ||
printVersion(); | ||
return -1; | ||
}*/ | ||
|
||
else { | ||
if( args[i].charAt(0)=='-' ) { | ||
System.err.println("Unrecognized option: " + args[i]); | ||
usage(); | ||
return -1; | ||
} | ||
fileNames.add(args[i]); | ||
} | ||
} | ||
if(fileNames.size() != 2){ | ||
usage(); | ||
}else{ | ||
String currentDir = System.getProperty("user.dir") + File.separator; | ||
if(gui){ | ||
String[] guiArgs = {currentDir + fileNames.get(0), currentDir + fileNames.get(1)}; | ||
XsdCompareApplication.main(guiArgs); | ||
}else { | ||
XsdComparer comparer = new XsdComparer(currentDir + fileNames.get(0), currentDir + fileNames.get(1), TextReport.implementation.SINGLE_LINE); | ||
System.out.println(comparer.compareAsString()); | ||
} | ||
return 0; | ||
} | ||
return -1; | ||
} | ||
|
||
|
||
/** Prints the usage screen. */ | ||
private static void usage() { | ||
System.out.println(USAGE_UI); | ||
} | ||
|
||
private static final String USAGE_UI = | ||
"usage: java -jar xsd-compare-jar-with-dependencies.jar <opts> <old-xsd-grammar> <new-xsd-grammar>\n\n" + | ||
"options:\n" + | ||
"\t\t--ui: omits the GUI and returns only a text result for comparision (default).\n" + | ||
"\t\t--gui: starts a JavaFX GUI front-end for comparison.\n" + | ||
"\t\t--multi or -m: multiple lines indented per change sorted by XSD change. (default).\n" + | ||
"\t\t--single or -s: one single line for each change with XPath in the start, harder to read but easier for compare the output with other tools.\n" + | ||
"\t\t--extensions-only or -e: one single line for each extension of the grammar sorted by type. Restrictions/limitations are being neglected.\n" + | ||
"\t\t--restrictions-only or -r: one single line for each new restrictions, requirements or limitations of the new grammar sorted by type. Extensions are being neglected.\n" + | ||
"\t\t--help or -h: this help text.\n"; | ||
// + "\t\t-version : display version number.\n"; | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it has to do with the new packaging plugin, but running the bundled jar doesn't seem to be working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may try to get packaging and frontend to work before my patch. At least did not work for me. Thanks for your help!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am usually testing/starting directly from the IDE and not triggering by commandline the JAR, but tested it once manually, when I was added the functionality (at least the xsd-compare-0.0.9-SNAPSHOT-jar-with-dependencies.jar)
Calling the following is showing me the options:
java -jar xsd-compare-0.0.9-SNAPSHOT-jar-with-dependencies.jar
With the former way, I had problems with the manifest...
You might considere to increase the JDK baseline to JDK 17 (or at least play around / test it ) for the JavaFX part?
Where are you hanging? Perhaps you start on a branch from scretch without any funcationality of mine from your latest commit before my PullRequest. Updating the pom.xml (not trivial - I have realized) :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are any question/remarks left to answer, please give me a ping, Yoep!
All the best,
Svante