nchammas commented on code in PR #44791: URL: https://github.com/apache/spark/pull/44791#discussion_r1459233153
########## docs/_plugins/build_api_docs.rb: ########## @@ -0,0 +1,205 @@ +# +# 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. +# + +# This include enables functions like `cd` and `cp_r`. +require 'fileutils' +include FileUtils + +THIS_DIR = File.dirname(__FILE__) +SPARK_PROJECT_ROOT = File.expand_path(THIS_DIR + "/../..") +$spark_package_is_built = false + +def print_header(text) + banner = "* #{text} *" + banner_bar = "*" * banner.size + + puts "" + puts banner_bar + puts banner + puts banner_bar +end + +def build_scala_and_java_docs + print_header "Building Scala and Java API docs." + cd(SPARK_PROJECT_ROOT) + + command = "build/sbt -Pkinesis-asl clean compile unidoc" Review Comment: When we build both the Scala docs as well as either the Python or SQL docs, we end up building Spark twice. In a follow-up improvement, I think it would make sense to build Spark just once if any of the Scala, Python, or SQL docs are requested: ```sh ./build/sbt -Pkinesis-asl -Phive clean package ``` Then, if Scala docs are specifically also requested, we just build the `unidoc`: ```sh ./build/sbt -Pkinesis-asl -Phive unidoc ``` This should save us around 2 minutes on the complete documentation build. For now, I'm leaving it like this since that's the current behavior. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
