Gradles mustRunAfter doesn't seem to work

I defined the task in gradle:

task makePretty(type: Delete) {
    println "Make it pretty!"
}

I want it to run after the android build and add this:

makePretty.mustRunAfter assemble

Unfortunately, the task seems to be executed every time I start the gradle build.

me@my_mac: ~/sources/xxx-Android 🍊  ./gradlew assembleTest
Parallel execution is an incubating feature.
Make it pretty!

Gradle Completed tasks:

:MyProject:compileDebugNdk UP-TO-DATE
:MyProject:preBuild UP-TO-DATE
:MyProject:preDebugBuild UP-TO-DATE
:MyProject:preRcBuild UP-TO-DATE
:MyProject:preReleaseBuild UP-TO-DATE
:MyProject:preTestBuild UP-TO-DATE
:MyProject:prepareComAndroidSupportAppcompatV71901Library UP-TO-DATE
:MyProject:prepareDebugDependencies
:MyProject:compileDebugAidl UP-TO-DATE
:MyProject:compileDebugRenderscript UP-TO-DATE
:MyProject:generateDebugBuildConfig UP-TO-DATE
:MyProject:mergeDebugAssets UP-TO-DATE
:MyProject:mergeDebugResources UP-TO-DATE
:MyProject:processDebugManifest UP-TO-DATE
:MyProject:processDebugResources UP-TO-DATE
:MyProject:generateDebugSources UP-TO-DATE
:MyProject:compileDebugJava UP-TO-DATE
:MyProject:preDexDebug UP-TO-DATE
:MyProject:dexDebug UP-TO-DATE
:MyProject:processDebugJavaRes UP-TO-DATE
:MyProject:validateDebugSigning
:MyProject:packageDebug UP-TO-DATE
:MyProject:zipalignDebug UP-TO-DATE
:MyProject:assembleDebug UP-TO-DATE

My gradle wrapper is on version 1.9.

What am I doing wrong? Am I doing wrong? How can i fix this?

+3
source share
1 answer

It looks like you are doing your println in the configuration life cycle. There may be more expected behavior if you pat on these "<"

+3
source

All Articles