I'm writing a program that automates some frequently used actions in my development area,
this tasks involve running cleartool commands from a shell script (by java runtime).
is there any documentation to cleartool/clearcase commands error messages/exit values and causes? i would like to parse the process output and handle issues/return a response based on that.
is there an easier way to combine java and clearcase than executing shell scripts from the java runtime ? i could not find any clearcase packages for java that actually does the work...
P.S
im only running basic commands... checkout,checkin,make view, make activity, etc' and am using clearcase UCM.
Thanks!
The official cleartool
documentation is on ibm.com:
cleartool
ClearCase 7.x
- For ClearCase 7.1.x/7.2, you have a Java API (the Change Management API (CM API)).
As mentioned in the cleartool
page, in interactive mode, cleartool -status
returns the status (0 or 1) of each cleartool
subcommand executed.
So in non-interactive mode:
The exit status from single-command mode depends on whether the command succeeded (zero exit status) or generated an error message (nonzero exit status).
But if you want to see other API examples, most Build Schedulers have a ClearCase API, like Jenkins: see for instance "simpleclearcase/ClearTool.java
" in the SimpleClearCase-Plugin.
See an example of "exit status catching" in Java at simpleclearcase/ClearTool.java#L381-L386
Note that changes with ClearCase 8.X (ClearTeam), which has a CCRC (ClearCase Remote Client) API rcleartool