plugins { id "de.undercouch.download" version "4.1.1" id "base" } evaluationDependsOnChildren() configurations { dokka } final String dokka_version = findProperty("dokka_version") ?: "0.10.2-stdlib-2" repositories { mavenLocal() if (dokka_version.contains("stdlib")) { maven { url "https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:KotlinTools_Dokka_DokkaForStdlib),number:$dokka_version,pinned:true/artifacts/content/maven/" } } } dependencies { dokka "org.jetbrains.dokka:dokka-fatjar:$dokka_version" } final File dokkaHome = new File(buildDir, "dokka-home") tasks.register("setupDokka", Sync) { from configurations.dokka into dokkaHome } def pAnt() { return project('ant').extensions } def pKotlinBig() { return project('kotlin_big').extensions } def pKotlinNative() { return project('kotlin_native').extensions } task setupCallDokka() { dependsOn setupDokka dependsOn project('ant').tasks.getByName('extractAnt') dependsOn project('kotlin_big').tasks.getByName('extractLibs') } tasks.register("callDokka", Exec) { dependsOn(setupCallDokka) workingDir = projectDir // -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 environment("ANT_OPTS", "-Xmx3G") environment("JAVA_HOME", System.getProperty("java.home")) doFirst { def logFile = file("$buildDir/dokka.log") standardOutput = new org.apache.tools.ant.util.TeeOutputStream(System.out, new FileOutputStream(logFile)) pKotlinBig().commentOutSinceKotlinForNewEnums.call() } doLast { pKotlinBig().uncommentSinceKotlinForNewEnums.call() } } setupCallDokka.doLast { callDokka.commandLine = [ pAnt().ant_exe.path, "-f", file("build-docs.xml").path, "v2", "-Dgithub_revision=${pKotlinBig().github_revision}", "-Dkotlin_root=${pKotlinBig().kotlin_root}", "-Dkotlin_libs=${pKotlinBig().kotlin_libs}", "-Dkotlin_native_root=${pKotlinNative().kotlin_native_root}", "-Dkotlin_native_libs=${pKotlinNative().kotlin_native_libs}", ] }