Skip to content

Instantly share code, notes, and snippets.

View akshay2211's full-sized avatar
🏠
Working from home

Akshay Sharma akshay2211

🏠
Working from home
View GitHub Profile
// ./gradlew clean build generateRelease
apply plugin: 'maven'
def groupId = project.PUBLISH_GROUP_ID
def artifactId = project.PUBLISH_ARTIFACT_ID
def version = project.PUBLISH_VERSION
def localReleaseDest = "${buildDir}/release/${version}"
task androidJavadocs(type: Javadoc) {
@akshay2211
akshay2211 / Interceptor.java
Created September 5, 2017 14:08 — forked from alex-shpak/Interceptor.java
Refreshing OAuth token with okhttp interceptors. All requests will wait until token refresh finished, and then will continue with the new token.
private class HttpInterceptor implements Interceptor {
@Override
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
//Build new request
Request.Builder builder = request.newBuilder();
builder.header("Accept", "application/json"); //if necessary, say to consume JSON