diff options
| author | Ali B <abittin@gmail.com> | 2020-12-07 11:03:20 +0100 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@box1> | 2020-12-07 11:03:20 +0100 |
| commit | f393bf3240ee08c2405c082729ad06017ac7a37f (patch) | |
| tree | 54b5346fdb366edefacd3cf8346812949c7a7155 | |
| parent | 43bc3d6c4f59fdc9fcdb60459d5eee21f5bf4923 (diff) | |
| parent | 0b0a8eec68cb5473d2c6d5d426ae5d92bf4dcc9f (diff) | |
Merge changes I266e6155,I4e56531a into r11.0r11.0
* changes:
soong: enhance deviceclean scope
Add deviceclean for minimal cleaning
| -rw-r--r-- | ui/build/build.go | 4 | ||||
| -rw-r--r-- | ui/build/cleanbuild.go | 27 |
2 files changed, 31 insertions, 0 deletions
diff --git a/ui/build/build.go b/ui/build/build.go index 349a7de5e..790a5c973 100644 --- a/ui/build/build.go +++ b/ui/build/build.go @@ -218,6 +218,10 @@ func Build(ctx Context, config Config, what int) { dataClean(ctx, config, what) ctx.Println("Deleted data files.") return + } else if inList("deviceclean", config.Arguments()) { + deviceClean(ctx, config, what) + ctx.Println("Performed minimal product cleaning.") + return } if what&BuildSoong != 0 { diff --git a/ui/build/cleanbuild.go b/ui/build/cleanbuild.go index 9df3ac0ef..a323818d8 100644 --- a/ui/build/cleanbuild.go +++ b/ui/build/cleanbuild.go @@ -54,6 +54,33 @@ func dataClean(ctx Context, config Config, what int) { removeGlobs(ctx, filepath.Join(config.ProductOut(), "data", "*")) } +// Remove everything relevant for a clean ota package +func deviceClean(ctx Context, config Config, what int) { + + productOutPath := config.ProductOut() + productOut := func(path string) string { + return filepath.Join(productOutPath, path) + } + + removeGlobs(ctx, + productOut("*.cpio"), + productOut("*.img"), + productOut("*.zip"), + productOut("*.zip.md5sum"), + productOut("android-info.txt"), + productOut("Changelog.txt"), + productOut("kernel"), + productOut("ramdisk"), + productOut("recovery"), + productOut("root"), + productOut("symbols"), + productOut("system"), + productOut("system_other"), + productOut("vendor")) + + ctx.Println("Device specific stuff removed.") +} + // installClean deletes all of the installed files -- the intent is to remove // files that may no longer be installed, either because the user previously // installed them, or they were previously installed by default but no longer |
