plugins {
  // Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin.
  id 'org.jetbrains.kotlin.jvm'
  id 'idea'
}

java {
  toolchain {
    languageVersion = JavaLanguageVersion.of(21)
  }
}

repositories {
  mavenCentral()
  maven {
    url 'https://artifacts.consensys.net/public/teku/maven/'
    content { includeGroupAndSubgroups('tech.pegasys') }
  }
  maven {
    url "https://hyperledger.jfrog.io/artifactory/besu-maven/"
    content { includeGroupAndSubgroups('org.hyperledger.besu') }
  }
  maven {
    url "https://artifacts.consensys.net/public/linea-besu/maven/"
    content {
      includeGroupAndSubgroups('org.hyperledger')
    }
  }
  maven {
    url "https://artifacts.consensys.net/public/maven/maven/"
  }
  // to allow locally published artifacts to be resolved uncomment enable mavenLocal() below
  // build.linea:blob-compressor:2.0.0-SNAPSHOT
  // useful to test WIP development versions
  //mavenLocal() {
  //  content {
  //    includeModule('build.linea', 'blob-compressor')
  //    includeModule('build.linea', 'shnarf-calculator')
  //  }
  //}
}

dependencies {
  //<testing>
  testImplementation platform("org.junit:junit-bom:${libs.versions.junit.get()}")
  testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${libs.versions.junit.get()}"
  testImplementation "org.junit.jupiter:junit-jupiter:${libs.versions.junit.get()}"
  testImplementation "org.assertj:assertj-core:${libs.versions.assertj.get()}"
  testImplementation "org.mockito:mockito-core:${libs.versions.mockito.get()}"
  testImplementation "org.mockito.kotlin:mockito-kotlin:${libs.versions.mockitoKotlin.get()}"
  testImplementation "org.awaitility:awaitility:${libs.versions.awaitility.get()}"
  //</testing>
}

tasks.named('test') {
  // Use JUnit Platform for unit tests.
  useJUnitPlatform()
}
