1 | {↵ | | 1 | {↵
|
2 | throw new BuildException("Required attribute TypeName not specified");↵ | | 2 | throw new BuildException("Required attribute TypeValue not specified");↵
|
3 | }↵ | | 3 | }↵
|
|
4 | // Default the viewpath to basedir if it is not specified↵ | | 4 | // Default the viewpath to basedir if it is not specified↵
|
5 | if (getViewPath() == null) {↵ | | 5 | if (getViewPath() == null) {↵
|
6 | setViewPath(aProj.getBaseDir().getPath());↵ | | 6 | setViewPath(aProj.getBaseDir().getPath());↵
|
7 | }↵ | | 7 | }↵
|
|
8 | // build the command line from what we got. the format is↵ | | 8 | // build the command line from what we got. the format is↵
|
9 | // cleartool mklabel [options...] [viewpath ...]↵ | | 9 | // cleartool mkattr [options...] [viewpath ...]↵
|
10 | // as specified in the CLEARTOOL help↵ | | 10 | // as specified in the CLEARTOOL help↵
|
11 | commandLine.setExecutable(getClearToolCommand());↵ | | 11 | commandLine.setExecutable(getClearToolCommand());↵
|
12 | commandLine.createArgument().setValue(COMMAND_MKLABEL);↵ | | 12 | commandLine.createArgument().setValue(COMMAND_MKATTR);↵
|
|
13 | checkOptions(commandLine);↵ | | 13 | checkOptions(commandLine);↵
|
|
14 | if (!getFailOnErr()) {↵ | | 14 | if (!getFailOnErr()) {↵
|
15 | getProject().log("Ignoring any errors that occur for: "↵ | | 15 | getProject().log("Ignoring any errors that occur for: "↵
|
16 | + getViewPathBasename(), Project.MSG_VERBOSE);↵ | | 16 | + getViewPathBasename(), Project.MSG_VERBOSE);↵
|
17 | }↵ | | 17 | }↵
|
|
| | | 18 | // For debugging↵
|
| | | 19 | // System.out.println(commandLine.toString());↵
|
|
18 | result = run(commandLine);↵ | | 20 | result = run(commandLine);↵
|
19 | if (Execute.isFailure(result) && getFailOnErr()) {↵ | | 21 | if (Execute.isFailure(result) && getFailOnErr()) {↵
|
20 | String msg = "Failed executing: " + commandLine.toString();↵ | | 22 | String msg = "Failed executing: " + commandLine.toString();↵
|
21 | throw new BuildException(msg, getLocation());↵ | | 23 | throw new BuildException(msg, getLocation());↵
|
22 | }↵ | | 24 | }↵
|
23 | }↵ | | 25 | }↵
|
|
|
24 | /**↵ | | 26 | /**↵
|
25 | * Check the command line options.↵ | | 27 | * Check the command line options.↵
|
26 | */↵ | | 28 | */↵
|
27 | private void checkOptions(Commandline cmd) {↵ | | 29 | private void checkOptions(Commandline cmd) {↵
|
28 | if (getReplace()) {↵ | | 30 | if (getReplace()) {↵
|
29 | // -replace↵ | | 31 | // -replace↵
|
30 | cmd.createArgument().setValue(FLAG_REPLACE);↵ | | 32 | cmd.createArgument().setValue(FLAG_REPLACE);↵
|
31 | }↵ | | 33 | }↵
|
|
32 | if (getRecurse()) {↵ | | 34 | if (getRecurse()) {↵
|
33 | // -recurse↵ | | 35 | // -recurse↵
|
34 | cmd.createArgument().setValue(FLAG_RECURSE);↵ | | 36 | cmd.createArgument().setValue(FLAG_RECURSE);↵
|
35 | }↵ | | 37 | }↵
|
|
36 | if (getVersion() != null) {↵ | | 38 | if (getVersion() != null) {↵
|
37 | // -version↵ | | 39 | // -version↵
|
38 | getVersionCommand(cmd);↵ | | 40 | getVersionCommand(cmd);↵
|
39 | }↵ | | 41 | }↵
|
|
40 | if (getComment() != null) {↵ | | 42 | if (getComment() != null) {↵
|
41 | // -c↵ | | 43 | // -c↵
|
42 | getCommentCommand(cmd);↵ | | 44 | getCommentCommand(cmd);↵
|
43 | } else {↵ | | 45 | } else {↵
|
44 | if (getCommentFile() != null) {↵ | | 46 | if (getCommentFile() != null) {↵
|
45 | // -cfile↵ | | 47 | // -cfile↵
|
46 | getCommentFileCommand(cmd);↵ | | 48 | getCommentFileCommand(cmd);↵
|
47 | } else {↵ | | 49 | } else {↵
|
48 | cmd.createArgument().setValue(FLAG_NOCOMMENT);↵ | | 50 | cmd.createArgument().setValue(FLAG_NOCOMMENT);↵
|
49 | }↵ | | 51 | }↵
|
50 | }↵ | | 52 | }↵
|
|
51 | if (getTypeName() != null) {↵ | | 53 | if (getTypeName() != null) {↵
|
52 | // type↵ | | 54 | // type↵
|
53 | getTypeCommand(cmd);↵ | | 55 | getTypeCommand(cmd);↵
|
54 | | | 56 |
|