Force rerun a task by another task

If there is a way to delay the service from compiling it sources just until all dependant modules have finalised their annotation processing task ( kaptDebugCompile )

You’re trying your old chicken or egg problem again. You want:

  • subproject to depend on service binaries
  • service binaries to depend on subproject

You can’t do that

and copied the file back to service build folder.

Don’t do that!

Also adding a SourceSet to android is not that trivial

So just add a KotlinCompile task to the project then

@Lance Well that would be great to do but I can’t find a documented resource on how to do that. Are you aware of any?

@Lance do you think if I just jar provide these generated sources using a task and make compileDebugKotlin depend on that will solve the problem? classes -> jar -> archive
Like this thread suggests

Something like

import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
... 
task kotlinCompile2(type: KotlinCompile) {
   // configure sources 
   // configure classpath 
   // configure output directory 
} 
classes.dependsOn 'kotlinCompile2' 

Execution failed for task ‘:service: kotlinCompile2’.

Key kotlinCompile2 is missing in the map.

I guess it’s generic problem after the update kotlin-1.3.61 someone already posted a bug report here

Perhaps you could try one of these solutions:

Create extra projects
So you’d have a, b, c, service (without navigation) and a-all, b-all, c-all, service-all (with navigation)

Generate the navigation from the kotlin sources, not the compiled classes
This way you don’t need the subprojects to be compiled to generate the navigation

Use xml or json to represent your navigation and generate your kotlin sources from that instead
Same as 2.