buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
    }
}


plugins {
    id 'org.jetbrains.kotlin.jvm' version '1.5.10'
    id 'signing'
    id 'maven-publish'
    id 'io.codearte.nexus-staging' version '0.21.0'

}

apply plugin: 'com.bmuschko.nexus'

apply plugin: "kotlin-kapt"
apply plugin: "maven"

allprojects {


    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://maven.google.com" }
        maven { url "https://plugins.gradle.org/m2/" }
    }
}

group = "de.jensklingenberg"
archivesBaseName = "mpapt-runtime"
version = "0.8.8"

install {
    repositories.mavenInstaller {
        pom.artifactId = archivesBaseName
    }
}


compileKotlin {
    kotlinOptions {
        jvmTarget = "1.8"
    }
}


dependencies {
    compileOnly "org.jetbrains.kotlin:kotlin-compiler-embeddable:1.5.10"
    compileOnly "com.google.auto.service:auto-service:1.0"
    kapt "com.google.auto.service:auto-service:1.0"
}


build.finalizedBy(install)



modifyPom {
    project {
        name 'MpApt'
        description 'Kotlin Native/JS/JVM Annotation Processor library'
        url 'https://github.com/Foso/MpApt'
        inceptionYear '2019'
        scm {
            url 'https://github.com/Foso/MpApt'
            connection 'scm:https://github.com/Foso/MpApt.git'
            developerConnection 'scm:git://github.com/Foso/MpApt.git'
        }
        licenses {
            license {
                name 'The Apache Software License, Version 2.0'
                url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                distribution 'repo'
            }
        }
        developers {
            developer {
                id 'Foso'
                name 'Jens Klingenberg'
                email 'mail@jensklingenberg.de'
            }
        }
    }
}
extraArchive {
    sources = true
    tests = true
    javadoc = true
}
nexus {
    sign = false//true
    repositoryUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
    snapshotRepositoryUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
}

nexusStaging {
    packageGroup = "de.jensklingenberg" //optional if packageGroup == project.getGroup()
    stagingProfileId = "d56228753311b0" //when not defined will be got from server using "packageGroup"
}