2013-07-16 20:21:33 -04:00
|
|
|
#
|
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership.
|
|
|
|
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
# (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
|
2012-09-13 19:52:53 -04:00
|
|
|
require 'fileutils'
|
|
|
|
include FileUtils
|
|
|
|
|
2013-08-21 15:57:56 -04:00
|
|
|
if not (ENV['SKIP_API'] == '1' or ENV['SKIP_SCALADOC'] == '1')
|
2013-02-25 16:15:12 -05:00
|
|
|
# Build Scaladoc for Java/Scala
|
2013-08-11 22:02:43 -04:00
|
|
|
projects = ["core", "examples", "repl", "bagel", "streaming", "mllib"]
|
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|
|
2013-05-16 19:51:28 -04:00
|
|
|
source = "../" + project_name + "/target/scala-2.9.3/api"
|
2012-09-25 18:46:18 -04:00
|
|
|
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-12-27 20:55:33 -05:00
|
|
|
|
2013-02-25 16:15:12 -05:00
|
|
|
# Build Epydoc for Python
|
2013-01-01 17:48:45 -05:00
|
|
|
puts "Moving to python directory and building epydoc."
|
|
|
|
cd("../python")
|
2012-12-27 20:55:33 -05:00
|
|
|
puts `epydoc --config epydoc.conf`
|
|
|
|
|
|
|
|
puts "Moving back into docs dir."
|
|
|
|
cd("../docs")
|
|
|
|
|
|
|
|
puts "echo making directory pyspark"
|
|
|
|
mkdir_p "pyspark"
|
|
|
|
|
2013-01-01 17:48:45 -05:00
|
|
|
puts "cp -r ../python/docs/. api/pyspark"
|
|
|
|
cp_r("../python/docs/.", "api/pyspark")
|
2012-12-27 20:55:33 -05:00
|
|
|
|
|
|
|
cd("..")
|
|
|
|
end
|