1 package org.apache.maven.plugin.jxr;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.maven.project.MavenProject;
23
24 import java.io.File;
25 import java.util.ArrayList;
26 import java.util.List;
27 import java.util.Locale;
28
29
30
31
32
33
34
35
36
37
38 public class JxrTestReport
39 extends AbstractJxrReport
40 {
41
42
43
44
45
46
47
48 private List sourceDirs;
49
50
51
52
53
54
55 private String destDir;
56
57
58
59
60
61
62 private File testJavadocDir;
63
64
65
66
67 protected List getSourceRoots()
68 {
69 List l = new ArrayList();
70
71 if ( !"pom".equals( getProject().getPackaging().toLowerCase() ) )
72 {
73 l.addAll( sourceDirs );
74 }
75
76 if ( getProject().getExecutionProject() != null )
77 {
78 if ( !"pom".equals( getProject().getExecutionProject().getPackaging().toLowerCase() ) )
79 {
80 l.addAll( getProject().getExecutionProject().getTestCompileSourceRoots() );
81 }
82 }
83
84 return l;
85 }
86
87
88
89
90 protected List getSourceRoots( MavenProject project )
91 {
92 List l = new ArrayList();
93
94 if ( !"pom".equals( project.getPackaging().toLowerCase() ) )
95 {
96 l.addAll( project.getExecutionProject().getTestCompileSourceRoots() );
97 }
98
99 if ( project.getExecutionProject() != null )
100 {
101 if ( !"pom".equals( project.getExecutionProject().getPackaging().toLowerCase() ) )
102 {
103 l.addAll( project.getExecutionProject().getTestCompileSourceRoots() );
104 }
105 }
106
107 return l;
108 }
109
110
111
112
113 protected String getDestinationDirectory()
114 {
115 return destDir;
116 }
117
118
119
120
121 public String getDescription( Locale locale )
122 {
123 return getBundle( locale ).getString( "report.xref.test.description" );
124 }
125
126
127
128
129 public String getName( Locale locale )
130 {
131 return getBundle( locale ).getString( "report.xref.test.name" );
132 }
133
134
135
136
137 public String getOutputName()
138 {
139 return "xref-test/index";
140 }
141
142
143
144
145 protected File getJavadocDir()
146 {
147 return testJavadocDir;
148 }
149
150
151
152
153 public void setReportOutputDirectory( File reportOutputDirectory )
154 {
155 if ( ( reportOutputDirectory != null ) && ( !reportOutputDirectory.getAbsolutePath().endsWith( "xref-test" ) ) )
156 {
157 this.destDir = new File( reportOutputDirectory, "xref-test" ).getAbsolutePath();
158 }
159 else
160 {
161 this.destDir = reportOutputDirectory.getAbsolutePath();
162 }
163 }
164 }