buildscript {
  buildscript {
    repositories {
      mavenLocal()
      jcenter()
      maven { setUrl("https://plugins.gradle.org/m2/") }
    }
  }
  dependencies {
    classpath 'com.fkorotkov:gradle-libraries-plugin:1.0'
    classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72'
  }
}

allprojects {
  buildscript {
    repositories {
      mavenLocal()
      jcenter()
      maven { setUrl("https://plugins.gradle.org/m2/") }
    }
  }
  repositories {
    mavenLocal()
    jcenter()
    mavenCentral()
    maven { setUrl("https://kotlin.bintray.com/kotlinx") }
  }
}

apply plugin: "com.fkorotkov.libraries"

updateLibraries.resolutionStrategy = {
  componentSelection { rules ->
    rules.all { ComponentSelection selection ->
      boolean rejected = ['dev', 'eap', 'M1'].any { qualifier ->
        selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
      }
      if (rejected) {
        selection.reject('dev version')
      }
    }
  }
}

subprojects {
  apply plugin: "com.fkorotkov.libraries"
  apply plugin: "java-library"
  apply plugin: "kotlin"

  sourceCompatibility = JavaVersion.VERSION_11
  targetCompatibility = JavaVersion.VERSION_11

  test {
    testLogging {
      exceptionFormat = 'full'
    }
  }
}
