1
gradlew tasks
給我這些任務(其中包括):爲什麼有些gradle任務無法訪問?
assemble - Assembles all variants of all applications and secondary packages.
assembleAndroidTest - Assembles all the Test applications.
assembleDebug - Assembles all Debug builds.
assembleRelease - Assembles all Release builds.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
clean - Deletes the build directory.
cleanBuildCache - Deletes the build cache directory.
compileDebugAndroidTestSources
compileDebugSources
compileDebugUnitTestSources
compileReleaseSources
compileReleaseUnitTestSources
mockableAndroidJar - Creates a version of android.jar that's suitable for unit tests.
我可以添加額外的代碼來說,assemble
,像這樣:
assemble {
doFirst {
println "hello"
}
}
,但不能與其他許多人從此做列表,例如,嘗試添加到assembleDebug
給了我這個錯誤:
Error:(65, 0) Could not find method assembleDebug() for arguments [[email protected]] on project ':app' of type org.gradle.api.Project.
這是爲什麼?