1 |
|
package org.apache.torque.mojo; |
2 |
|
|
3 |
|
import org.apache.maven.plugin.MojoExecutionException; |
4 |
|
import org.apache.tools.ant.Project; |
5 |
|
import org.apache.tools.ant.Task; |
6 |
|
import org.apache.torque.util.MojoAntBuildListener; |
7 |
|
import org.kuali.core.db.torque.FilteredPropertyCopier; |
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
|
|
| 0% |
Uncovered Elements: 29 (29) |
Complexity: 9 |
Complexity Density: 0.45 |
|
12 |
|
public class AntTaskMojo extends BaseMojo { |
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
private Task antTask; |
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
private Project antProject; |
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 3 |
Complexity Density: 0.33 |
|
27 |
0
|
protected void configureTask() throws MojoExecutionException {... |
28 |
0
|
if (getAntTask() == null) { |
29 |
0
|
throw new IllegalArgumentException("Ant task is null"); |
30 |
|
} |
31 |
|
|
32 |
|
|
33 |
0
|
setAntProject(getIniatializedAntProject()); |
34 |
0
|
getAntTask().setProject(getAntProject()); |
35 |
0
|
try { |
36 |
|
|
37 |
0
|
FilteredPropertyCopier copier = new FilteredPropertyCopier(); |
38 |
|
|
39 |
|
|
40 |
0
|
copier.addExclude("project"); |
41 |
0
|
copier.copyProperties(getAntTask(), this); |
42 |
|
} catch (Exception e) { |
43 |
0
|
throw new MojoExecutionException("Error copying properties", e); |
44 |
|
} |
45 |
|
} |
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
50 |
0
|
public void executeMojo() throws MojoExecutionException {... |
51 |
0
|
configureTask(); |
52 |
0
|
getAntTask().execute(); |
53 |
|
} |
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
58 |
0
|
protected Project getIniatializedAntProject() {... |
59 |
0
|
getLog().info("Initializing the Ant Project"); |
60 |
|
|
61 |
0
|
Project antProject = new Project(); |
62 |
|
|
63 |
0
|
antProject.init(); |
64 |
|
|
65 |
0
|
antProject.addBuildListener(new MojoAntBuildListener(getLog())); |
66 |
|
|
67 |
0
|
return antProject; |
68 |
|
} |
69 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
70 |
0
|
public Project getAntProject() {... |
71 |
0
|
return antProject; |
72 |
|
} |
73 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
74 |
0
|
public void setAntProject(Project antProject) {... |
75 |
0
|
this.antProject = antProject; |
76 |
|
} |
77 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
78 |
0
|
public Task getAntTask() {... |
79 |
0
|
return antTask; |
80 |
|
} |
81 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
82 |
0
|
public void setAntTask(Task antTask) {... |
83 |
0
|
this.antTask = antTask; |
84 |
|
} |
85 |
|
} |