// Copyright (C) 2014 The Android Open Source Project
//
// Licensed 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'
apply plugin: 'bintray-release'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        // Important: ExoPlayerLib specifies a minSdkVersion of 9 because
        // various components provided by the library may be of use on older
        // devices. However, please note that the core video playback
        // functionality provided by the library requires API level 16 or
        // greater.
        minSdkVersion 9
        targetSdkVersion 22
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
}

android.libraryVariants.all { variant ->
    def name = variant.buildType.name
    if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
        return; // Skip debug builds.
    }
    def task = project.tasks.create "jar${name.capitalize()}", Jar
    task.dependsOn variant.javaCompile
    task.from variant.javaCompile.destinationDir
    artifacts.add('archives', task);
}

publish {
    repoName = 'exoplayer'
    userOrg = 'google'
    groupId = 'com.google.android.exoplayer'
    artifactId = 'exoplayer'
    version = 'r1.2.3'
    description = 'The ExoPlayer library.'
    website = 'https://github.com/google/ExoPlayer'
}
