What are the differences between gradle assemble and gradle build tasks?

前端 未结 5 1069
谎友^
谎友^ 2020-12-13 23:08

If I am not wrong gradle assemble does run gradle assembleDebug and gradle assembleRelease, but I believe gradle build al

5条回答
  •  旧巷少年郎
    2020-12-13 23:25

    Assemble will build your artifacts, and build will assemble your artifacts with additional checks.

    What additional checks? I run the tasks so you don't have to:

    :app:lint SKIPPED       
    :app:bundleDebugClasses SKIPPED     
    :app:kaptGenerateStubsDebugUnitTestKotlin SKIPPED       
    :app:kaptDebugUnitTestKotlin SKIPPED        
    :app:compileDebugUnitTestKotlin SKIPPED     
    :app:preDebugUnitTestBuild SKIPPED      
    :app:javaPreCompileDebugUnitTest SKIPPED        
    :app:compileDebugUnitTestJavaWithJavac SKIPPED      
    :app:processDebugUnitTestJavaRes SKIPPED        
    :app:testDebugUnitTest SKIPPED      
    :app:bundleReleaseClasses SKIPPED       
    :app:kaptGenerateStubsReleaseUnitTestKotlin SKIPPED     
    :app:kaptReleaseUnitTestKotlin SKIPPED      
    :app:compileReleaseUnitTestKotlin SKIPPED       
    :app:preReleaseUnitTestBuild SKIPPED        
    :app:javaPreCompileReleaseUnitTest SKIPPED      
    :app:compileReleaseUnitTestJavaWithJavac SKIPPED        
    :app:processReleaseUnitTestJavaRes SKIPPED      
    :app:testReleaseUnitTest SKIPPED        
    :app:test SKIPPED       
    :app:check SKIPPED      
    :app:build SKIPPED
    

    As you can see, build does execute more tasks than assemble. Like lint, test, and check tasks.

    You can refer the full tasks here The original text is build task while the changed text is assemble task.

    Project used: Android Sunflower GitHub

提交回复
热议问题