Tutorial by Examples

Single JAR Sometimes you have a local JAR file you need to add as a dependency to your Gradle build. Here's how you can do this: dependencies { compile files('path/local_dependency.jar') } Where path is a directory path on your filesystem and local_dependency.jar is the name of your local...
Dependencies in Gradle follow the same format as Maven. Dependencies are structured as follows: group:name:version Here's an example: 'org.springframework:spring-core:4.3.1.RELEASE' To add as a compile-time dependency, simply add this line in your dependency block in the Gradle build file: ...
In the case of a multi-project gradle build, you may sometimes need to depend on another project in your build. To accomplish this, you'd enter the following in your project's dependencies: dependencies { compile project(':OtherProject') } Where ':OtherProject' is the gradle path for the p...
Calling the dependencies task allows you to see the dependencies of the root project: gradle dependencies The results are dependency graphs (taking into account transitive dependencies), broken down by configuration. To restrict the displayed configurations, you can pass the --configuration opti...
You have to point Gradle to the location of your plugins so Gradle can find them. Do this by adding a repositories { ... } to your build.gradle. Here's an example of adding three repositories, JCenter, Maven Repository, and a custom repository that offers dependencies in Maven style. repositories...
Navigate to project's app module and create libs directory. Place your .aar file there. For example myLib.aar. Add the code below to android block of app level's build.gradle file. repositories { flatDir { dirs 'libs' } } This way you defined a new ext...

Page 1 of 1