diff options
| -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 8f050d9be..052b40012 100644 --- a/ui/build/build.go +++ b/ui/build/build.go @@ -265,6 +265,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 bbec78d2e..4856c1982 100644 --- a/ui/build/cleanbuild.go +++ b/ui/build/cleanbuild.go @@ -59,6 +59,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 |
