You need to use `directory` like you use `task`, and then make the directory name a dependency of the `task`s that need it.