Pass Variable from dependee task to depender task

I am creating 2 flavours of distributions which depends on war task, but I want to send a variable from the distributions task to war task to decide to either keep one file as is or copy from some other folder, depending on that flag. Is there any way that can be done? My current configuration is as follows. Currently, if I am setting the variable like this, it is getting set at configuration time and then the value is not changing according to each distribution flavour.
distributions {
console {
isServer = false //Something which can achieve this
consoleDistZip.archiveBaseName = project.name+"-console"
contents {
into (‘libs’) {
from ‘build/dist/binaries’
include ‘/*’
}
}
}
server {
isServer = true //Something which can achieve this
serverDistZip.archiveBaseName = project.name
contents {
project.delete (‘build/dist/temp/Debug.jsp’)
into (’/’) {
from ‘build/dist/binaries’
include '
/*’
include ‘WEB-INF/web.xml’
}
}
}
}

war {
version = project.hasProperty(‘artifactVersion’) ? artifactVersion : version
doFirst {
if(isServer) {do something extra}
manifest {
attributes(“Implementation-Title”: project.name, “Implementation-Version”: version, “Implementation-Timestamp”: new Date())
}
from ‘build/dist/temp’
include ‘**/*’
archiveName = “${project.name}-${version}.war”
destinationDir = file(‘build/dist/binaries/’)
}
}

serverDistZip.dependsOn war
consoleDistZip.dependsOn war