@@ -29,7 +29,6 @@ import("core.platform.platform")
2929import (" private.action.clean.remove_files" )
3030import (" target.action.clean" , {alias = " _do_clean_target" })
3131import (" private.service.remote_build.action" , {alias = " remote_build_action" })
32- import (" private.detect.check_targetnames" )
3332import (" private.action.utils" , {alias = " action_utils" })
3433
3534-- on clean target
@@ -105,10 +104,11 @@ function _clean_targets(targets)
105104end
106105
107106-- clean targets
108- function _clean (targetnames )
109- if targetnames and # targetnames > 0 then
110- _clean_targets (assert ( check_targetnames ( targetnames ) ))
107+ function _clean (targetnames , group_pattern )
108+ if ( targetnames and # targetnames > 0 ) or group_pattern then
109+ _clean_targets (action_utils . get_targets ( targetnames , { group_pattern = group_pattern } ))
111110 else
111+ -- clean all targets by default
112112 _clean_targets (project .ordertargets ())
113113 end
114114end
@@ -163,14 +163,14 @@ function main()
163163 -- lock the whole project
164164 project .lock ()
165165
166- -- get the target names
167- local targetnames = action_utils .get_targets_and_group ()
166+ -- get the target names and group pattern
167+ local targetnames , group_pattern = action_utils .get_targets_and_group ()
168168
169169 -- enter project directory
170170 local oldir = os .cd (project .directory ())
171171
172172 -- clean targets
173- _clean (targetnames )
173+ _clean (targetnames , group_pattern )
174174
175175 -- unlock the whole project
176176 project .unlock ()
0 commit comments