group 'org.jetbrains.dokka' version dokka_version import proguard.gradle.ProGuardTask buildscript { repositories { jcenter() } dependencies { classpath 'net.sf.proguard:proguard-gradle:5.2.1' } } apply plugin: 'java' apply plugin: 'maven-publish' apply plugin: 'com.jfrog.bintray' task wrapper(type: Wrapper) { gradleVersion = '2.5' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } task sourceJar(type: Jar) { from fileTree('../src') } task proguard(type: ProGuardTask) { configuration 'dokka.pro' injars 'build/libs/dokka-fatjar-${dokka_version}.jar' outjars 'build/libs/dokka-fatjar-${dokka_version}.out.jar' } proguard.doLast { new File('build/libs/dokka-fatjar-${dokka_version}.jar').renameTo('build/libs/dokka-fatjar-${dokka_version}.in.jar') new File('build/libs/dokka-fatjar-${dokka_version}.out.jar').renameTo('build/libs/dokka-fatjar-${dokka_version}.jar') } jar { manifest { attributes "Implementation-Title": "Dokka Kotlin Documentation tool" attributes "Implementation-Version": version attributes "Main-Class" : "org.jetbrains.dokka.MainKt" } duplicatesStrategy = DuplicatesStrategy.EXCLUDE fileTree(project.file('../lib')).filter { it.name.endsWith('.jar') && !it.name.contains("-sources") && !it.name.contains("-javadoc") }.each { from (zipTree(it)) { exclude 'META-INF/MANIFEST.MF' exclude 'META-INF/*.SF' exclude 'META-INF/*.DSA' exclude 'META-INF/*.RSA' exclude '**/*.kt' exclude '**/*.java' exclude '**/*.md' } } ['dokka.jar', 'dokka-ant.jar'].each { from (zipTree(project.file("../out/$it"))) { exclude 'META-INF/MANIFEST.MF' exclude 'META-INF/*.SF' exclude 'META-INF/*.DSA' exclude 'META-INF/*.RSA' exclude '**/*.kt' exclude '**/*.java' exclude '**/*.md' } } } publishing { publications { maven(MavenPublication) { from components.java artifact sourceJar { classifier "sources" } } } } bintray { user = System.getenv('BINTRAY_USER') key = System.getenv('BINTRAY_KEY') pkg { repo = '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 } } publications = ['maven'] }