Skip to main content

Posts

Showing posts from 2015

Gradle: Configuring assets folder of Android application

  In many projects I've worked I've come to appreciate the advantages that using a continuous integration tool like TeamCity. During the development of  last Android application, available on Google Play at OCL Lab Results , I saw the need to include or exclude certain files in the assets of the same.    I decided to go into the benefits offered by a build automation system like Gradle . Let me make one thing clear before starting the details, this article is not a tutorial on Gradle, so I hope you're familiar with it before reading, although I confess that it is not very difficult to understand its main components. All code shown below is designed with Gradle 2.1 and Android Studio.   First you need to ensure the existence of the folder of assets to be included in the apk. So we will create the next task to verify the existence of that folder: def assetsProjectFolderPath= '/src/main/assets'   task createAssetsFolder <<{ def folder = file("$a