diff --git a/README.md b/README.md index 7aed978e..7903cdf8 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,35 @@ [![Build Status](https://travis-ci.org/kaaes/spotify-web-api-android.svg?branch=master)](https://travis-ci.org/kaaes/spotify-web-api-android) +[![Release](https://img.shields.io/github/release/kaaes/spotify-web-api-android.svg?label=maven)](https://jitpack.io/#kaaes/spotify-web-api-android) # Spotify Web API for Android This project is a wrapper for the [Spotify Web API](https://developer.spotify.com/web-api/). It uses [Retrofit](http://square.github.io/retrofit/) to create Java interfaces from API endpoints. -## Building -This project is built using [Gradle](https://gradle.org/): - -1. Clone the repository: `git clone https://github.com/kaaes/spotify-web-api-android.git` -2. Build: `./gradlew assemble` -3. Grab the `aar` that can be found in `spotify-api/build/outputs/aar/spotify-web-api-android-0.1.1.aar` and put it in the `libs` folder in your application - -## Integration into your project - -This project depends on `Retrofit 1.9.0` and `OkHttp 2.2.0`. When you [build it](#building), it creates an `aar` -that doesn't contain Retrofit and OkHttp files. To make your app work you'll need to include these -dependencies in your app's `build.gradle` file. +## Integrating into your project -Add following to the `build.gradle` file in your app: +This library is available in [JitPack.io](https://jitpack.io/) repository. +To use it make sure that repository's url is added to the `build.gradle` file in your app: ```groovy repositories { mavenCentral() - flatDir { - dirs 'libs' - } + maven { url "https://jitpack.io" } } dependencies { - compile(name:'spotify-web-api-android-0.1.1', ext:'aar') - compile 'com.squareup.retrofit:retrofit:1.9.0' - compile 'com.squareup.okhttp:okhttp:2.2.0' + compile 'com.github.kaaes:spotify-web-api-android:0.2' // Other dependencies your app might use } ``` -The `repositories` section tells your application to look for the `spotify-web-api-android-0.1.1.aar` -in the local repository in the `libs` folder. +## Building +This project is built using [Gradle](https://gradle.org/): + +1. Clone the repository: `git clone https://github.com/kaaes/spotify-web-api-android.git` +2. Build: `./gradlew assemble` +3. Grab the `aar` that can be found in `spotify-api/build/outputs/aar/spotify-web-api-android-0.2.0.aar` ## Usage diff --git a/build.gradle b/build.gradle index 4fd2bdf8..49d5606a 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,6 @@ buildscript { } dependencies { classpath "com.android.tools.build:gradle:${ANDROID_GRADLE_PLUGIN_VERSION}" - classpath "org.robolectric:robolectric-gradle-plugin:${ROBOLECTRIC_GRADLE_PLUGIN_VERSION}" classpath "com.jakewharton.sdkmanager:gradle-plugin:${SDKMANAGER_GRADLE_PLUGIN_VERSION}" classpath "com.github.dcendents:android-maven-gradle-plugin:1.3" // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle.properties b/gradle.properties index a3debbf1..98bba745 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,12 +1,11 @@ org.gradle.daemon=true BASE_NAME=spotify-web-api-android -VERSION_NAME=0.1.1 +VERSION_NAME=0.2.0 GROUP=com.spotify.android # Deps for gradle -ANDROID_GRADLE_PLUGIN_VERSION=1.2.3 -ROBOLECTRIC_GRADLE_PLUGIN_VERSION=1.1.0 +ANDROID_GRADLE_PLUGIN_VERSION=1.3.0 SDKMANAGER_GRADLE_PLUGIN_VERSION=0.12.+ # Deps for libraries @@ -14,4 +13,4 @@ FEST_ASSERT_CORE_VERSION=2.0M10 GUAVA_VERSION=18.0 JUNIT_VERSION=4.12 MOCKITO_CORE_VERSION=1.+ -ROBOLECTRIC_VERSION=2.4 \ No newline at end of file +ROBOLECTRIC_VERSION=3.0 \ No newline at end of file diff --git a/release.gradle b/release.gradle index 2b1ff70a..b53f0934 100644 --- a/release.gradle +++ b/release.gradle @@ -33,7 +33,7 @@ jacoco { def coverageSourceDirs = ['src/main/java' ] -task jacocoTestReport(type:JacocoReport, dependsOn: "testDebug") { +task jacocoTestReport(type:JacocoReport, dependsOn: "test") { group = "Reporting" description = "Generate Jacoco coverage reports" diff --git a/sample-search/build.gradle b/sample-search/build.gradle index 8f355798..48e56a97 100644 --- a/sample-search/build.gradle +++ b/sample-search/build.gradle @@ -12,10 +12,6 @@ android { versionName "1.0" } - lintOptions { - disable 'InvalidPackage' // for okio-1.2.0 - } - buildTypes { release { minifyEnabled false diff --git a/spotify-api/build.gradle b/spotify-api/build.gradle index 5ddcb01b..ca979e2a 100644 --- a/spotify-api/build.gradle +++ b/spotify-api/build.gradle @@ -1,6 +1,5 @@ apply plugin: 'android-sdk-manager' apply plugin: 'com.android.library' -apply plugin: 'org.robolectric' apply plugin: 'com.github.dcendents.android-maven' project.group = GROUP @@ -8,14 +7,13 @@ version = VERSION_NAME dependencies { compile('com.squareup.retrofit:retrofit:1.9.0') - compile('com.squareup.okhttp:okhttp:2.2.0') testCompile("org.robolectric:robolectric:${ROBOLECTRIC_VERSION}") { exclude group: 'com.android.support', module: 'support-v4' exclude group: 'commons-logging', module: 'commons-logging' exclude group: 'org.apache.httpcomponents', module: 'httpclient' } - testCompile "com.google.guava:guava:${GUAVA_VERSION}" + testCompile "com.google.guava:guava:${GUAVA_VERSION}" testCompile "junit:junit:${JUNIT_VERSION}" testCompile "org.easytesting:fest-assert-core:${FEST_ASSERT_CORE_VERSION}" testCompile "org.mockito:mockito-core:${MOCKITO_CORE_VERSION}" @@ -27,10 +25,6 @@ android { compileSdkVersion 23 buildToolsVersion '23.0.2' - lintOptions { - disable 'InvalidPackage' // for okio-1.2.0 - } - buildTypes { debug { testCoverageEnabled = true diff --git a/spotify-api/src/main/java/kaaes/spotify/webapi/android/SpotifyService.java b/spotify-api/src/main/java/kaaes/spotify/webapi/android/SpotifyService.java index 62c59f42..0d529697 100644 --- a/spotify-api/src/main/java/kaaes/spotify/webapi/android/SpotifyService.java +++ b/spotify-api/src/main/java/kaaes/spotify/webapi/android/SpotifyService.java @@ -1388,42 +1388,44 @@ public interface SpotifyService { /** * Get the current user's followed artists. * + * @return Object containing a list of artists that user follows wrapped in a cursor object. * @see Get User's Followed Artists */ @GET("/me/following?type=artist") - public ArtistsCursorPager getFollowedArtists(); + ArtistsCursorPager getFollowedArtists(); /** * Get the current user's followed artists. * - * @param callback Callback method. + * @param callback Callback method. * @return An empty result * @see Get User's Followed Artists */ @GET("/me/following?type=artist") - public Result getFollowedArtists(Callback callback); + Result getFollowedArtists(Callback callback); /** * Get the current user's followed artists. * - * @param options Optional parameters. For list of supported parameters see - * endpoint documentation + * @param options Optional parameters. For list of supported parameters see + * endpoint documentation + * @return Object containing a list of artists that user follows wrapped in a cursor object. * @see Get User's Followed Artists */ @GET("/me/following?type=artist") - public ArtistsCursorPager getFollowedArtists(@QueryMap Map options); + ArtistsCursorPager getFollowedArtists(@QueryMap Map options); /** * Get the current user's followed artists. * * @param options Optional parameters. For list of supported parameters see * endpoint documentation - * @param callback Callback method. + * @param callback Callback method. * @return An empty result * @see Get User's Followed Artists */ @GET("/me/following?type=artist") - public Result getFollowedArtists(@QueryMap Map options, Callback callback); + Result getFollowedArtists(@QueryMap Map options, Callback callback); /********** * Search * diff --git a/spotify-api/src/test/resources/org.robolectric.Config.properties b/spotify-api/src/test/resources/org.robolectric.Config.properties deleted file mode 100644 index 0e55a367..00000000 --- a/spotify-api/src/test/resources/org.robolectric.Config.properties +++ /dev/null @@ -1,3 +0,0 @@ -emulateSdk=18 -manifest=src/main/AndroidManifest.xml -sdk=18 \ No newline at end of file diff --git a/spotify-api/src/test/resources/robolectric.properties b/spotify-api/src/test/resources/robolectric.properties new file mode 100644 index 00000000..3719bc6b --- /dev/null +++ b/spotify-api/src/test/resources/robolectric.properties @@ -0,0 +1,3 @@ +sdk=21 +constants= com.spotify.webapi.android.BuildConfig +manifest=src/main/AndroidManifest.xml \ No newline at end of file