How do I get latest clearcase label programmatically from C#?

前端 未结 2 1046
我在风中等你
我在风中等你 2020-12-04 00:32

I am trying to put version information to my C# GUI framework retrieved from the latest ClearCase label. This was originally done from Visual Soursafe as below.



        
相关标签:
2条回答
  • 2020-12-04 01:08

    I believe this could be better achieved through a script, which would be called from your C# program.

    But you may be able to directly call some COM objects, through the CAL interface provided with ClearCase.

    The documentation for the interface can be accessed through ClearCase help (Start>Programs>Rational ClearCase>ClearCase Help), where there's an entry for "ClearCase Automation Library (CAL)". An alternate path is to look in the ClearCase/bin directory for "cc_cal.chm".

    In VB, with CAL API, that would give something like:

    Dim CC As New ClearCase.Application 
    Dim labelID As String
    Set aVersion = CC.Version("[Path-To]\BuildDCP.bat");
    Set someLabels = Ver.Labels;
    If (someLabels.Count > 0) Then 
        ' the first label listed is the most recently applied
        labelID = someLabels.Item(1).Type.Name
    EndIf
    
    0 讨论(0)
  • 2020-12-04 01:14

    I really wish that the COM interfaces had better documentation, or were more obvious. Or that the code to ClearCase Explorer or Project Explorer were open source.

    I've done a few cool things, but I pretty much started by adding COM references to my C# project, and then started screwing around with the interfaces I found.

    Good luck!

    0 讨论(0)
提交回复
热议问题