Is it possible to access task command line options before task execution?


(Igor Melnichenko) #1

Before Gradle 4.6, I was using system properties to configure my task. The task accessed the properties’ values in the project.afterEvaluate block.

After migration to Gradle 4.6, I decided to replace system properties (somewhat ugly workaround for my purpose) with command line options (exactly what I need!) but I didn’t find a way to access their values before task execution (their setters are called after afterEvaluate).

I need to use these values in afterEvaluate because they are used to configure Maven publications. Can I still have success with command line options or have I to return to system properties?