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

Force rerun a task by another task

$
0
0

is there a way I could make a task re-run again if another task depends on it and that it has been executed by gradle before?

in root project i have made this configuration

afterEvaluate {
   tasks.getByPath(":home:compileDebugKotlin").dependsOn(":service:home:compileDebugKotlin")
   tasks.getByPath(":subscription:compileDebugKotlin").dependsOn(":service:home:compileDebugKotlin")
}

after :home:compileDebugKotlin is executed (this means that :service:compileDebugKotlin was executed) I want :subscription:compileDebugKotlin to re-run :service:compileDebugKotlin once again.

The reason I need this is that home and subscription modules will generate some code using kapt and place it in service and if service gets compiled the bytecode will not include the generated classes simply because the didn’t exist when the compilation happened.


Viewing all articles
Browse latest Browse all 19859

Trending Articles