plugins {
    id 'com.android.library'
    id 'org.jetbrains.kotlin.android'
    id 'com.vanniktech.maven.publish'
}

android {
    namespace 'com.ahmadhamwi.tabsync_compose'
    compileSdk 33

    defaultConfig {
        minSdk 24
        targetSdk 33

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion compose_version
    }
}

dependencies {

    implementation 'androidx.core:core-ktx:1.9.0'
    implementation 'androidx.appcompat:appcompat:1.6.0'
    implementation 'com.google.android.material:material:1.7.0'
    implementation "androidx.compose.ui:ui:$compose_version"
    implementation "androidx.compose.material:material:$compose_version"
    implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
    implementation 'androidx.activity:activity-compose:1.6.1'
    debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
    androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
}

plugins.withId("com.vanniktech.maven.publish.base") {
    group = "io.github.ahmad-hamwi"
    version = "1.0.1"

    mavenPublishing {
        publishToMavenCentral("S01")

        // Will only apply to non snapshot builds.
        // Uses credentials as described above, supports both regular and in memory signing.
        signAllPublications()

        pom {
            name = "tabsync-compose"
            description = "A lightweight synchronizer between Android Jetpack Compose's LazyListState and ScrollableTabRow"
            inceptionYear = "2023"
            url = "https ://github.com/Ahmad-Hamwi/TabSync/"
            licenses {
                license {
                    name = "The Apache License, Version 2.0"
                    url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
                    distribution = "http://www.apache.org/licenses/LICENSE-2.0.txt"
                }
            }
            developers {
                developer {
                    id = "Ahmad-Hamwi"
                    name = "Ahmad Hamwi"
                    url = "https://github.com/Ahmad-Hamwi/"
                }
            }
            scm {
                url = "https://github.com/Ahmad-Hamwi/TabSync/"
                connection = "scm:git:git://github.com/Ahmad-Hamwi/TabSync.git"
                developerConnection = "scm:git:ssh://git@github.com/Ahmad-Hamwi/TabSync.git"
            }
        }
    }
}