plugins {
  id 'org.jetbrains.kotlin.jvm'
  id 'com.diffplug.spotless'
}
repositories {
  mavenCentral()
}
spotless {
  enforceCheck = false
  kotlin {
    target 'src/**/*.kt'
    toggleOffOn()
    licenseHeader ''
    ktfmt()
    replaceRegex("test one-liner", "@Test\n(\\s*)fun ", "@Test fun ")
    replaceRegex("test harness comments", "\n(\\s)*//", "\n//")
  }
}

dependencies {
  testImplementation project(':selfie-runner-junit5')
  testCompileOnly "junit:junit:4.13.2"
  testImplementation "org.junit.jupiter:junit-jupiter-api:${ver_JUNIT_USE}"
  testImplementation "org.junit.vintage:junit-vintage-engine:${ver_JUNIT_USE}"
  testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
// this project is just a test environment for a different project
test {
  useJUnitPlatform()
  enabled = findProperty("underTest") == "true"

  testLogging.showStandardStreams = true
  // the snapshots are both output and input, for this harness best if the test just always runs
  outputs.upToDateWhen { false }
  // defaults to 'write'
  systemProperty 'selfie', findProperty('selfie')
  systemProperty 'selfie.settings', findProperty('selfie.settings')
}