[Android SDK] Gradle dependency syntax

As we can read in gradle’s official documentation (chapter 8), the syntax used to name an external library that we want to include in our project’s build.gradle file, is the following:

app/build.gradle

dependencies {
    compile group: 'com.actionbarsherlock', name: 'actionbarsherlock', version: '4.4.0'
}

In this case, the library’s package name is com.actionbarsherlock.actionbarsherlock, and the version name (found in the libproject’s AndroidManifest.xml) is 4.4.0.

There is also a shortcut version of the syntax, separating <group_id>:<artifact_id>:<version>. Like this

dependencies {
    compile 'com.actionbarsherlock:actionbarsherlock:4.4.0'
}

Just searched that info on Google and costed me a couple of minutes to find it. There you got it, in the easiest format possible 🙂

Have a nice coding day!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s