plugins {
    id "java-library"
    id "pl.allegro.tech.build.axion-release" version "$axionReleaseVersion"
    id "com.vanniktech.maven.publish" version "$mavenPublishVersion"
}

repositories {
	mavenLocal()
	mavenCentral()
}

scmVersion { tag { prefix.set("") }}


project.version = scmVersion.version
project.group = 'de.esoco'
project.description = 'A pure Java implementation of coroutines'

sourceCompatibility = 1.8

dependencies {
    api "org.obrel:objectrelations:$obrelVersion"

    testImplementation platform("org.junit:junit-bom:$junitVersion")
    testImplementation 'org.junit.jupiter:junit-jupiter'
}

task sourceJar(type: Jar, dependsOn: classes) {
    from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
    from javadoc.destinationDir
}

artifacts {
    archives sourceJar
    archives javadocJar
}

test { useJUnitPlatform() }

mavenPublishing {
  coordinates("$project.group", "$project.name", "$project.version")

  pom {
    name = "$project.name"
    description = "$project.description"
    inceptionYear = "2018"
    url = "https://github.com/esoco/${project.name}"
    licenses {
      license {
        name = "The Apache License, Version 2.0"
        url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
        distribution = "http://www.apache.org/licenses/LICENSE-2.0.txt"
      }
    }
    developers {
      developer {
        id = "esoco"
        name = "esoco GmbH"
        url = "https://esoco.de/"
      }
    }
    scm {
      url = "https://github.com/esoco/${project.name}/"
      connection = "scm:git:git://github.com/esoco/${project.name}.git"
      developerConnection = "scm:git:ssh://git@github.com/esoco/${project.name}.git"
    }
  }
}