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 ( project.getExecutionProject() != null )
95 {
96 if ( !"pom".equals( project.getExecutionProject().getPackaging().toLowerCase() ) )
97 {
98 l.addAll( project.getExecutionProject().getTestCompileSourceRoots() );
99 }
100 }
101
102 return l;
103 }
104
105
106
107
108 protected String getDestinationDirectory()
109 {
110 return destDir;
111 }
112
113
114
115
116 public String getDescription( Locale locale )
117 {
118 return getBundle( locale ).getString( "report.xref.test.description" );
119 }
120
121
122
123
124 public String getName( Locale locale )
125 {
126 return getBundle( locale ).getString( "report.xref.test.name" );
127 }
128
129
130
131
132 public String getOutputName()
133 {
134 return "xref-test/index";
135 }
136
137
138
139
140 protected File getJavadocDir()
141 {
142 return testJavadocDir;
143 }
144
145
146
147
148 public void setReportOutputDirectory( File reportOutputDirectory )
149 {
150 if ( ( reportOutputDirectory != null ) && ( !reportOutputDirectory.getAbsolutePath().endsWith( "xref-test" ) ) )
151 {
152 this.destDir = new File( reportOutputDirectory, "xref-test" ).getAbsolutePath();
153 }
154 else
155 {
156 this.destDir = reportOutputDirectory.getAbsolutePath();
157 }
158 }
159 }