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

android {
    compileSdkVersion sdk_latest_version
    useLibrary 'android.test.runner'
    useLibrary 'android.test.base'

    defaultConfig {
        minSdkVersion 21
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        targetSdkVersion sdk_latest_version
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    buildFeatures {
        compose true
        buildConfig false
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8.toString()
        freeCompilerArgs = ['-Xjvm-default=all']
    }

    composeOptions {
        kotlinCompilerExtensionVersion compose_runtime_version
    }

    packagingOptions {
      exclude 'META-INF/AL2.0'
      exclude 'META-INF/LGPL2.1'
    }
}

dependencies {
    implementation "androidx.compose.ui:ui:$compose_ui_version"
    implementation "androidx.compose.ui:ui-unit:$compose_ui_version"
    implementation "androidx.compose.ui:ui-util:$compose_ui_version"
    implementation "androidx.compose.foundation:foundation-layout:$compose_ui_version"
    implementation "androidx.compose.foundation:foundation:$compose_ui_version"

    implementation project(':core')

    androidTestImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
    androidTestImplementation 'junit:junit:4.13.1'
    androidTestImplementation "androidx.compose.ui:ui-test:$compose_ui_version"
    androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_ui_version"
    androidTestImplementation "androidx.compose.material:material:$compose_ui_version"
    androidTestImplementation 'androidx.test:runner:1.3.0'
    androidTestImplementation 'androidx.test:rules:1.3.0'
    androidTestImplementation "androidx.activity:activity:1.3.0"
}

configurations.all {
    resolutionStrategy.dependencySubstitution {
        substitute module("androidx.constraintlayout:constraintlayout-core") using project(":core") because "we work with the unreleased development version"
    }
}

globalConfig {
    pomName = 'ConstraintLayout for Jetpack Compose'
    pomDescription = 'ConstraintLayout for Jetpack Compose'
}
