import java.nio.charset.StandardCharsets

plugins {
  id "java"
  id "java-library"
  id "org.sonarqube" version "2.8"
  id 'jacoco'
  id 'maven-publish'
  id 'signing'
  id 'org.jreleaser' version '1.18.0'
}

allprojects {
  apply plugin: 'java'
  apply plugin: 'jacoco'

  group = "com.github.erosb"
  version = "0.0.0-SNAPSHOT"
  description = "Forked version of openapi4j aiming for openapi 3.1 support"

  java {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
  }
  compileJava.options.encoding = StandardCharsets.UTF_8.toString()

  tasks.withType(JavaCompile) {
    options.encoding = StandardCharsets.UTF_8.toString()
  }

  repositories {
    mavenCentral()
    mavenLocal()
  }

  jar {
    manifest {
      attributes 'Build-date': new Date()
      attributes 'Implementation-Title': project.name
      attributes 'Implementation-Version': project.version
    }
  }

}

dependencies {
  api("com.fasterxml.jackson.core:jackson-databind:2.20.0")
  api("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.20.0")

  api("com.github.erosb:json-sKema:0.27.0")

  testImplementation("junit:junit:4.13.2")
  testImplementation("org.skyscreamer:jsonassert:1.5.0")

  compileOnly("org.json:json:20250517")
  compileOnly("commons-fileupload:commons-fileupload:1.5")
  testImplementation("org.json:json:20250517")
  testImplementation("commons-fileupload:commons-fileupload:1.5")
}


sonarqube {
  properties {
    property "sonar.coverage.jacoco.xmlReportPaths", "${buildDir}/reports/jacoco/codeCoverageReport/codeCoverageReport.xml"
  }
}

apply from: "./publish.gradle"
