This should work. Are you able to provide a small sample that I can use to diagnose why it isn’t working? 2. What you describe is a dependency, not an ordering. Why doesn’t ‘project2:compileProjectAndPack’ depend on ‘project1:compileProject’ ?
The projects were generated using Netbeans gradle plugin. I will check if I can simplify to simulate the issue, but definitely it was not working as expected : there was no error raised but the mustRunAfter was just ignored.
I don’t want it as a dependency because the first project is a C++ compilation which takes more than 5 minutes to complete. So I want to be able to run project2:compileProjectAndPack without having to relaunch project1:compileProject if this first has already ran and succeeded. I finally was able to get it works as follows :
Says that if ‘project1:compileProject’ is to be executed, it must be before ‘project2:compileProjectAndPack’. It says nothing about under which circumstances ‘project1:compileProject’ should be executed.
For me, with following lines, project1:compileProject should run before project2:compileProjectAndPack when running the task buildAndPackRelease. That’s not the case. That’s why I had to get a workaround.
The problem I have is that I have several simple tasks in different subprojects and I want to have tasks in the root project to aggregate some of them. For example : - task to build and pack all projects in 32 bits - the same for 64bits - task to build All in one go
task to build and run tests for 32bits etc… and the inner tasks must follow a certain order : set version -> compile C -> zip java (which dependsOn jar but not on C because the latter takes long time and is not necessary each time for java developers) All these tasks are managed through netbeans gradle plugin.
I have then to set all my tasks to be evaluated at execution (with <<) otherwise the plugin runs all tasks when just evaluating the projects…