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

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.0"

    defaultConfig {
        minSdkVersion 23
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        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


    }


    sourceSets {
        main {
            java {
                srcDirs 'src/main/java', 'src/testex/java'
//                excludes = [ '**/com/x/**'] // 'com/x/Yx.java',
            }

        }
    }

//    packagingOptions {
//        exclude '**/generate/component/**'
//    }

    flavorDimensions "company", "channel"

    productFlavors {
        company1 { dimension "company" }
        company2 { dimension "company" }
        channel1 { dimension "channel" }
        channel2 { dimension "channel" }
    }
}

//tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile.class).configureEach {
//    println("xxxxxxxxxxxxxxxx")
//    println(it.name)
//    it.setExcludes( [ '**/com/x/**'])
//}

//tasks.withType(org.gradle.api.tasks.SourceTask.class).configureEach {
//    it.exclude('**/com/x/**')
//}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.core:core-ktx:1.0.2'
}