Parthasarathy K
Parthasarathy K

Reputation: 131

Gradle calling a task multiple times

I am using gradlefx to generate swf file from mxml and actionscript files. I have a project in which there are four mxml files and each file will output a swf file. My build.gradle file is as follows:

apply plugin: 'gradlefx'
type = 'swf'
mainClass = ''
output = ''


task setABC << {
    println 'setABC'
    mainClass = 'ABC'
    output = './../swf/ABC'
}

task setDEF << {
    println 'setDEF'
    mainClass = 'DEF'
    output = './../swf/DEF'
}


task execABC << {
    println 'execABC========================'
    clean.execute()
    beforeSet.execute()
    setABC.execute()
    afterSet.execute()
    compileFlex.execute()
}

task execDEF << {
    println 'execDEF========================'
    clean.execute()
    beforeSet.execute()
    setDEF.execute()
    afterSet.execute()
    compileFlex.execute()
}

task beforeSet << {
    println 'beforeSet ---------------'
    println "mainClass : ${mainClass}"
    println "output : ${output}"
}

task afterSet << {
    println 'afterSet ---------------'
    println "mainClass : ${mainClass}"
    println "output : ${output}"
}

In the run configuration am calling task 'execABC' and 'execDEF'. However the task under these tasks are called only once. Is there any workaround so as to generate multiple swf files from one build.gradle file.

Upvotes: 1

Views: 314

Answers (0)

Related Questions