Someone asked that I post this info for those interested in a utility to compare a5wcmpt JSON source files.
In early 2017, I experimented with a program call BeyondCompare from scootersoftware.com. It almost has everything needed to efficiently compare AA component files stored in JSON format. I'm hoping someone can experiment with it and convince scootersoftware to make some changes or implement a few changes to the 3rd party pre-processor that sorts the JSON files prior to piping them into BeyondCompare. I made some suggestions to ScooterSoftware, but I don't think they ever implemented them. The 3rd party pre-processor is "jq". You can get the "c" source from gitHub at https://stedolan.github.io/jq/
I experimented with BeyondCompare (BC) version 4. First of all, in BC you can define a "grammar" for the source files being compared. I started with the default grammar for JSON files (downloadable from their website if not installed by default) and extended it a bit so the "grammar" would "know" about some of the special key/value pairs to look out for. Secondarily, I gave the following JSON keys a very high "line weight":
Along with creating the "Grammar" and "Line weights", I installed the suggested 3rd party free-ware for sorting JSON files (https://stedolan.github.io/jq/) . Sorting of the JSON files is the only way to be able to compare JSON AA source; the JSON property values are not position dependent and they tend to float around to different locations in the AA source files.
As I recall, here is what would need to be added to the jq pre-processor (or any other utility that sorts the JSON files before sending them to BC):
In early 2017, I experimented with a program call BeyondCompare from scootersoftware.com. It almost has everything needed to efficiently compare AA component files stored in JSON format. I'm hoping someone can experiment with it and convince scootersoftware to make some changes or implement a few changes to the 3rd party pre-processor that sorts the JSON files prior to piping them into BeyondCompare. I made some suggestions to ScooterSoftware, but I don't think they ever implemented them. The 3rd party pre-processor is "jq". You can get the "c" source from gitHub at https://stedolan.github.io/jq/
I experimented with BeyondCompare (BC) version 4. First of all, in BC you can define a "grammar" for the source files being compared. I started with the default grammar for JSON files (downloadable from their website if not installed by default) and extended it a bit so the "grammar" would "know" about some of the special key/value pairs to look out for. Secondarily, I gave the following JSON keys a very high "line weight":
- name
- baseName
- idInternal
- actionGuid
Along with creating the "Grammar" and "Line weights", I installed the suggested 3rd party free-ware for sorting JSON files (https://stedolan.github.io/jq/) . Sorting of the JSON files is the only way to be able to compare JSON AA source; the JSON property values are not position dependent and they tend to float around to different locations in the AA source files.
As I recall, here is what would need to be added to the jq pre-processor (or any other utility that sorts the JSON files before sending them to BC):
- Strip certain property values from the JSON source. For example, the "precalc" property needs to be taken out when comparing files. There are other properties that may be specific to the last person that edited the object; these properties have nothing to do with the actual source code and sometimes it is best to delete them when comparing two files.
- A way to override the sort sequence of some keys. There are some keys that contain GUID values that need to be shuffled to the top of the property list of an object to assist BeyondCompare in lining up objects.
- Intelligently Wrap long lines with cr/lf. It is un-wieldy trying to compare long lines; the pre-processor should just wrap the lines.
- Keys that have blank or zero values should have an option to just eliminate them from the output.