apply plugin: 'com.android.library'

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.2'
    }
}

android {
    compileSdkVersion 28

    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
    }

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

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.0'
}

// We don't seem to be able to generate javadocs of classes that depend on generated AIDL stubs.
// So, for now, don't try, since we're not really using the javadoc output.
tasks.withType(Javadoc).all { enabled = false }

// Metadata and tasks to generate a release zip.
//
// This zip can be uploaded to bintray, which will sync to jcenter, which will allow library
// builders to download and use this library by simply saying
//    compile 'com.google.android.apps.forscience:science-journal-api:0.1'
// in their build.gradle file (see build.gradle in ScalarApiSampleApp for an example)

ext {
    PUBLISH_GROUP_ID = 'com.google.android.apps.forscience'
    PUBLISH_ARTIFACT_ID = 'science-journal-api'
    PUBLISH_VERSION = '1.0'
}

// From http://blog.blundellapps.co.uk/locally-release-an-android-library-for-jcenter-or-maven-central-inclusion/
// To use this, run "gradle clean build generateRelease", from command line or Android Studio
apply from: 'https://raw.githubusercontent.com/ArthurHub/release-android-library/master/android-release-aar.gradle'
