apply plugin: 'com.android.library'
apply plugin: 'maven-publish'

android {
    namespace "com.termux.terminal"
    compileSdkVersion 34

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

    defaultConfig {
        minSdkVersion 21
        //noinspection ExpiredTargetSdkVersion
        targetSdkVersion 28
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    testOptions {
        unitTests.returnDefaultValues = true
    }

}

tasks.withType(Test) {
    testLogging {
        events "started", "passed", "skipped", "failed"
    }
}

dependencies {
    testImplementation 'junit:junit:4.13.1'
}


publishing {
    publications {
        bar(MavenPublication) {
            groupId 'com.termux'
            artifactId 'terminal-emulator'
            version '0.106.1'
            artifact("$buildDir/outputs/aar/terminal-emulator-release.aar")
        }
    }
 
    repositories {
        maven {
            name = "GitHubPackages"
            url = uri("https://maven.pkg.github.com/termux/termux-app")

            credentials {
                username = System.getenv("GH_USERNAME")
                password = System.getenv("GH_TOKEN")
            }
        }
    }
}
