Having trouble applying your strategy due to the untarring issue. Can’t get my workaround of using Exec to do the untarring to work in your scenario, because the I can’t properly handle the fact that one of the command-line parameters to tar cannot be known until the configuration task has been configured.
The Exec task seems to have some special requirements of its own:
- If I configure the Exec from the configure task’s doLast{} Gradle complains that the Exec command line is null.
- If I configure the Exec normally, the task doesn’t know about the input file yet, which is one of the tar parameters…
- If I try to split this up, defining the config’s command line normally but adding the last argument from the configuration task, I get an error telling me about an unexpected end of file. Evidently the args is not getting processed in the proper sequence.
I still like your idea, but it looks like this bug and the finickiness of the Exec command are preventing me from doing it.