Only check copy rules into the snapshot directory
Test: m nothing Change-Id: I6d9ab5a9f003193c5791a4ee6d3ee35730ddf96c
This commit is contained in:
@@ -188,15 +188,20 @@ func (r *testSdkResult) getSdkSnapshotBuildInfo(sdk *sdk) *snapshotBuildInfo {
|
|||||||
|
|
||||||
buildParams := sdk.BuildParamsForTests()
|
buildParams := sdk.BuildParamsForTests()
|
||||||
copyRules := &strings.Builder{}
|
copyRules := &strings.Builder{}
|
||||||
|
snapshotDirPrefix := sdk.builderForTests.snapshotDir.String() + "/"
|
||||||
for _, bp := range buildParams {
|
for _, bp := range buildParams {
|
||||||
switch bp.Rule.String() {
|
switch bp.Rule.String() {
|
||||||
case android.Cp.String():
|
case android.Cp.String():
|
||||||
|
output := bp.Output
|
||||||
|
// Only check copies into the snapshot directory.
|
||||||
|
if strings.HasPrefix(output.String(), snapshotDirPrefix) {
|
||||||
// Get source relative to build directory.
|
// Get source relative to build directory.
|
||||||
src := android.NormalizePathForTesting(bp.Input)
|
src := android.NormalizePathForTesting(bp.Input)
|
||||||
// Get destination relative to the snapshot root
|
// Get destination relative to the snapshot root
|
||||||
dest := bp.Output.Rel()
|
dest := output.Rel()
|
||||||
_, _ = fmt.Fprintf(copyRules, "%s -> %s\n", src, dest)
|
_, _ = fmt.Fprintf(copyRules, "%s -> %s\n", src, dest)
|
||||||
info.snapshotContents = append(info.snapshotContents, dest)
|
info.snapshotContents = append(info.snapshotContents, dest)
|
||||||
|
}
|
||||||
|
|
||||||
case repackageZip.String():
|
case repackageZip.String():
|
||||||
// Add the destdir to the snapshot contents as that is effectively where
|
// Add the destdir to the snapshot contents as that is effectively where
|
||||||
|
Reference in New Issue
Block a user