1 | public void execute() throws BuildException {↵ | | 1 | public void execute() throws BuildException {↵
|
2 | Commandline commandLine = new Commandline();↵ | | 2 | Commandline commandLine = new Commandline();↵
|
3 | Project aProj = getProject();↵ | | 3 | Project aProj = getProject();↵
|
4 | int result = 0;↵ | | 4 | int result = 0;↵
|
|
5 | // Default the viewpath to basedir if it is not specified↵ | | 5 | // Default the viewpath to basedir if it is not specified↵
|
6 | if (getViewPath() == null) {↵ | | 6 | if (getViewPath() == null) {↵
|
7 | setViewPath(aProj.getBaseDir().getPath());↵ | | 7 | setViewPath(aProj.getBaseDir().getPath());↵
|
8 | }↵ | | 8 | }↵
|
|
9 | // build the command line from what we got. the format is↵ | | 9 | // build the command line from what we got the format is↵
|
10 | // cleartool mkelem [options...] [viewpath ...]↵ | | 10 | // cleartool lock [options...]↵
|
11 | // as specified in the CLEARTOOL.EXE help↵ | | 11 | // as specified in the CLEARTOOL.EXE help↵
|
12 | commandLine.setExecutable(getClearToolCommand());↵ | | 12 | commandLine.setExecutable(getClearToolCommand());↵
|
13 | commandLine.createArgument().setValue(COMMAND_MKDIR);↵ | | 13 | commandLine.createArgument().setValue(COMMAND_UNLOCK);↵
|
|
14 | checkOptions(commandLine↵ | | 14 | // Check the command line options↵
|
| | | 15 | checkOptions(commandLine);↵
|
|
| | | 16 | // For debugging↵
|
15 | );↵ | | 17 | // System.out.println(commandLine.toString());↵
|
|
16 | if (!getFailOnErr()) {↵ | | 18 | if (!getFailOnErr()) {↵
|
17 | getProject().log("Ignoring any errors that occur for: "↵ | | 19 | getProject().log("Ignoring any errors that occur for: "↵
|
18 | + getViewPathBasename(), Project.MSG_VERBOSE);↵ | | 20 | + getOpType(), Project.MSG_VERBOSE);↵
|
19 | }↵ | | 21 | }↵
|
20 | result = run(commandLine);↵ | | 22 | result = run(commandLine);↵
|
21 | if (Execute.isFailure(result) && getFailOnErr()) {↵ | | 23 | if (Execute.isFailure(result) && getFailOnErr()) {↵
|
22 | String msg = "Failed executing: " + commandLine.toString();↵ | | 24 | String msg = "Failed executing: " + commandLine.toString();↵
|
23 | throw new BuildException(msg, getLocation());↵ | | 25 | throw new BuildException(msg, getLocation());↵
|
24 | | | 26 |
|