79 lines
2.5 KiB
Groovy
79 lines
2.5 KiB
Groovy
plugins {
|
|
id "de.undercouch.download" version "4.1.1"
|
|
id 'com.github.jk1.tcdeps' version '1.2'
|
|
id "base"
|
|
}
|
|
|
|
evaluationDependsOnChildren()
|
|
|
|
|
|
configurations {
|
|
dokka
|
|
kotlin_sources
|
|
}
|
|
|
|
final String dokka_build = "611"
|
|
final String dokka_version = "0.10.2-SNAPSHOT"
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
maven { url = "https://teamcity.jetbrains.com/guestAuth/repository/download/Kotlin_Dokka_DokkaAntMavenGradle/$dokka_build/maven" }
|
|
}
|
|
|
|
dependencies {
|
|
dokka "org.jetbrains.dokka:dokka-fatjar:$dokka_version"
|
|
}
|
|
|
|
final File dokkaHome = new File(buildDir, "dokka-home")
|
|
task setupDokka(type: 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 extractAll(dependsOn: [setupDokka])
|
|
|
|
extractAll.dependsOn project('kotlin_big').tasks.getByName('extractLibs')
|
|
extractAll.dependsOn project('kotlin_big').tasks.getByName('extractSources')
|
|
extractAll.dependsOn project('kotlin_big').tasks.getByName('extractKotlinSources')
|
|
extractAll.dependsOn project('kotlin_native').tasks.getByName('extractKotlinNative')
|
|
extractAll.dependsOn project('ant').tasks.getByName('extractAnt')
|
|
|
|
task cleanupSources(type: Delete) {
|
|
dependsOn extractAll
|
|
doFirst {
|
|
def base = file("${pKotlinNative().kotlin_native_root}/runtime/src/main/kotlin")
|
|
delete(files("$base/kotlin/Functions.kt", "$base/kotlin/coroutines/SuspendFunctions.kt",
|
|
"$base/kotlin/reflect/KFunctions.kt"))
|
|
}
|
|
}
|
|
|
|
task setupCallDokka() { }
|
|
task callDokka(type: Exec, dependsOn: [extractAll, setupCallDokka, cleanupSources]) {
|
|
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))
|
|
}
|
|
}
|
|
|
|
setupCallDokka.doLast {
|
|
|
|
callDokka.commandLine = [
|
|
pAnt().ant_exe.path,
|
|
"-f", file("build-docs.xml").path,
|
|
"v2",
|
|
"-Dkotlin_root=${pKotlinBig().kotlin_root}",
|
|
"-Dkotlin_sources=${pKotlinBig().kotlin_sources}",
|
|
"-Dkotlin_libs=${pKotlinBig().kotlin_libs}",
|
|
"-Dkotlin_native_root=${pKotlinNative().kotlin_native_root}",
|
|
"-Dkotlin_native_linux=${pKotlinNative().kotlin_native_bin_linux}",
|
|
]
|
|
}
|