From d7cb755e739c50c2cfab9ee582f1c4dc4bed24e7 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Mon, 24 Oct 2016 11:48:18 +0900 Subject: [PATCH] Bazel: Remove output directories before extracting jars for javadoc On MacOS the output directories are persisted, which causes errors when attempting to create them again on subsequent runs. Explicitly remove the directories before (re)creating them. Change-Id: Icccd06ae538f72788196c07006f42c48b9d47174 --- tools/bzl/javadoc.bzl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/bzl/javadoc.bzl b/tools/bzl/javadoc.bzl index c9ff05d21a..c479e2cb13 100644 --- a/tools/bzl/javadoc.bzl +++ b/tools/bzl/javadoc.bzl @@ -27,8 +27,10 @@ def _impl(ctx): dir = ctx.outputs.zip.path + ".dir" source = ctx.outputs.zip.path + ".source" cmd = [ + "rm -rf %s" % source, "mkdir %s" % source, " && ".join(["unzip -qud %s %s" % (source, j.path) for j in source_jars]), + "rm -rf %s" % dir, "mkdir %s" % dir, " ".join([ ctx.file._javadoc.path,