How do I reuse task configuration in Gradle? -
i have task war configuration many from/include/exclude
:
task war { exclude exclude ... ... ... ... ... }
i have task war configuration same except 1 exclude
. don't want duplicate configurations. how can reuse first configuration?
try:
ext.sharedcopyconf = { task, -> configure(task) { 'a' } } task copy1(type: copy) { t -> sharedcopyconf(t, 'b') } task copy2(type: copy) { t -> sharedcopyconf(t, 'c') }
have @ demo.
Comments
Post a Comment