Introducing the Best Build Tools for Android


                         This article is from http://blog.csdn.net/liuxian13183/  , and the reference must be indicated!


Instant Run provides us with an incremental update method, supports gradle 2.0 and Android 4.0 and above, and makes building projects faster. At the same time, due to the emergence of multiDex, incremental updates become simpler, but the reality is that Studio compilation is still Kaka.

Facebook's Buck is good, but it only supports Linux development machines; while Alibaba's open-source Freeline can be used on Windows machines. According to dependencies, the    cache minimal compilation, and SocketServer is enabled to ensure that crash can also be compiled at the same time. Finally, Realize the simultaneous process of full compilation and incremental compilation, and improve the compilation speed by 2-3 times.   

Precautions

1. You can only use gradle versions above 2.2 and python2.7 and below, and configure environment variables

2. Use jcenter to compile instead of mavenCenter, because some gradle does not have the latter

3. The gradle version in this file needs to be replaced. The csdn limit can only upload files within 80M. You can only download it from the official website, address: gradle3.3


4、

Add the following to the build.gradle of the main project:

buildscript {
    repositories {
        jcenter ()
    }
    dependencies {
        classpath 'com.antfortune.freeline:gradle:0.8.5'
    }
}

apply plugin: 'com.antfortune.freeline'

dependencies {
    compile 'com.antfortune.freeline:gradle:0.8.5'
}
The current highest version is 0.8.5

5. After the configuration, execute the following command in the Terminal of Android Studio, which means downloading from the domestic mirror, which is much faster.

gradlew initFreeline -Pmirror

Other features

  • Incremental builds of standard multi-module Gradle projects are supported
  • Execute incremental compilation tasks concurrently
  • Process level exception isolation mechanism
  • Support so dynamic update
  • Support resource.arsc cache
  • support for retrolambda
  • Support DataBinding
  • Support various mainstream annotation libraries
  • Support Windows, Linux, Mac platform

The following list is the hot update supported by Freeline:

  Java drawable, layout, etc. res/values native so
add
change
remove x -

Freeline has been tested on Android emulators with API 17, 19, 22, 23, Android 6.0 Nexus 6P and Android 4.4 Hammer phones. If you want to fully experience the speed of incremental compilation with Freeline, it is best to use an Android 5.0+ device.

Limitations

  • The first incremental resource compilation can be a bit slow
  • Deleting resources with id is not supported, otherwise it may cause aapt compilation error
  • Incremental compilation of abstract classes is not currently supported
  • Open Jack compilation is not supported
  • No support for Kotlin/Groovy/Scala
Please point out any incorrections!

Official address: https://github.com/alibaba/freeline/

In addition, the project packaging tool Jenkins is also worth studying: http://blog.csdn.net/mabeijianxi/article/details/52680283

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325985895&siteId=291194637