I am new to Gradle and want to pass the merge-base value from one task to another, but does not work because of the two gradle phases (configuration and Execution… ) it seems :
Whenever you try to use ext, you are actually doing something wrong in 98.7 % of the cases.
Also whenever you declare an explicit dependsOn (except with a lifecycle task on the left-hand side) you are doing something wrong in most cases but should instead wire task outputs to task inputs and thus get the necessary task dependency automatically.
If you want to share the output of one task with another task, you can for example write the result to a file and declare it as task output, then have a task input where you were that output to that then reads in the file.
Another option in your case would be to have a shared build service that calculates this value and provides it to various tasks. Or you could have a property where you calculate the value in a provider and that finalizes the value on read, so that it is only calculated once. Depends on concrete details of the build.