apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply from: "../ktlint.gradle"

android {
    compileSdkVersion 33
    defaultConfig {
        multiDexEnabled true
        minSdkVersion 19
        targetSdkVersion 33

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        debug{

        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_11
    }
    lintOptions{
        disable 'MissingTranslation'
    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

    implementation 'androidx.core:core-ktx:1.9.0'
    implementation 'androidx.appcompat:appcompat:1.5.1'
    implementation 'androidx.exifinterface:exifinterface:1.3.5'
    implementation 'androidx.documentfile:documentfile:1.0.1'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
    implementation 'androidx.fragment:fragment-ktx:1.5.5'

    //More Info: https://github.com/Yalantis/uCrop
    implementation 'com.github.yalantis:ucrop:2.2.8'

    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.4'
    androidTestImplementation 'androidx.test:core:1.5.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0'
}

ext {
    PUBLISH_GROUP_ID = 'com.github.Drjacky'
    PUBLISH_VERSION = rootProject.ext.versionName
    PUBLISH_ARTIFACT_ID = 'ImagePicker'

    bintrayRepo = 'ImagePicker'
    bintrayName = 'ImagePicker'

    publishedGroupId = 'com.github.Drjacky'
    libraryName = 'ImagePicker'
    artifact = 'ImagePicker'

    libraryDescription = 'Pick image from Gallery or Capture new image with Camera.'

    siteUrl = 'https://github.com/Drjacky/ImagePicker'
    issueUrl = 'https://github.com/Drjacky/ImagePicker/issues'
    gitUrl = 'https://github.com/Drjacky/ImagePicker.git'

    libraryVersion = rootProject.ext.versionName

    developerId = 'drjacky'
    developerName = 'Hossein Abbasi'
    developerEmail = 'dr.jacky.2005@gmail.com'

    licenseName = 'The Apache Software License, Version 2.0'
    licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
    allLicenses = ["Apache-2.0"]

    gitRepo = 'Drjacky/ImagePicker' //Optional Github repository
    readmeName = 'CHANGELOG.md' //Optional Github readme file
}

// apply from: 'https://raw.githubusercontent.com/Drjacky/ImagePicker/master/bintray-install.gradle'
// apply from: 'https://raw.githubusercontent.com/Drjacky/ImagePicker/master/bintray.gradle'
apply from: "${rootProject.projectDir}/scripts/publish-mavencentral.gradle"