Announcement

Collapse
No announcement yet.

use BC programatically?

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

  • use BC programatically?

    I am interested in BC as a tool to use within our build process. However, I'm not interested in using BC's interactive/GUI features because I want to call BC from a build tool like FinalBuilder or Visual Build Pro to compare folders and files within folders and generate delta scripts based on difference rules. Can BC be used in this way? If so, does it have a COM interface or is it command line only?

    Clive

  • #2
    Re: use BC programatically?

    BC can be run from the commandline, invoking a Script file that can run comparisons and generate reports. We have 2 different types of reports I can think will meet your needs, we have 4 different types of Patch reports, formatted in various ways. We also have an XML dump, which gives detailed information on the lines in the files.
    The reports are available from File -> File Differences Report.

    These reports can be generated with script and saved to a file output location. Here is an excerpt from our Help file:

    FILE-REPORT

    Usage:
    file-report layout:<layout> [options:<options>] \
    [title:<report title>] \
    output-toprinter|clipboard|<filename>) \
    [output-options:<options>] [<filename1> <filename2>]

    Generates a file comparison report of the currently selected files.

    layout controls the reports appearance, and can be any of over-under, side-by-side, composite, patch, statistics, or xml.
    options is optional, and is used differently for each layout.

    ignore-unimportant treats differences in unimportant text as matches and is available in all layouts.
    display-all, display-mismatches, display-context, or display-matches can be used to control which lines of the comparison are included in the report and are available in all layouts except patch and statistics. By default, display-all is used.
    line-numbers includes line numbers in the side-by-side layout.
    stats-descriptive or stats-tabular (CSV) formats are available in the statistics layout. By default, stats-descriptive is used.
    patch-standard, patch-context, patch-unified, or patch-classic formats are available in the patch layout. By default, patch-standard is used.


    Further information is available in the help file under Command Line and Scripting section.

    I recommend trying out the different reports in the GUI, finding the one you like, and then we can figure out how to output that report.

    Script itself emulates actions you can take in the GUI. It is best to plan out the actions you want to take, and be able to do them in the GUI, and then create the script that will do those actions. Many of these can also be saved in the GUI as a Session, where the script can load that session. This simplifies the scripting somewhat, as well.
    Aaron P Scooter Software

    Comment


    • #3
      Re: use BC programatically?

      Thanks for the information. I've downloaded the eval version of BC and got a basic BC Action working in FinalBuilder using BC scripts. I managed to generate a text file that lists left and right columns of files in Folder A and files in Folder B - showing files that are in one but not the other and visa versa. This is the information I need but somehow I need to translate that into list information that FinalBuilder can use. In other words : -

      List A: Files in Folder A but not in Folder B
      List B: Files in Folder B but not in Folder A

      I also have to create a list of files that are both in Folder A and Folder B so I can iterate through that list to test for differences within the files.

      Any suggestions about how I should do these things using BC action within FinalBuilder?

      Thanks,
      Clive

      Comment


      • #4
        Re: use BC programatically?

        That depends on what kind of report you would like to show. I would recommend using the GUI to create all the different reports we have to offer. Was the one in the example not what you were looking for? (It would seem to match the description from the original post). To make two seperate reports, you can make another folder-report script call.

        We call files on one side but not the other Orphans. If you select Actions menu -> Folder Comparison report, Summary report, and Only Right Side Orphans, is that the type of report you are looking for?

        And, for the list, Summary, All files what you are looking for? Though, why do you need a list in order to iterate through to test for differences (with beyond compare)? You can script a comparison in beyond compare (run a session, then run a certain type of comparison, crc, rules, binary, etc), just like you can script a report.
        Or are you looking to do something in another program?


        Script emulates actions you can take in the program. If there is a series of actions you want to take, work through them with the GUI, and then we can script them into a single (or multiple) scripts.

        Such as:
        I want to open Session "Compare A to B"
        then I want to binary compare all the files.
        then I want to then synchronize left A to right B (doesn't then I want to delete Orphans in B (files only in B not A))
        then I want to Print (put into report1.txt) a Report that shows all of the differences (different files and orphans).
        then I want to Print (put into report2.txt) a Report that shows all the files.

        Does this help? Let us know if you have any questions.

        ----------------
        Edit: And I am going to investigate using the Final Builder Actions. But I see it has a section to input straight script. For more complicated generation/comparisons, this may be what you need to use. We can help you set that up if that is the case.
        Aaron P Scooter Software

        Comment


        • #5
          Re: use BC programatically?

          Finalbuilder doesn't include support for parsing script output.

          The "Beyond Compare" action can compare two files, then succeed or fail based on the comparison result of two files.

          The "Beyond Compare Script" action in FinalBuilder can only call a script. It doesn't provide a way to use the output of a script. You'll need to come up with your own method of parsing the report file generated by your script.
          Chris K Scooter Software

          Comment


          • #6
            Re: use BC programatically?

            Aaron & Crhis,
            Thanks. I want to parse the output and be able to iterate through the items in order to things via FinalBuilder like change a specific bit of text in files, include the text/script within the files into a master script. Just dumping out a report of diffs isn't useful and, if I needed that, I would just use the GIU. I need to work with the results programatically. Maybe there is a way to parse the output but I'm sure it won't be all that easy to do.

            Thanks again,
            Clive

            Comment


            • #7
              Re: use BC programatically?

              one of our report types is an xml dump, which is pretty good to parse.

              The patch type reports (we have 4), could also be parsed, depending on how you set them up.
              I was recommending you use the gui to find the report you want, and then we can help you script that specific one. Starting with script and editing script to get results is trickier than finding the steps you want via GUI, and then just scripting that solution.

              After final builder runs our script, can another task take over and parse out the information you need?

              brainstorming:
              Is there a specific test case scenario that you have? You mention some actions (change specific bit of text in files). When did you want to do this? If the files were different? Is this bit of text some new text, or does it come from file a or b? Where would it come from (source file. constant)?
              Aaron P Scooter Software

              Comment


              • #8
                Re: use BC programatically?

                Every time I call a script, a dialog box will pop up with the heading "BC script" with tabs for script, log, and errors. How do I disable this dialog box? Thanks.

                Tim.

                Comment


                • #9
                  Re: use BC programatically?

                  Use the /SILENT command line switch to prevent BC from displaying anything when you run a script.
                  Chris K Scooter Software

                  Comment

                  Working...
                  X