Force execution of one task before others are even evaluated?


(Steve Cohen) #1

I have a situation where I want to force one ‘preliminary’ task to EXECUTE before others are even evaluated. This task will look at command-line properties and also Exec uname. The properties passed in and the results of uname will set the parameters for the rest of the build. But this doesn’t work because Gradle evaluates all tasks before executing any.

How may I get around this restriction?


(Steve Cohen) #2

Since I’m using a plugin add a project extension class and do the configuration in its constructor.


(Dimitar Dimitrov) #3

Would kicking a Gradle sub-build be an option?


(Steve Cohen) #4

Thanks, but see my solution above.