Announcement

Collapse
No announcement yet.

Beyond compare script for 2 level comparison of jar

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • prajakta
    replied
    Hi Aaron,

    Instead of using "Binary Comparison" if I use "Rule Based Comparison" I am getting expected result.

    Thank you so much for your help.

    Leave a comment:


  • Aaron
    replied
    Hello,

    We would probably need screenshots and a copy of the log to help determine what is happening in this case. 20 minutes seems too long to scan archive files. Are you using the latest release of BC3 (3.3.13)? All 3.x updates are free for 3.x users. You can email us at [email protected] with a few screenshots with Binary unchecked and binary checked to show your data loaded and the loading issue. What did you mean that the .class files are compared but the .xml and properties are not?

    Please include a link back to this forum thread in the email for our reference, and a copy of your BCSupport.zip from the Help menu -> Support; Export.

    Leave a comment:


  • prajakta
    replied
    Hi Aaron,

    With graphical interface also its showing as loading. The file comparison is running for 20 mins and still has not terminated.
    Our use case is as below
    parent.jar
    |->child.jar
    |-------->abc.class
    |----------->xyz.class
    |------------>test.properties
    |->pom.xml

    We want to compare everything inside parent jar (including child jar classes ) with another version of parent jar.

    If I use session with "archive as folder always" it compare the .class files inside child jars but it is not comparing .properties and pom.xml files. So in session I have selected "Binary Comparison" as well. But if I select "Binary Comparison" it just says loading and nothing happens

    Am I missing anything here? Is there any workround for this?

    Leave a comment:


  • Aaron
    replied
    Hello,

    If nothing has happened it is probably still extracting and loading. How long have you let it load?

    For all troubleshooting, I usually recommend loading in the graphical interface first. If you load the session Test, then load your .jar files into the session base folder paths.

    Also, to the jar files have .zips or other archives in them? You wouldn't need the Treat Archives as Folders option enabled to set .jar files as base folders; they would still load as folders and show their contents, it is for the files within the base folders.

    Leave a comment:


  • prajakta
    replied
    The session xml for Test session is


    -<TDirCompareSession Value="Test">
    <LastModified Value="2015-06-17 11:07:56"/>
    -<Rules>
    <ArchiveHandling Value="ahFolderAlways"/>
    <ContentCompareKind Value="ccBinary"/>
    <ExpandAllOnLoad Value="True"/>
    <UseContentComparison Value="True"/>
    <UseTimestampComparison Value="False"/>
    </Rules>
    </TDirCompareSession>
    -<TSessionFolder>
    -<Items>
    -<TDirCompareSession>
    -<Rules>
    <ArchiveHandling Value="ahFolderAlways"/>
    <ExpandAllOnLoad Value="True"/>
    <ExpandDiffsOnLoad Value="True"/>
    <UseTimestampComparison Value="False"/>
    </Rules>
    </TDirCompareSession>
    </Items>
    </TSessionFolder>
    </BCSessions>

    and the log output is
    6/17/2015 11:08:16 AM >> log verbose "C:\bclogs\bclog.txt"
    6/17/2015 11:08:16 AM >> criteria binary
    6/17/2015 11:08:16 AM >> load "Test"
    6/17/2015 11:08:16 AM Load comparison: <->
    6/17/2015 11:08:16 AM >> load abc.jar xyz.jar
    nothing happens after this load

    We want archive to be treated as folder.

    Leave a comment:


  • Aaron
    replied
    Also, if you load your session in the graphical interface, and then go to the Session menu -> Session Settings, and enable the Binary content scan here, do you see any errors in the log as the comparison runs?

    Leave a comment:


  • Aaron
    replied
    Hello,

    Can you include the text in the log of the error lines?

    Treating archives as Folders would expand the archives and binary scan the contents inside. If you disable this option, then it will binary scan the archive file as a single file. It depends on which behavior you need. Scanning the archive as a single file would be faster.

    Leave a comment:


  • prajakta
    replied
    Thanks Aaron.

    The session is loading now.
    But "criteria binary" line is causing problem.
    If I add criteria binary in script, the script does not terminate with no errors in logs.
    But if I remove it the script runs fine but the diff report doesnt show differences in pom.xml or .properties file.

    I have set treat "archives as folders" in session. Is that causing any problem?

    Leave a comment:


  • Aaron
    replied
    Hello,

    Could you attach or send in your current script.txt? I notice an error in my above example:

    It should load the saved session first, THEN set criteria and load folders or filters, etc:
    log verbose "C:\bclogs\bclog.txt"
    load "ArchivesAsFoldersSessionName"
    criteria binary
    load %1 %2
    expand all

    Leave a comment:


  • prajakta
    replied
    I am using this solution:-
    "Alternatively, you can set just this one setting in the Session Settings dialog, Handling, Always treat archives as folders. Then save the blank session. In script you can then reference this setting and then load the folders:"

    But the child jar is showing all the files and not just the modified files.
    Can you please help here?

    Leave a comment:


  • Aaron
    replied
    Hello,

    Scripting does not have a direct option to support this, but you can save a session with this setting set, and then use that session to control the option.

    To set this up, go to the graphical interface and launch a new blank Folder Compare. Here you can either configure everything to load the folders, criteria, settings.
    Alternatively, you can set just this one setting in the Session Settings dialog, Handling, Always treat archives as folders. Then save the blank session. In script you can then reference this setting and then load the folders:

    log verbose "C:\bclogs\bclog.txt"
    criteria binary
    load "ArchivesAsFoldersSessionName"
    load %1 %2
    expand all
    select all.files
    folder-report layout:summary &
    options:display-mismatches &
    output-to:"%3\summary.html"&
    expand all
    select all.files
    output-options:html-color
    folder-report layout:side-by-side &
    options:display-mismatches &
    output-to:"%3\foldercomparison.html" &
    output-options:html-color

    Leave a comment:


  • prajakta
    started a topic Beyond compare script for 2 level comparison of jar

    Beyond compare script for 2 level comparison of jar

    Hi There,

    We want to compare the jar referenced inside the jar ie 2 level comparison of artifacts.
    Please help us with script. We have below script which compares on the given jar but not the jar inside it.
    We are not able to drill down and check the changes in child jar.

    log verbose "C:\bclogs\bclog.txt"
    criteria binary
    load %1 %2
    expand all
    select all.files
    folder-report layout:summary &
    options:display-mismatches &
    output-to:"%3\summary.html"&
    expand all
    select all.files
    output-options:html-color
    folder-report layout:side-by-side &
    options:display-mismatches &
    output-to:"%3\foldercomparison.html" &
    output-options:html-color


    Thanks,
    Prajakta
Working...
X