From 8c4fb2c5085aaf4319c557a0393318be4e10711b Mon Sep 17 00:00:00 2001 From: Alberto97 Date: Sat, 5 May 2018 23:01:02 +0300 Subject: Add deviceclean for minimal cleaning AICPfied: add our Changelog to the mix Change-Id: I4e56531a039c4f6da3fd596dac02743b9d1f1932 --- ui/build/build.go | 4 ++++ ui/build/cleanbuild.go | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+) 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..42c042dfb 100644 --- a/ui/build/cleanbuild.go +++ b/ui/build/cleanbuild.go @@ -54,6 +54,31 @@ 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("recovery"), + productOut("root"), + 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 -- cgit v1.2.3 From 0b0a8eec68cb5473d2c6d5d426ae5d92bf4dcc9f Mon Sep 17 00:00:00 2001 From: Ali B Date: Sun, 27 Oct 2019 18:26:23 +0300 Subject: soong: enhance deviceclean scope Change-Id: I266e615566b7dc47454899924e615f29320276fe --- ui/build/cleanbuild.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/build/cleanbuild.go b/ui/build/cleanbuild.go index 42c042dfb..a323818d8 100644 --- a/ui/build/cleanbuild.go +++ b/ui/build/cleanbuild.go @@ -70,8 +70,10 @@ func deviceClean(ctx Context, config Config, what int) { productOut("android-info.txt"), productOut("Changelog.txt"), productOut("kernel"), + productOut("ramdisk"), productOut("recovery"), productOut("root"), + productOut("symbols"), productOut("system"), productOut("system_other"), productOut("vendor")) -- cgit v1.2.3