2012-09-13 19:52:53 -04:00
|
|
|
require 'fileutils'
|
|
|
|
include FileUtils
|
|
|
|
|
2012-09-25 18:46:18 -04:00
|
|
|
if ENV['SKIP_SCALADOC'] != '1'
|
2012-12-29 21:31:51 -05:00
|
|
|
projects = ["core", "examples", "repl", "bagel", "streaming"]
|
2012-09-13 19:52:53 -04:00
|
|
|
|
2012-09-25 18:46:18 -04:00
|
|
|
puts "Moving to project root and building scaladoc."
|
|
|
|
curr_dir = pwd
|
|
|
|
cd("..")
|
2012-09-13 19:52:53 -04:00
|
|
|
|
2012-09-25 18:46:18 -04:00
|
|
|
puts "Running sbt/sbt doc from " + pwd + "; this may take a few minutes..."
|
|
|
|
puts `sbt/sbt doc`
|
2012-09-13 19:52:53 -04:00
|
|
|
|
2012-12-29 21:31:51 -05:00
|
|
|
puts "Moving back into docs dir."
|
2012-09-25 18:46:18 -04:00
|
|
|
cd("docs")
|
2012-09-13 19:52:53 -04:00
|
|
|
|
2012-09-25 18:46:18 -04:00
|
|
|
# Copy over the scaladoc from each project into the docs directory.
|
|
|
|
# This directory will be copied over to _site when `jekyll` command is run.
|
|
|
|
projects.each do |project_name|
|
|
|
|
source = "../" + project_name + "/target/scala-2.9.2/api"
|
|
|
|
dest = "api/" + project_name
|
2012-09-13 19:52:53 -04:00
|
|
|
|
2012-09-25 18:46:18 -04:00
|
|
|
puts "echo making directory " + dest
|
|
|
|
mkdir_p dest
|
2012-09-13 19:52:53 -04:00
|
|
|
|
2012-09-25 18:46:18 -04:00
|
|
|
# From the rubydoc: cp_r('src', 'dest') makes src/dest, but this doesn't.
|
|
|
|
puts "cp -r " + source + "/. " + dest
|
|
|
|
cp_r(source + "/.", dest)
|
|
|
|
end
|
2012-09-13 19:52:53 -04:00
|
|
|
end
|