Create copy task inside model{} block

I am new to gradle and trying to create a copy task within the new model block. Is this possible and what would the correct syntax be?

build.gradle
model {
task xyz{} //does not work
task ‘xyz’(type:Copy){} //does not work
}

It produces the following error
Rule must follow the pattern ‘«name»(«type») {}’ for a creator, and ‘«name» {}’ for an action

Looks like this:

model {
    tasks {
        myCopyTask(Copy) {
            from 'foo'
            into 'bar'
        }
    }
}
1 Like

Thanks Mark!

Learning the syntax takes a little time but with help from you guys it will be much easier

Can you share your build script?