Gradle assemble command is calling the run task


(tanubatheja) #1

gradle assemble in gradle task option in eclips is internally calling the run task.
in gradle.build, I have mentioned below task

run {
args “${argv1}”
args “${argv2}”
systemProperties[‘app.configuration’] = ‘app.properties’
systemProperties[‘rfa.configuration’] = ‘rfa.properties’
systemProperties[‘log4j.debug’] = ‘true’
systemProperties[‘log4j.configuration’] = ‘file:log4j.properties’
systemProperties[‘DDDEBUG’]
}
assemble task is expecting the arguments. But for assemble why it is expecting the program arguments.

Is there any other way to define the system.properties using the gradle configuration
I know program argument can be passed -Pargv1=NIP -Pargv2=EUROPE like this in the program arguments.


(Chris Doré) #2

args "${argv1} is executed by Gradle during its configuration phase, not when the run task is executed.

You could do:

run {
    if( project.hasProperty( 'argv1' ) ) {
        args "${argv1}"
    }
    ...
}