apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'


/**Create github.properties in root project folder file with gpr.usr=GITHUB_USER_ID  & gpr.key=PERSONAL_ACCESS_TOKEN**/
def githubPropertiesFile = rootProject.file("github.properties");
def githubProperties = new Properties()
githubProperties.load(new FileInputStream(githubPropertiesFile))

android {
    compileSdkVersion 29
    defaultConfig {
        applicationId "com.enefce.samples.androidlibdemo"
        minSdkVersion 23
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
/****GitHubPackages Path and credentials***/
    repositories {
        maven {
            name = "GitHubPackages"
            /*  Configure path to the library hosted on GitHub Packages Registry
             *  Replace UserID with package owner userID and REPOSITORY with the repository name
             *  e.g. "https://maven.pkg.github.com/enefce/AndroidLibraryForGitHubPackagesDemo"
             */
            //url = uri("https://maven.pkg.github.com/UserID/REPOSITORY")
            url = uri("https://maven.pkg.github.com/enefce/AndroidLibraryForGitHubPackagesDemo")

            credentials {
                /**Create github.properties in root project folder file with gpr.usr=GITHUB_USER_ID  & gpr.key =PERSONAL_ACCESS_TOKEN**/
                username = System.getenv("GPR_USER") ?: githubProperties['gpr.usr']
                password = System.getenv("GPR_API_KEY") ?: githubProperties['gpr.key']
            }
        }
    }

}


dependencies {

    implementation fileTree(dir: 'libs', include: ['*.jar'])

    //Use SampleAndroidLib library
    implementation 'com.enefce.libraries:sampleAndroidLib:1.0.1'

    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
