plugins {
  id 'java'
  id 'kotlin' // need this for test classpath to work
}
repositories {
  mavenCentral()
}
dependencies {
  implementation 'io.jooby:jooby:3.2.3'
  implementation 'io.jooby:jooby-netty:3.2.3'
  implementation 'jakarta.mail:jakarta.mail-api:2.1.3'
  testImplementation 'io.jooby:jooby-test:3.2.3'
  testImplementation "org.junit.jupiter:junit-jupiter:$ver_JUNIT_USE"
  testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
  testImplementation 'io.rest-assured:rest-assured:5.5.0'
  testImplementation 'org.assertj:assertj-core:3.27.3'
  testImplementation project(':selfie-runner-junit5')
  testImplementation 'org.jsoup:jsoup:1.17.2'
  testImplementation 'com.vladsch.flexmark:flexmark-html2md-converter:0.64.8'
}
test {
  useJUnitPlatform()
  environment project.properties.subMap(["selfie"])
  inputs.files(fileTree('src/test') {
    include '**/*.ss'
  })
}
apply plugin: 'com.diffplug.spotless'
spotless {
  java {
    googleJavaFormat()
    replaceRegex("dense toMatchDisk", "\n(\\s*)\\.toMatchDisk\\(", ".toMatchDisk(")
    replaceRegex("dense toBe", "\n(\\s*)\\.toBe\\(", ".toBe(")
  }
}
tasks.register('exampleAppJvm', JavaExec) {
  dependsOn 'testClasses'
  description = 'Run example app in dev mode'
  classpath = sourceSets.test.runtimeClasspath
  mainClass = 'com.example.Dev'
  args = ['dev']
}
tasks.withType(JavaCompile) {
  options.encoding = 'UTF-8'
}