plugins { id "com.jfrog.bintray" version "1.4" } allprojects { buildscript { repositories { mavenCentral() jcenter() maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } } } repositories { mavenCentral() maven { url "https://dl.bintray.com/kotlin/kotlin-eap" } maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } } } apply plugin: 'maven-publish' task updatePom << { def parser = new XmlParser() def pomFile = new File("maven-plugin/pom.xml") def pom = parser.parse(pomFile) pom.version[0].setValue(dokka_version) pom.properties.kotlinVersion[0].setValue(kotlin_version) pomFile.setText(groovy.xml.XmlUtil.serialize(pom)) } task buildMavenPlugin << { def process = "mvn clean package".execute(null, new File("maven-plugin")) process.waitFor() def mvnOutput = process.text def exitValue = process.exitValue() if (exitValue != 0) { throw new IOException("Failed to run Maven command: exit value $exitValue, output $mvnOutput") } } task prepareMavenPluginUpload << { def uploadDir = new File("maven-plugin/upload") uploadDir.delete() uploadDir.mkdirs() def releaseFileName = "dokka-maven-plugin-${dokka_version}" new File("maven-plugin/target/${releaseFileName}.jar").renameTo(new File(uploadDir, "${releaseFileName}.jar")) new File(uploadDir, "${releaseFileName}.pom").bytes = new File("maven-plugin/pom.xml").bytes } buildMavenPlugin.dependsOn(updatePom) bintray { user = System.getenv('BINTRAY_USER') key = System.getenv('BINTRAY_KEY') pkg { repo = dokka_eap.toBoolean() ? 'kotlin-eap' : 'dokka' name = 'dokka' userOrg = 'kotlin' desc = 'Dokka, the Kotlin documentation tool' vcsUrl = 'https://github.com/kotlin/dokka.git' licenses = ['Apache-2.0'] version { name = dokka_version } } filesSpec { from 'maven-plugin/upload' into "org/jetbrains/dokka/dokka-maven-plugin/${dokka_version}" } }