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

android {
    namespace 'com.yxf.clippathlayout'
    compileSdk rootProject.ext.compileSdkVersion

    defaultConfig {
        minSdk rootProject.ext.minSdkVersion
        targetSdk rootProject.ext.targetSdkVersion
        versionCode 1
        versionName rootProject.ext.CLIP_PATH_LAYOUT_VERSION

        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
    }
    
    publishing {
        singleVariant('release') {
            withSourcesJar()
        }
    }
}

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

    implementation 'androidx.appcompat:appcompat:1.7.1'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test:runner:1.7.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
}

group = 'com.github.dqh147258'
version = rootProject.ext.CLIP_PATH_LAYOUT_VERSION

afterEvaluate {
    publishing {
        publications {
            release(MavenPublication) {
                from components.release
                groupId = 'com.github.dqh147258'
                artifactId = 'clippathlayout'
                version = rootProject.ext.CLIP_PATH_LAYOUT_VERSION
            }
        }
    }
}
