Last active
March 30, 2020 10:26
-
-
Save monkeydone/a81d24ad0ad0abff6fb1dfa5ecaa91a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allprojects { | |
repositories { | |
jcenter() | |
} | |
gradle.taskGraph.whenReady { | |
tasks.each { task -> | |
if (task.name.equals('mockableAndroidJar')) { | |
task.enabled = false | |
} | |
} | |
} | |
} | |
增加test 的依赖关系 | |
tasks.whenTaskAdded { | |
task -> | |
if (task.name.contains("test")) { | |
task.getDependsOn().add({ | |
println 'app getDependsOn doLast afterAssembleDebug' | |
clean//可以直接执行这个task或者说是依赖 | |
}) | |
} | |
} | |
apply from: rootProject.file('tasks/tasks1.gradle') | |
project.afterEvaluate { | |
println 'app的build文件************************* ' | |
assembleDebug.dependsOn beforeAssembleDebug | |
} | |
task afterAssembleDebug() { | |
doLast { | |
println '111doLast afterAssembleDebug' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment