@Sateesh G answer is the better answer. Here are the steps I used to build volley as an aar on OS X. (Assuming you already have git, gradle, and android dev tools setup and working)
export ANDROID_HOME=~/.android-sdk/android-sdk-macosx
git clone https://android.googlesource.com/platform/frameworks/volley
cd volley
Configured roblectric and its dependencies
echo 'emulateSdk=18'>>src/test/resources/org.robolectric.Config.properties
cat<<END>rules.gradle
allprojects {
repositories {
jcenter()
}
}
dependencies {
testCompile 'junit:junit:4.12'
testCompile 'org.apache.maven:maven-ant-tasks:2.1.3'
testCompile 'org.mockito:mockito-core:1.9.5'
testCompile 'org.robolectric:robolectric:2.4'
}
END
Build the aar
gradle wrapper
./gradlew clean build
Output files will be located under
build/outputs/aar
Finally to include the resulting aar files in your Android project; copy the volley-release.aar file to the libs subdirectory under your project and add the following to your projects build.gradle file
repositories {
flatDir {
dirs 'libs'
}
}
compile('com.android.volley:volley-release:1.0.0@aar')