Merge "don't touch bp2build_workspace_marker
file if it exists"
This commit is contained in:
committed by
Gerrit Code Review
commit
39f17ad8b8
@@ -519,6 +519,12 @@ func touch(path string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func touchIfDoesNotExist(path string) {
|
||||||
|
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||||
|
touch(path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Find BUILD files in the srcDir which are not in the allowlist
|
// Find BUILD files in the srcDir which are not in the allowlist
|
||||||
// (android.Bp2BuildConversionAllowlist#ShouldKeepExistingBuildFileForDir)
|
// (android.Bp2BuildConversionAllowlist#ShouldKeepExistingBuildFileForDir)
|
||||||
// and return their paths so they can be left out of the Bazel workspace dir (i.e. ignored)
|
// and return their paths so they can be left out of the Bazel workspace dir (i.e. ignored)
|
||||||
@@ -674,8 +680,9 @@ func runBp2Build(configuration android.Config, extraNinjaDeps []string) {
|
|||||||
|
|
||||||
writeDepFile(bp2buildMarker, eventHandler, ninjaDeps)
|
writeDepFile(bp2buildMarker, eventHandler, ninjaDeps)
|
||||||
|
|
||||||
// Create an empty bp2build marker file.
|
// Create an empty bp2build marker file, if it does not already exist.
|
||||||
touch(shared.JoinPath(topDir, bp2buildMarker))
|
// Note the relevant rule has `restat = true`
|
||||||
|
touchIfDoesNotExist(shared.JoinPath(topDir, bp2buildMarker))
|
||||||
})
|
})
|
||||||
|
|
||||||
// Only report metrics when in bp2build mode. The metrics aren't relevant
|
// Only report metrics when in bp2build mode. The metrics aren't relevant
|
||||||
|
Reference in New Issue
Block a user