Invoking different tasks for each subproject

I have the following set up:

Project

  • spring boot app
  • java classes that are packaged into a jar
  • android project
  • app module of the android project

I am trying to set up gradle build so that i get runnable spring boot jar application, java jar library that is installed in the local maven repo and an apk file for the android.

  • To get an apk file I need to run assembleDebug task
  • To publish java ibrary I need to run publish task
  • To get spring executable I need to run compileJave task

Question is what task to run on the top level root gradel.build file to get different tasks accomplished?