/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

apply plugin: 'com.android.library'

android {
  compileSdkVersion 23
  buildToolsVersion "23.0.1"
  useLibrary 'org.apache.http.legacy'
  sourceSets.main.java {
    srcDir '../src'
    exclude 'org/apache/thrift/transport/TSaslClientTransport.java'
    exclude 'org/apache/thrift/transport/TSaslServerTransport.java'
    exclude 'org/apache/thrift/transport/TSaslTransport.java'
  }
}

repositories {
  mavenCentral()
}
dependencies {
  compile 'org.slf4j:slf4j-api:1.7.13'
  compile 'javax.servlet:servlet-api:2.5'
  compile 'org.apache.httpcomponents:httpcore:4.4.4'
}

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
  }
}
