一、构建
构建过程也就是指将Android Studio的工程代码通过gradle脚本编译打包成APK的过程。
整个过程其实就是执行一堆task,所以要弄明白构建过程,主要是需要搞明白gradle执行了哪些task,这些task的作用是什么
我们要打一个release包,一般是通过gradle assembleRelease命令来执行,我们看一下命令的执行过程:
Executing tasks: [assembleRelease]
:app:preBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:checkReleaseManifest
:app:preDebugBuild UP-TO-DATE
:app:prepareComAkexorcistRoundCornerProgressBar203Library
:app:prepareComAlipayEulerAndfix050Library
:app:prepareComAndroidDatabindingAdapters121Library
:app:prepareComAndroidDatabindingLibrary121Library
:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library
:app:prepareComAndroidSupportAppcompatV72340Library
:app:prepareComAndroidSupportCardviewV72340Library
:app:prepareComAndroidSupportDesign2340Library
:app:prepareComAndroidSupportGridlayoutV72340Library
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library
:app:prepareComAndroidSupportRecyclerviewV72340Library
:app:prepareComAndroidSupportSupportV42340Library
:app:prepareComAndroidSupportSupportVectorDrawable2340Library
:app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library
:app:prepareComFacebookFrescoAnimatedBase130Library
:app:prepareComFacebookFrescoAnimatedGif130Library
:app:prepareComFacebookFrescoAnimatedWebp130Library
:app:prepareComFacebookFrescoDrawee130Library
:app:prepareComFacebookFrescoFbcore130Library
:app:prepareComFacebookFrescoFresco130Library
:app:prepareComFacebookFrescoImagepipeline130Library
:app:prepareComFacebookFrescoImagepipelineBase130Library
:app:prepareComFacebookFrescoImagepipelineOkhttp3130Library
:app:prepareComFacebookFrescoWebpsupport130Library
:app:prepareComFacebookReactReactNative0503Library
:app:prepareComFacebookSoloaderSoloader010Library
:app:prepareComGithubMarkzhaiBlockcanaryAnalyzer150Library
:app:prepareComGithubMarkzhaiBlockcanaryAndroid150Library
:app:prepareComGoogleAndroidFlexbox025Library
:app:prepareComSensetimeCardscanner520Library
:app:prepareComSquareupLeakcanaryLeakcanaryAndroidNoOp13Library
:app:prepareIoReactivexRxjava2Rxandroid201Library
:app:prepareMeEverythingOverscrollDecorAndroid104Library
:app:prepareMeRelexCircleindicator122Library
:app:prepareMeRelexPhotodraweeview112Library
:app:prepareOrgWebkitAndroidJscR174650Library
:app:prepareRepluginHostLibDebugLibrary
:app:prepareReleaseDependencies
:app:compileReleaseRenderscript
:app:generateReleaseResValues
:app:generateReleaseResources
:app:mergeReleaseResources
:app:dataBindingProcessLayoutsRelease
:app:compileReleaseAidl
:app:generateReleaseBuildConfig
:app:rpGenerateReleaseHostConfig
:app:processReleaseResources
:app:generateReleaseSources
:app:dataBindingExportBuildInfoRelease
:app:incrementalReleaseJavaCompilationSafeguard
:app:compileReleaseJavaWithJavac
:app:compileReleaseNdk UP-TO-DATE
:app:compileReleaseSources
:app:lintVitalRelease
:app:mergeReleaseShaders
:app:compileReleaseShaders
:app:generateReleaseAssets
:app:mergeReleaseAssets
:app:rpGenerateReleaseBuiltinJson
:app:transformClassesWithJarMergingForRelease
:app:transformClassesWithMultidexlistForRelease
:app:transformClassesWithDexForRelease
:app:mergeReleaseJniLibFolders
:app:transformNative_libsWithMergeJniLibsForRelease
:app:transformNative_libsWithStripDebugSymbolForRelease
:app:processReleaseJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForRelease
:app:packageRelease
:app:assembleRelease
BUILD SUCCESSFUL
网友评论