/*
 * Copyright Consensys Software Inc.
 *
 * This file is dual-licensed under either the MIT license or Apache License 2.0.
 * See the LICENSE-MIT and LICENSE-APACHE files in the repository root for details.
 *
 * SPDX-License-Identifier: MIT OR Apache-2.0
 */

plugins {
  alias(libs.plugins.besuPluginDistribution)
  alias(libs.plugins.lombok)
  alias(libs.plugins.gradleVersions)
}

group = 'net.consensys.linea.besu.plugin'

def lineaSequencerProject = project(lineaSequencerProjectPath)
apply from: lineaSequencerProject.file("gradle/java.gradle")
apply from: lineaSequencerProject.file("gradle/dependency-management.gradle")
apply from: lineaSequencerProject.file("gradle/lint.gradle")

dependencies {
  implementation "net.consensys.linea.zktracer:arithmetization:${libs.versions.arithmetization.get()}"
  implementation "build.linea:blob-compressor:${libs.versions.blobCompressor.get()}"
  implementation "build.linea.internal:kotlin:${libs.versions.lineaKotlin.get()}"

  testImplementation 'org.assertj:assertj-core'

  testImplementation 'org.junit.jupiter:junit-jupiter-api'
  testImplementation 'org.junit.jupiter:junit-jupiter-params'
  testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'

  testImplementation 'org.mockito:mockito-core'
  testImplementation 'org.mockito:mockito-junit-jupiter'

  testImplementation "org.wiremock:wiremock:${libs.versions.wiremock.get()}"
}

apply from: lineaSequencerProject.file("gradle/dist.gradle")

distZip {
  archiveBaseName = 'linea-sequencer'
}

// Simple artifacts task that runs jar and distPlugin
task artifacts {
  group = 'Build'
  description = 'Creates all build artifacts (JAR and distribution ZIP)'
  dependsOn 'jar', 'distZip'
}

test {
  useJUnitPlatform()
  // Disable parallel execution for this module due to WireMock test interference
  systemProperty "junit.jupiter.execution.parallel.enabled", "false"
}
