@@ -153,7 +153,7 @@ func (e *Executor) compiledTask(call *Call, evaluateShVars bool) (*ast.Task, err
153153 continue
154154 }
155155 if cmd .For != nil {
156- list , keys , err := itemsFromFor (cmd .For , new .Dir , new .Sources , vars , origTask .Location , cache )
156+ list , keys , err := itemsFromFor (cmd .For , new .Dir , new .Sources , new . Generates , vars , origTask .Location , cache )
157157 if err != nil {
158158 return nil , err
159159 }
@@ -200,7 +200,7 @@ func (e *Executor) compiledTask(call *Call, evaluateShVars bool) (*ast.Task, err
200200 continue
201201 }
202202 if dep .For != nil {
203- list , keys , err := itemsFromFor (dep .For , new .Dir , new .Sources , vars , origTask .Location , cache )
203+ list , keys , err := itemsFromFor (dep .For , new .Dir , new .Sources , new . Generates , vars , origTask .Location , cache )
204204 if err != nil {
205205 return nil , err
206206 }
@@ -270,6 +270,7 @@ func itemsFromFor(
270270 f * ast.For ,
271271 dir string ,
272272 sources []* ast.Glob ,
273+ generates []* ast.Glob ,
273274 vars * ast.Vars ,
274275 location * ast.Location ,
275276 cache * templater.Cache ,
@@ -304,6 +305,20 @@ func itemsFromFor(
304305 }
305306 values = asAnySlice (glist )
306307 }
308+ // Get the list from the task generates
309+ if f .From == "generates" {
310+ glist , err := fingerprint .Globs (dir , generates )
311+ if err != nil {
312+ return nil , nil , err
313+ }
314+ // Make the paths relative to the task dir
315+ for i , v := range glist {
316+ if glist [i ], err = filepath .Rel (dir , v ); err != nil {
317+ return nil , nil , err
318+ }
319+ }
320+ values = asAnySlice (glist )
321+ }
307322 // Get the list from a variable and split it up
308323 if f .Var != "" {
309324 if vars != nil {
0 commit comments