} compile fileTree(dir: 'libs', include: '*.jar')Ĭompile 'com.nineoldandroids:library:2.4.0' This is a huge step up from ant, which didn’t do any dependency management.īelow is an example of a dependency block to include all of the jar files in the libs directory, and also fetch the NineOldAndroids library from Maven. Gradle handles dependencies for you, usually using Maven as a back end. This line is what gives us the ability to customize and build Android projects.Ĭlasspath ‘:gradle:0.5.+’Īpply plugin: ‘android’ dependencies Block ⌗ Notice how we also apply the android plugin. In our case, we will be using the Android tools. This just tells Gradle what tools it will use for the script. The project build file starts out with a buildscript block. This file is what allows Gradle to give such consistent builds regardless of workstation configuration. These build files can be quite simple, but also allow you to do so much. Like Ant, Gradle builds use text based build files. Google has some great documentation for migrating if you already build with Eclipse, but that doesn’t work for me. That’s where Gradle steps in.Īfter seeing all of the power of the new Gradle build system, I knew I had to convert Hashnote to Gradle. There are many reasons for this, like build consistency and workstation agnosticism, but you can read this article if you want to check that out.Īnt is a good tool, but never offered the flexibility that I would have liked in a project. I’ve been using ant to build my Android projects for as long as I can remember.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |