When BROWSING Github Trending recently, I found that Freeline was listed for several days in a row. I tried freeline once when it was just open source, but neither APT nor Lambda supported it at that time, so I gave it up. I have read the latest Update log of Freeline and found that apt, Databinding and other features are now supported. I am very happy to try them out.

An overview of the

Freeline is an incremental compilation tool for The Android platform developed by ant Jubao Android team. It can make full use of cached files to quickly compile and deploy code changes to the device in seconds, effectively reducing the amount of time spent recompiling and installing in daily development. Freeline saves Android developers a lot of coffee time:)

For specific principles, please refer to the Chinese principles

The basic use

  1. Configure in App Gradle:
    buildscript {
     repositories {
         jcenter()
     }
     dependencies {
         classpath 'com. Antfortune. Freeline: gradle: 0.8.2'}}Copy the code
  2. Configure in Moudle Gradle

    apply plugin: 'com.antfortune.freeline'
    android {
         freeline {
             hack true
             // If multiple flavors are configured, you can specify the compiled Flavor here
             productFlavor "develop"}}Copy the code

    For more configuration, see Freeline DSL References

  3. Command line execution takes place first

    ./gradlew initFreelineCopy the code

    And then the first full compilation

    python freeline.py -fCopy the code

    And then you can delightfully incrementally compile it, and it’s very fast

    python freeline.pyCopy the code



    Paste_Image.png

    It took 1.6 seconds, plus the interface restart 1,2 seconds, generally 5 seconds can see the effect of modification, happiness doubled.

  4. You can search for the freeline plugin in Android Studio. After installing the freeline plugin, you can skip the above three steps. However, during the use of the plugin, I still feel that there are some bugs. If you are lucky, it will be very smooth, but if you are unlucky, there will be all kinds of problems. Therefore, I still recommend configuring Freeline and using the command line compilation method.