View Issue Details

IDProjectCategoryView StatusLast Update
0000137CodegenGeneralpublic2018-10-01 16:14
Reporterpvlasov Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Target Version0.3.0 
Summary0000137: Patch merger
Description

Use https://github.com/wumpz/java-diff-utils or https://github.com/google/diff-match-patch to implement a merger which uses patch in the following way:

  • There is a directory .metadata/.plugins/org.nasdanika.codegen/patch in the project which contains generated files.
  • When merge method is invoked it:
    • Computes a patch from the old generated code to the workspace copy.
    • Applies the patch to the new generated code.

The patch merger may have a protected method which may be overridden by subclasses to validate patched content, e.g. for XML - try to parse patched XML, for JavaScript - the same - try to parse using Nashorn or something else. If validation fails - maybe create several files old and new and output warning that manual merge is required.

Add java-diff-utils and/or diff-match-patch to Maven OGSi for this.

XML patch (e.g. plugin.xml) would require a different approach - something like XPath expressions and operation - replace, add-child, add/set-attribute, ... May require if-else logic depending of whether something is present.

TagsNo tags attached.
Estimated effort
Sprint

Relationships

related to 0000120 new XML Merger 

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2018-07-14 17:10 pvlasov New Issue
2018-07-14 17:10 pvlasov Description Updated View Revisions
2018-08-23 04:22 pvlasov Target Version => 0.3.0
2018-10-01 16:13 pvlasov Description Updated View Revisions
2018-10-01 16:14 pvlasov Relationship added related to 0000120