253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
|
# File 'lib/raven/java_tasks.rb', line 253
def execute
super
classpath = Raven.build_cp(prerequisites)
classpath << "target/classes"
@build_path = ["src/main/java"] unless @build_path
puts "Executing JavaDoc using source path #{@build_path.join(' ')}" if RakeFileUtils.verbose_flag
Dir.mkdir("target") unless File.exist?("target")
Dir.mkdir("target/jdoc") unless File.exist?("target/jdoc")
packages = Set[]
@build_path.each do |d|
Dir.glob("#{d}/**/*.java").each do |java|
packages << java[(d.length + 1)..(java.rindex('/') - 1)].gsub(%r{[\\/]}, '.')
end
end
packages = packages.to_a
if (packages.size > 0)
puts "javadoc -classpath #{classpath.join(CP_SEP)} -sourcepath #{@build_path.join(CP_SEP)} -d target/jdoc #{packages.join(' ')}" if RakeFileUtils.verbose_flag
`javadoc -classpath #{classpath.join(CP_SEP)} -sourcepath #{@build_path.join(CP_SEP)} -d target/jdoc #{packages.join(' ')}`
unless $?.exitstatus == 0
puts "Javadoc failed, see above errors."
exit
end
end
end
|