Support to build Dokka from source
Now Dokka will be built from source when the BUILD_DOKKA environment variable is nonempty
Bug: 148450617
Test: BUILD_DOKKA=true ./gradlew dokkaJavaTipOfTreeDocs
Test: BUILD_DOKKA=true ./devlopment/validateRefactor.sh HEAD^ # and see that the only listed change is in out/buildSrc/build/pluginUnderTestMetadata/plugin-under-test-metadata.properties , not in any html files
Change-Id: I70cefc927e32e9de9b13c29067035144e29b821a
diff --git a/buildSrc/local_dokka.gradle b/buildSrc/local_dokka.gradle
new file mode 100644
index 0000000..5dfe19a
--- /dev/null
+++ b/buildSrc/local_dokka.gradle
@@ -0,0 +1,23 @@
+/*
+ * Copyright 2020 The Android Open Source Project
+ *
+ * Licensed 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.
+ */
+
+if (System.getenv("BUILD_DOKKA") != null) {
+ project.exec {
+ workingDir "${supportRootFolder}/../../external/dokka"
+ commandLine "./gradlew", "publish"
+ }
+ println("\nUSING LOCALLY-BUILT DOKKA\n")
+}