How to execute assemble task twice?

I have another question that pretty much boils down to the same issue of being able to invoke the compileJava task for each dynamic build task (one per brand). Create multiple shadowJars for each flavor of application

Is there any working sample/example that shows how to have multiple compile, assemble tasks?