Disable javadoc generation on local development

Currently Dokka tasks running for Gradle plugins take quite a lot of
time slowing down local development cycle.

This change disables publishing javadoc on non-CI builds. This could be
lifted by putting 'kotlin.build.gradle.publish.javadocs=true' into
local.properties.

^KT-49227 In Progress
This commit is contained in:
Yahor Berdnikau
2022-02-25 14:08:38 +01:00
committed by Space
parent 4a5aee688e
commit d62c70298a
2 changed files with 11 additions and 2 deletions
@@ -51,3 +51,6 @@ val KotlinBuildProperties.isNativeRuntimeDebugInfoEnabled: Boolean
val KotlinBuildProperties.junit5NumberOfThreadsForParallelExecution: Int?
get() = (getOrNull("kotlin.test.junit5.maxParallelForks") as? String)?.toInt()
val KotlinBuildProperties.publishGradlePluginsJavadoc: Boolean
get() = getBoolean("kotlin.build.gradle.publish.javadocs", false)
+8 -2
View File
@@ -100,7 +100,13 @@ fun Project.configureGradlePluginCommonSettings() {
.extensions
.configure<JavaPluginExtension> {
withSourcesJar()
withJavadocJar()
// Enabling publishing docs jars only on CI build
// Currently dokka task runs non-incrementally and takes big amount of time
if (kotlinBuildProperties.publishGradlePluginsJavadoc ||
kotlinBuildProperties.isTeamcityBuild
) {
withJavadocJar()
}
}
}
@@ -163,4 +169,4 @@ fun Project.publishShadowedJar(
add(sourceSet.apiElementsConfigurationName, shadowJarTask)
}
}
}
}