buildscript {
  repositories {
    jcenter()
    mavenCentral()
  }

  dependencies {
    classpath 'com.vanniktech:gradle-maven-publish-plugin:0.14.2'
    classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.4.30'
  }
}

plugins {
  id 'java'
  id 'jacoco'
  id 'org.jetbrains.kotlin.jvm' version '1.8.0'
}

ext {
  RELEASE_REPOSITORY_URL = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
  SNAPSHOT_REPOSITORY_URL = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
}

apply plugin: "org.jetbrains.dokka"
apply plugin: "com.vanniktech.maven.publish"

group 'com.github.dsrees'
version '1.3.1'

sourceCompatibility = 1.8

repositories {
  jcenter()
  mavenCentral()
}

test {
  // JUnit 5 Support
  useJUnitPlatform()

  // This allows us see tests execution progress in the output on the CI.
  testLogging {
    events 'passed', 'skipped', 'failed', 'standardOut', 'standardError'
    exceptionFormat 'full'
  }

}

dependencies {
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
  implementation "com.google.code.gson:gson:2.10.1"
  implementation "com.squareup.okhttp3:okhttp:4.11.0"

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

  testImplementation group: 'com.google.truth', name: 'truth', version: '1.1.3'
  testImplementation group: 'org.mockito', name: 'mockito-core', version: '4.0.0'
  testImplementation group: 'org.mockito.kotlin', name: 'mockito-kotlin', version: '4.0.0'
}

jacocoTestReport {
  reports {
    xml.enabled true
    html.enabled false
  }
}

compileKotlin {
  kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
  kotlinOptions.jvmTarget = "1.8"
}

