diff options
| author | Alberto97 <albertop2197@gmail.com> | 2018-05-05 22:01:02 +0200 |
|---|---|---|
| committer | George Zacharia <george.zcharia@gmail.com> | 2024-04-28 11:24:36 +0530 |
| commit | 57f10d6532a7026fd7956965ad6f09c668016ed2 (patch) | |
| tree | 932c3d6487a199e3dfc0659977c66ef091d0f5be | |
| parent | 42d459b7c0b43ba7d5a3e58e439e3c31ac8b34aa (diff) | |
Add deviceclean for minimal cleaning
[msfjarvis: Simplify]
Change-Id: I4e56531a039c4f6da3fd596dac02743b9d1f1932
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
| -rw-r--r-- | ui/build/build.go | 4 | ||||
| -rw-r--r-- | ui/build/cleanbuild.go | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/ui/build/build.go b/ui/build/build.go index 9a9eccd7d..733f90c2a 100644 --- a/ui/build/build.go +++ b/ui/build/build.go @@ -301,6 +301,10 @@ func Build(ctx Context, config Config) { dataClean(ctx, config) 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&RunSoong != 0 { diff --git a/ui/build/cleanbuild.go b/ui/build/cleanbuild.go index e3bf1b438..4b346ce06 100644 --- a/ui/build/cleanbuild.go +++ b/ui/build/cleanbuild.go @@ -71,6 +71,13 @@ func dataClean(ctx Context, config Config) { ctx.Println("Entire data directory removed.") } +// Remove everything relevant for a clean ota package +func deviceClean(ctx Context, config Config, what int) { + productOutPath := config.ProductOut() + removeGlobs(ctx, productOutPath) + ctx.Println(productOutPath, "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 |
