Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android gradle: what do square brackets around the version mean?

Tags:

android

gradle

In Facebook Android sdk's get started guides, they define two ways to add the dependency to your project. In the Getting Started section, the line in gradle is

compile 'com.facebook.android:facebook-android-sdk:4.+'

but in the Quick Start guide, the line is

compile 'com.facebook.android:facebook-android-sdk:[4,5)'

Additionally, Android Studio warns that you shouldn't use '+' in version numbers, leading to unrepeatable builds. I have seen the '+' for other dependencies and I believe it means to get the latest version when you sync gradle, but what do the square bracket and parentheses mean in the second line?

like image 272
lithiumsheep Avatar asked Jan 16 '17 16:01

lithiumsheep


1 Answers

It means a range. [ means including, ) means up to. So that would be any version starting with 4, but less than 5. so 4.0, 4.1, 4.99999.9999 would match, 5.0 would not. 4.+ means anything 4 or greater with no upper bound.

like image 139
Gabe Sechan Avatar answered Oct 02 '22 19:10

Gabe Sechan