2017년 2월 16일 목요일

안드로이드 스튜디오 빌드 속도 향상 시키는 방법


안드로이드 스튜디오 빌드 속도 향상 시키는 방법

안드로이드 스튜디오 빌드 속도 향상 시키기 

프로젝트의 루트에 gradle.properties를 생성하고 안드로이드 스튜디오를 재실행하면 반영이 돼요
마지막 라인이 중요해요
project.android.dexOptions.preDexLibraries = false
빌드서버에서 빌드를 하는 경우에는 기존 빌드된 결과물을 재활용하는 대신 항상 클린 빌드를 수행할 필요가 없어요, 따라서 그래들 증분 빌드의 효과를 누릴 수가 없어요, 하지만, 기본적으로 그래들 안드로이드 플로그인은 증분 빌드 기능을 최적화 하기 위하여 최초 빌드시 모든 서브 모듈들을 pre-dexing 하는 작업을 수행해요, 다만, 이런 경우 첫 번째 빌드 시에는 더 오랜 시간이 걸리게 되며 빌드 서버에서는 별로 적절하지 않은 작업이 된다, 따라서 안드로이드 그래들 플러그인의 preDexLibraries 속성을 사용하지 않도록 위와 같이 사용하는 것이 좋아요
# Project-wide Gradle settings.# IDE (eg Android Studio) users :# Settings specified in this file will override any Gradle settings# configured through the IDE.# For more details on  how to configure your build environment visit# http : // www.gradle.org/docs/current/userguide/build_environment.html# The Gradle daemon aims to improve the startup and execution time of Gradle.# When set to true the Gradle daemon is to run the build.# TODO : disable daemon on  CI, Since Builds should BE clean and Reliable on  serversorg.gradle.daemon = true
# Specifies the JVM arguments used for the daemon process.# The setting is particularly useful for tweaking memory settings.# Default value : -Xmx10248m -XX : MaxPermSize = 256Morg.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.# This option should on ly be used with decoupled projects. More details, visit# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec : decoupled_projectsorg.gradle.parallel = true
# Enables new incubating mode that makes Gradle selective when configuring projects.# on ly relevant projects are configured which results in faster builds for large multi-projects.# http://www.gradle.org/docs/current/userguide/multi_project_builds.html #sec : configuration_on_demandorg.gradle.configureondemand = true
project.android.dexOptions.preDexLibraries = false



댓글 없음:

댓글 쓰기