Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 20317

Force rerun a task by another task

$
0
0

@Lance I understood that the hard way, and how gradle works after I saw your comment in the other thread. Let me put some context here:

I am developing a gradle plugin that will handle navigation in multi module project. I have put all the basic blocs there and everything works like charm. As I am finalising the plugin I wanted to automate everything for the users so they don’t have to configure anything (plug and enjoy).

My plugin works this way:

  1. in a project (user project) there is a sub-project named service this will handle the routing part of the navigation.
  2. there could be n other sub-projects that depend on service. They Have also classes annotated with some annotation which describes the specs of the navigation (destination, args…)
  3. since i am configuring kapt compiler into these sub projects they will run the task kaptDebugCompile and generate some source files. The annotation processor will output the files into the service subproject build directory.
  4. All sub projects that depend on service will then reference these generated classes from within `service.

Now when i compile the demo of the plugin, the compilation fails cuz service was compiled before kapt tasksfinished executing. Therefore the compiledservice` has no class definition of these generated classes.

I need a way to make :service:compileDebugKotlin depend on :someProject:kaptDebugKotlin. It’s sad that I can’t do that because :someProject:kaptDebugKotlin it self depends (by default) on :service:compileDebugKotlin becase someProject compiles service.

I know no way how to create kaptDebugKotlin with different config/params.

can you suggest something or point me to the right direction in case i am wrong with something?

Thanks a lot


Viewing all articles
Browse latest Browse all 20317

Trending Articles