Allow Bazel to write to an external DIST_DIR (outside of OUT_DIR).

Also get Bazel to write real files there (not symlinks) so that the DIST_DIR can be independent.

Test: Manually using e.g. DIST_DIR=/tmp/foo USE_BAZEL=1 m dist
Change-Id: I39d5219500864c9ecc85f356a028e9b5bf2607f4
This commit is contained in:
Rupert Shuttleworth
2020-12-10 11:32:38 +00:00
parent 62bd802826
commit 3c9f5ac787
6 changed files with 138 additions and 34 deletions

View File

@@ -302,7 +302,7 @@ func distGzipFile(ctx Context, config Config, src string, subDirs ...string) {
}
subDir := filepath.Join(subDirs...)
destDir := filepath.Join(config.DistDir(), "soong_ui", subDir)
destDir := filepath.Join(config.RealDistDir(), "soong_ui", subDir)
if err := os.MkdirAll(destDir, 0777); err != nil { // a+rwx
ctx.Printf("failed to mkdir %s: %s", destDir, err.Error())
@@ -321,7 +321,7 @@ func distFile(ctx Context, config Config, src string, subDirs ...string) {
}
subDir := filepath.Join(subDirs...)
destDir := filepath.Join(config.DistDir(), "soong_ui", subDir)
destDir := filepath.Join(config.RealDistDir(), "soong_ui", subDir)
if err := os.MkdirAll(destDir, 0777); err != nil { // a+rwx
ctx.Printf("failed to mkdir %s: %s", destDir, err.Error())