我用gradle定义了一个任务:
task makePretty(type: Delete) {
println "Make it pretty!"
}
我希望它在android汇编后运行并添加:
makePretty.mustRunAfter assemble
不幸的是,每次开始gradle组装时,任务似乎都会先执行。
me@my_mac: ~/sources/xxx-Android ./gradlew assembleTest
Parallel execution is an incubating feature.
Make it pretty!
执行Gradle任务:
: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
我的gradle包装器是1.9版。
我做错了什么?我做错了吗?我该如何解决?
答案 0 :(得分:3)
看起来你在配置生命周期中正在做println。如果你打击这些'<<<'
,可能会有更多预期的行为