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

android {
    publishing {
        singleVariant("release") {
            withSourcesJar()
            withJavadocJar()
        }
    }
}

afterEvaluate {
    publishing {
        publications {
            // Creates a Maven publication called "release".
            release(MavenPublication) {
                // Applies the component for the release build variant.
                from components.release

                // You can then customize attributes of the publication as shown below.
                groupId = 'com.germainkevin.collapsingtopbarcompose'
                artifactId = 'collapsingtopbarcompose'
                version = libraryVersion
            }
        }
    }
}

repositories {
    mavenCentral()
}

android {
    compileSdk 35

    defaultConfig {
        minSdk 21
        targetSdk 35
        consumerProguardFiles "consumer-rules.pro"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = '17'
    }
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion '1.5.1'
    }
    packagingOptions {
        resources {
            excludes += '/META-INF/{AL2.0,LGPL2.1}'
        }
    }
    namespace 'com.germainkevin.collapsingtopbar'
}

dependencies {

    implementation "androidx.core:core-ktx:$coreKtx"
    implementation 'androidx.appcompat:appcompat:1.7.0'
    implementation "com.jakewharton.timber:timber:$timberVersion"

    def composeBom = platform("androidx.compose:compose-bom:2025.04.00")
    implementation composeBom
    androidTestImplementation composeBom


    // Compose dependencies
    implementation "androidx.compose.material:material"
    implementation "androidx.compose.ui:ui"
    implementation "androidx.compose.ui:ui-tooling-preview"
    implementation "androidx.compose.material:material-icons-extended"
    implementation "androidx.compose.material3:material3"
}