diff options
45 files changed, 769 insertions, 301 deletions
diff --git a/.github/workflows/gh-actions-artifacts-snapshots.yml b/.github/workflows/gh-actions-artifacts-snapshots.yml index e073dae3..99b00636 100644 --- a/.github/workflows/gh-actions-artifacts-snapshots.yml +++ b/.github/workflows/gh-actions-artifacts-snapshots.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 12 + java-version: 11 cache: 'maven' - name: Document coroutines uses: gradle/gradle-build-action@v2 @@ -44,7 +44,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 12 + java-version: 11 cache: 'maven' - name: Document serialization uses: gradle/gradle-build-action@v2 @@ -70,7 +70,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 12 + java-version: 11 cache: 'maven' - name: Document biojava-core uses: gradle/gradle-build-action@v2 diff --git a/.github/workflows/s3-snapshots.yml b/.github/workflows/s3-snapshots.yml index 43efbf63..6a170211 100644 --- a/.github/workflows/s3-snapshots.yml +++ b/.github/workflows/s3-snapshots.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 12 + java-version: 11 cache: 'maven' - name: Document coroutines uses: gradle/gradle-build-action@v2 @@ -48,7 +48,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 12 + java-version: 11 cache: 'maven' - name: Document serialization uses: gradle/gradle-build-action@v2 @@ -78,7 +78,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 12 + java-version: 11 cache: 'maven' - name: Document biojava-core uses: gradle/gradle-build-action@v2 diff --git a/build.gradle.kts b/build.gradle.kts index 1deb02f6..08373920 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,76 +1,21 @@ -import org.jetbrains.* -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.jetbrains.ValidatePublications +import org.jetbrains.publicationChannels plugins { - kotlin("jvm") apply false - id("java") - id("org.jetbrains.dokka") version "1.8.10" + org.jetbrains.conventions.base + id("org.jetbrains.dokka") id("io.github.gradle-nexus.publish-plugin") -} - -val dokka_version: String by project - -allprojects { - configureDokkaVersion() - group = "org.jetbrains.dokka" - version = dokka_version - - - val language_version: String by project - tasks.withType(KotlinCompile::class).all { - kotlinOptions { - freeCompilerArgs = freeCompilerArgs + listOf( - "-opt-in=kotlin.RequiresOptIn", - "-Xjsr305=strict", - "-Xskip-metadata-version-check", - // need 1.4 support, otherwise there might be problems with Gradle 6.x (it's bundling Kotlin 1.4) - "-Xsuppress-version-warnings" - ) - allWarningsAsErrors = true - languageVersion = language_version - apiVersion = language_version - jvmTarget = "1.8" - } - } - - repositories { - mavenCentral() - } + id("org.jetbrains.kotlinx.binary-compatibility-validator") } -subprojects { - apply { - plugin("org.jetbrains.kotlin.jvm") - plugin("java") - plugin("signing") - plugin("org.jetbrains.dokka") - } - - // Gradle metadata - java { - @Suppress("UnstableApiUsage") - withSourcesJar() - targetCompatibility = JavaVersion.VERSION_1_8 - } - - tasks { - val dokkaOutputDir = "$buildDir/dokka" +val dokka_version: String by project - dokkaHtml { - onlyIf { !isLocalPublication } - outputDirectory.set(file(dokkaOutputDir)) - } +group = "org.jetbrains.dokka" +version = dokka_version - register<Jar>("javadocJar") { - archiveClassifier.set("javadoc") - dependsOn(dokkaHtml) - from(dokkaOutputDir) - } - } -} -println("Publication version: $dokka_version") +logger.lifecycle("Publication version: $dokka_version") tasks.register<ValidatePublications>("validatePublications") nexusPublishing { @@ -82,8 +27,28 @@ nexusPublishing { } } -tasks.maybeCreate("dokkaPublish").run { +val dokkaPublish by tasks.registering { if (publicationChannels.any { it.isMavenRepository() }) { finalizedBy(tasks.named("closeAndReleaseSonatypeStagingRepository")) } } + +apiValidation { + // note that subprojects are ignored by their name, not their path https://github.com/Kotlin/binary-compatibility-validator/issues/16 + ignoredProjects += setOf( + // NAME PATH + "search-component", // :plugins:search-component + "frontend", // :plugins:base:frontend + + "kotlin-analysis", // :kotlin-analysis + "compiler-dependency", // :kotlin-analysis:compiler-dependency + "intellij-dependency", // :kotlin-analysis:intellij-dependency + + "integration-tests", // :integration-tests + "gradle", // :integration-tests:gradle + "cli", // :integration-tests:cli + "maven", // integration-tests:maven + + "test-utils", // :test-utils + ) +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 90ccf158..00733d64 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,13 +1,32 @@ +import java.util.* + plugins { `kotlin-dsl` } -repositories { - gradlePluginPortal() +kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of(8)) + } +} + +// TODO define versions in Gradle Version Catalog https://github.com/Kotlin/dokka/pull/2884 +val properties = file("../gradle.properties").inputStream().use { + Properties().apply { load(it) } } +val kotlinVersion = properties["kotlin_version"] + dependencies { - implementation("com.github.jengelman.gradle.plugins:shadow:2.0.4") - implementation("org.jetbrains.kotlinx:binary-compatibility-validator:0.10.1") + // Import Gradle Plugins that will be used in the buildSrc pre-compiled script plugins, and any `build.gradle.kts` + // files in the project. + // Use their Maven coordinates (plus versions), not Gradle plugin IDs! + // This should be the only place that Gradle plugin versions are defined, so they are aligned across all build scripts + + implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") + implementation("gradle.plugin.com.github.johnrengelman:shadow:7.1.2") + implementation("org.jetbrains.kotlinx:binary-compatibility-validator:0.12.1") implementation("io.github.gradle-nexus:publish-plugin:1.1.0") + implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.8.10") + implementation("com.gradle.publish:plugin-publish-plugin:0.20.0") } diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts new file mode 100644 index 00000000..2144de34 --- /dev/null +++ b/buildSrc/settings.gradle.kts @@ -0,0 +1,17 @@ +rootProject.name = "buildSrc" + +pluginManagement { + repositories { + gradlePluginPortal() + mavenCentral() + } +} + +@Suppress("UnstableApiUsage") +dependencyResolutionManagement { + repositories { + mavenCentral() + google() + gradlePluginPortal() + } +} diff --git a/buildSrc/src/main/kotlin/org/jetbrains/binaryCompatibility.kt b/buildSrc/src/main/kotlin/org/jetbrains/binaryCompatibility.kt deleted file mode 100644 index 0b8386b6..00000000 --- a/buildSrc/src/main/kotlin/org/jetbrains/binaryCompatibility.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.jetbrains - -import kotlinx.validation.ApiValidationExtension -import org.gradle.api.Project -import org.gradle.kotlin.dsl.configure - -internal object BinaryCompatibilityConfig { - val ignoredPublications = setOf("kotlinAnalysisIntelliJ", "kotlinAnalysis", "kotlinAnalysisCompiler") - val ignoredSubprojects = setOf( - "search-component", - "compiler-dependency", - "intellij-dependency", - "kotlin-analysis", - "frontend" - ) -} - -internal fun Project.registerBinaryCompatibilityCheck(publicationName: String) { - if (publicationName !in BinaryCompatibilityConfig.ignoredPublications) { - if (tasks.findByName("apiBuild") == null) { - plugins.apply(kotlinx.validation.BinaryCompatibilityValidatorPlugin::class.java) - configure<ApiValidationExtension> { - ignoredProjects.addAll( - BinaryCompatibilityConfig.ignoredSubprojects.intersect(allprojects.map { it.name }.toSet()) - ) - } - } - } -}
\ No newline at end of file diff --git a/buildSrc/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts b/buildSrc/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts new file mode 100644 index 00000000..3addac74 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts @@ -0,0 +1,22 @@ +package org.jetbrains.conventions + +/** + * Base configuration for Java projects. + * + * This convention plugin contains shared Java config for both the [KotlinJvmPlugin] convention plugin and + * the Gradle Plugin subproject (which cannot have the `kotlin("jvm")` plugin applied). + */ + +plugins { + `java` +} + +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(8)) + } +} + +java { + withSourcesJar() +} diff --git a/buildSrc/src/main/kotlin/org/jetbrains/conventions/base.gradle.kts b/buildSrc/src/main/kotlin/org/jetbrains/conventions/base.gradle.kts new file mode 100644 index 00000000..c4352d16 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/jetbrains/conventions/base.gradle.kts @@ -0,0 +1,12 @@ +package org.jetbrains.conventions + +plugins { + base +} + +// common Gradle configuration that should be applied to all projects + +if (project != rootProject) { + project.group = rootProject.group + project.version = rootProject.version +} diff --git a/buildSrc/src/main/kotlin/org/jetbrains/conventions/dokka-integration-test.gradle.kts b/buildSrc/src/main/kotlin/org/jetbrains/conventions/dokka-integration-test.gradle.kts new file mode 100644 index 00000000..612502cd --- /dev/null +++ b/buildSrc/src/main/kotlin/org/jetbrains/conventions/dokka-integration-test.gradle.kts @@ -0,0 +1,75 @@ +package org.jetbrains.conventions + +import org.gradle.api.tasks.testing.logging.TestExceptionFormat +import org.gradle.api.tasks.testing.logging.TestLogEvent + +plugins { + id("org.jetbrains.conventions.kotlin-jvm") +} + +val integrationTestSourceSet = sourceSets.create("integrationTest") { + compileClasspath += sourceSets.main.get().output + runtimeClasspath += sourceSets.main.get().output +} + +val integrationTestImplementation by configurations.getting { + extendsFrom(configurations.implementation.get()) +} + +val integrationTestRuntimeOnly by configurations.getting { + extendsFrom(configurations.runtimeOnly.get()) +} + +/** + * Dokka's integration test task is not cacheable because the HTML outputs + * it produces when running the tests are used for showcasing resulting documentation, + * which does not work well with caching. + * + * At the moment there are two problems that do not allow to make it cacheable: + * + * 1. The task's inputs are such that changes in Dokka's code do not invalidate the cache, + * because it is run with the same version of Dokka (`"DOKKA_VERSION"`) on the same + * test project inputs. + * 2. The tests generate HTML output which is then used to showcase documentation. + * The outputs are usually copied to a location from which it will be served. + * However, if the test is cacheable, it produces no outputs, so no documentation + * to showcase. It needs to be broken into two separate tasks: one cacheable for running + * the tests and producing HTML output, and another non-cacheable for copying the output. + * + * @see [org.jetbrains.dokka.it.TestOutputCopier] for more details on showcasing documentation + */ +@DisableCachingByDefault(because = "Contains incorrect inputs/outputs configuration, see the KDoc for details") +abstract class NonCacheableIntegrationTest : Test() + +val integrationTest by tasks.registering(NonCacheableIntegrationTest::class) { + maxHeapSize = "2G" + description = "Runs integration tests." + group = "verification" + useJUnit() + + testClassesDirs = integrationTestSourceSet.output.classesDirs + classpath = integrationTestSourceSet.runtimeClasspath + + setForkEvery(1) + project.properties["dokka_integration_test_parallelism"]?.toString()?.toIntOrNull()?.let { parallelism -> + maxParallelForks = parallelism + } + environment( + "isExhaustive", + project.properties["dokka_integration_test_is_exhaustive"]?.toString()?.toBoolean() + ?: System.getenv("DOKKA_INTEGRATION_TEST_IS_EXHAUSTIVE")?.toBoolean() + ?: false.toString() + ) + + testLogging { + exceptionFormat = TestExceptionFormat.FULL + events(TestLogEvent.SKIPPED, TestLogEvent.FAILED) + showExceptions = true + showCauses = true + showStackTraces = true + } +} + +tasks.check { + dependsOn(integrationTest) +} diff --git a/buildSrc/src/main/kotlin/org/jetbrains/conventions/dokka.gradle.kts b/buildSrc/src/main/kotlin/org/jetbrains/conventions/dokka.gradle.kts new file mode 100644 index 00000000..9a193cbb --- /dev/null +++ b/buildSrc/src/main/kotlin/org/jetbrains/conventions/dokka.gradle.kts @@ -0,0 +1,13 @@ +package org.jetbrains.conventions + +import org.gradle.kotlin.dsl.invoke +import org.jetbrains.isLocalPublication + +plugins { + id("org.jetbrains.dokka") +} + +tasks.dokkaHtml { + onlyIf { !isLocalPublication } + outputDirectory.set(layout.buildDirectory.dir("dokka").map { it.asFile }) +} diff --git a/buildSrc/src/main/kotlin/org/jetbrains/conventions/kotlin-jvm.gradle.kts b/buildSrc/src/main/kotlin/org/jetbrains/conventions/kotlin-jvm.gradle.kts new file mode 100644 index 00000000..bd33df22 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/jetbrains/conventions/kotlin-jvm.gradle.kts @@ -0,0 +1,29 @@ +package org.jetbrains.conventions + +import org.jetbrains.configureDokkaVersion +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + id("org.jetbrains.conventions.base") + id("org.jetbrains.conventions.base-java") + kotlin("jvm") +} + +configureDokkaVersion() + +val language_version: String by project + +tasks.withType<KotlinCompile>().configureEach { + kotlinOptions { + freeCompilerArgs += listOf( + "-opt-in=kotlin.RequiresOptIn", + "-Xjsr305=strict", + "-Xskip-metadata-version-check", + // need 1.4 support, otherwise there might be problems with Gradle 6.x (it's bundling Kotlin 1.4) + "-Xsuppress-version-warnings" + ) + allWarningsAsErrors = true + languageVersion = language_version + apiVersion = language_version + } +} diff --git a/buildSrc/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts b/buildSrc/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts new file mode 100644 index 00000000..7007fd9e --- /dev/null +++ b/buildSrc/src/main/kotlin/org/jetbrains/conventions/maven-publish.gradle.kts @@ -0,0 +1,30 @@ +package org.jetbrains.conventions + +plugins { + id("org.jetbrains.conventions.base") + `maven-publish` + signing + id("org.jetbrains.conventions.dokka") +} + +val javadocJar by tasks.registering(Jar::class) { + group = JavaBasePlugin.DOCUMENTATION_GROUP + description = "Assembles a Javadoc JAR using Dokka HTML" + archiveClassifier.set("javadoc") + from(tasks.dokkaHtml) +} + +publishing { + repositories { + // Publish to a project-local Maven directory, for verification. To test, run: + // ./gradlew publishAllPublicationsToMavenProjectLocalRepository + // and check $rootDir/build/maven-project-local + maven(rootProject.layout.buildDirectory.dir("maven-project-local")) { + name = "MavenProjectLocal" + } + } + + publications.withType<MavenPublication>().configureEach { + artifact(javadocJar) + } +} diff --git a/buildSrc/src/main/kotlin/org/jetbrains/publication.kt b/buildSrc/src/main/kotlin/org/jetbrains/publication.kt index eb45e255..60d91c33 100644 --- a/buildSrc/src/main/kotlin/org/jetbrains/publication.kt +++ b/buildSrc/src/main/kotlin/org/jetbrains/publication.kt @@ -2,9 +2,13 @@ package org.jetbrains import com.github.jengelman.gradle.plugins.shadow.ShadowExtension import org.gradle.api.Project +import org.gradle.api.plugins.JavaBasePlugin import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPublication import org.gradle.api.publish.maven.tasks.PublishToMavenRepository +import org.gradle.api.tasks.TaskContainer +import org.gradle.api.tasks.TaskProvider +import org.gradle.api.tasks.bundling.Jar import org.gradle.kotlin.dsl.* import org.gradle.plugins.signing.SigningExtension import org.jetbrains.DokkaPublicationChannel.* @@ -33,7 +37,6 @@ fun Project.registerDokkaArtifactPublication(publicationName: String, configure: artifact(tasks["sourcesJar"]) } } - artifact(tasks["javadocJar"]) configurePom("Dokka ${project.name}") } } @@ -42,7 +45,6 @@ fun Project.registerDokkaArtifactPublication(publicationName: String, configure: configureSpacePublicationIfNecessary(publicationName) configureSonatypePublicationIfNecessary(publicationName) createDokkaPublishTaskIfNecessary() - registerBinaryCompatibilityCheck(publicationName) } fun Project.configureSpacePublicationIfNecessary(vararg publications: String) { diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 41db29d3..1d7c1f17 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -2,7 +2,8 @@ import org.jetbrains.dokkaVersion import org.jetbrains.registerDokkaArtifactPublication plugins { - `maven-publish` + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` } dependencies { diff --git a/core/content-matcher-test-utils/build.gradle.kts b/core/content-matcher-test-utils/build.gradle.kts index 07d4bed9..1a95f1cd 100644 --- a/core/content-matcher-test-utils/build.gradle.kts +++ b/core/content-matcher-test-utils/build.gradle.kts @@ -1,3 +1,7 @@ +plugins { + org.jetbrains.conventions.`kotlin-jvm` +} + dependencies { implementation(project(":core:test-api")) implementation(kotlin("stdlib-jdk8")) diff --git a/core/test-api/build.gradle.kts b/core/test-api/build.gradle.kts index cb36dc20..b3f57010 100644 --- a/core/test-api/build.gradle.kts +++ b/core/test-api/build.gradle.kts @@ -1,7 +1,8 @@ import org.jetbrains.registerDokkaArtifactPublication plugins { - `maven-publish` + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` } dependencies { diff --git a/integration-tests/build.gradle.kts b/integration-tests/build.gradle.kts index 226b4b6f..80c07b37 100644 --- a/integration-tests/build.gradle.kts +++ b/integration-tests/build.gradle.kts @@ -1,80 +1,5 @@ -import org.gradle.api.tasks.testing.logging.TestExceptionFormat -import org.gradle.api.tasks.testing.logging.TestLogEvent - -subprojects { - sourceSets { - create("integrationTest") { - compileClasspath += sourceSets.main.get().output - runtimeClasspath += sourceSets.main.get().output - } - } - - configurations.getByName("integrationTestImplementation") { - extendsFrom(configurations.implementation.get()) - } - - configurations.getByName("integrationTestRuntimeOnly") { - extendsFrom(configurations.runtimeOnly.get()) - } - - dependencies { - implementation(project(":integration-tests")) - } - - /** - * Dokka's integration test task is not cacheable because the HTML outputs - * it produces when running the tests are used for showcasing resulting documentation, - * which does not work well with caching. - * - * At the moment there are two problems that do not allow to make it cacheable: - * - * 1. The task's inputs are such that changes in Dokka's code do not invalidate the cache, - * because it is run with the same version of Dokka ("DOKKA_VERSION") on the same - * test project inputs. - * 2. The tests generate HTML output which is then used to showcase documentation. - * The outputs are usually copied to a location from which it will be served. - * However, if the test is cacheable, it produces no outputs, so no documentation - * to showcase. It needs to be broken into two separate tasks: one cacheable for running - * the tests and producing HTML output, and another non-cacheable for copying the output. - * - * @see [org.jetbrains.dokka.it.TestOutputCopier] for more details on showcasing documentation - */ - @DisableCachingByDefault(because = "Contains incorrect inputs/outputs configuration, see the KDoc for details") - abstract class NonCacheableIntegrationTest : Test() - - val integrationTest by tasks.register<NonCacheableIntegrationTest>("integrationTest") { - maxHeapSize = "2G" - description = "Runs integration tests." - group = "verification" - useJUnit() - - - testClassesDirs = sourceSets["integrationTest"].output.classesDirs - classpath = sourceSets["integrationTest"].runtimeClasspath - - setForkEvery(1) - project.properties["dokka_integration_test_parallelism"]?.toString()?.toIntOrNull()?.let { parallelism -> - maxParallelForks = parallelism - } - environment( - "isExhaustive", - project.properties["dokka_integration_test_is_exhaustive"]?.toString()?.toBoolean() - ?: System.getenv("DOKKA_INTEGRATION_TEST_IS_EXHAUSTIVE")?.toBoolean() - ?: false.toString() - ) - - testLogging { - exceptionFormat = TestExceptionFormat.FULL - events(TestLogEvent.SKIPPED, TestLogEvent.FAILED) - showExceptions = true - showCauses = true - showStackTraces = true - } - } - - tasks.check { - dependsOn(integrationTest) - } +plugins { + org.jetbrains.conventions.`kotlin-jvm` } dependencies { diff --git a/integration-tests/cli/build.gradle.kts b/integration-tests/cli/build.gradle.kts index 33c2b827..71d36a9b 100644 --- a/integration-tests/cli/build.gradle.kts +++ b/integration-tests/cli/build.gradle.kts @@ -1,7 +1,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar - plugins { + org.jetbrains.conventions.`dokka-integration-test` id("com.github.johnrengelman.shadow") } @@ -12,6 +12,7 @@ evaluationDependsOn(":plugins:base") dependencies { implementation(kotlin("stdlib")) implementation(kotlin("test-junit")) + implementation(project(":integration-tests")) } /* Create a fat base plugin jar for cli tests */ @@ -25,6 +26,7 @@ dependencies { basePluginShadow(project(":plugins:base")) basePluginShadow(project(":kotlin-analysis")) // compileOnly in base plugin } + val basePluginShadowJar by tasks.register("basePluginShadowJar", ShadowJar::class) { configurations = listOf(basePluginShadow) archiveFileName.set("fat-base-plugin-$dokka_version.jar") diff --git a/integration-tests/gradle/build.gradle.kts b/integration-tests/gradle/build.gradle.kts index 0cb1dc12..3f3be54b 100644 --- a/integration-tests/gradle/build.gradle.kts +++ b/integration-tests/gradle/build.gradle.kts @@ -1,6 +1,11 @@ import org.jetbrains.dependsOnMavenLocalPublication +plugins { + org.jetbrains.conventions.`dokka-integration-test` +} + dependencies { + implementation(project(":integration-tests")) implementation(kotlin("stdlib")) implementation(kotlin("test-junit")) implementation(gradleTestKit()) @@ -14,8 +19,9 @@ tasks.integrationTest { environment("DOKKA_VERSION", dokka_version) inputs.dir(file("projects")) dependsOnMavenLocalPublication() -} -tasks.clean { - delete(File(buildDir, "gradle-test-kit")) + javaLauncher.set(javaToolchains.launcherFor { + // kotlinx.coroutines requires Java 11+ + languageVersion.set(JavaLanguageVersion.of(11)) + }) } diff --git a/integration-tests/maven/build.gradle.kts b/integration-tests/maven/build.gradle.kts index 1c747bbc..0a2cb7c4 100644 --- a/integration-tests/maven/build.gradle.kts +++ b/integration-tests/maven/build.gradle.kts @@ -1,9 +1,14 @@ import org.jetbrains.SetupMaven import org.jetbrains.dependsOnMavenLocalPublication +plugins { + org.jetbrains.conventions.`dokka-integration-test` +} + evaluationDependsOn(":runners:maven-plugin") dependencies { + implementation(project(":integration-tests")) implementation(kotlin("stdlib")) implementation(kotlin("test-junit")) } diff --git a/kotlin-analysis/build.gradle.kts b/kotlin-analysis/build.gradle.kts index c517000e..e2cb50e0 100644 --- a/kotlin-analysis/build.gradle.kts +++ b/kotlin-analysis/build.gradle.kts @@ -1,8 +1,9 @@ import org.jetbrains.registerDokkaArtifactPublication plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` id("com.github.johnrengelman.shadow") - `maven-publish` } dependencies { diff --git a/kotlin-analysis/compiler-dependency/build.gradle.kts b/kotlin-analysis/compiler-dependency/build.gradle.kts index 63e0fb5a..bbea28dd 100644 --- a/kotlin-analysis/compiler-dependency/build.gradle.kts +++ b/kotlin-analysis/compiler-dependency/build.gradle.kts @@ -2,8 +2,9 @@ import org.jetbrains.DokkaPublicationBuilder.Component.Shadow import org.jetbrains.registerDokkaArtifactPublication plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` id("com.github.johnrengelman.shadow") - `maven-publish` } dependencies { diff --git a/kotlin-analysis/intellij-dependency/build.gradle.kts b/kotlin-analysis/intellij-dependency/build.gradle.kts index 09c47ef5..732b9d80 100644 --- a/kotlin-analysis/intellij-dependency/build.gradle.kts +++ b/kotlin-analysis/intellij-dependency/build.gradle.kts @@ -2,14 +2,19 @@ import org.jetbrains.DokkaPublicationBuilder.Component.Shadow import org.jetbrains.registerDokkaArtifactPublication plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` id("com.github.johnrengelman.shadow") - `maven-publish` } repositories { + // Override the shared repositories defined in the root settings.gradle.kts + // These repositories are very specific and are not needed in other projects mavenCentral() - maven(url = "https://www.jetbrains.com/intellij-repository/snapshots") - maven(url = "https://www.jetbrains.com/intellij-repository/releases") + maven("https://www.jetbrains.com/intellij-repository/snapshots") { + mavenContent { snapshotsOnly() } + } + maven("https://www.jetbrains.com/intellij-repository/releases") maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide") maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-ide-plugin-dependencies") maven("https://cache-redirector.jetbrains.com/intellij-dependencies") diff --git a/plugins/all-modules-page/build.gradle.kts b/plugins/all-modules-page/build.gradle.kts index a690e077..cd07d9b3 100644 --- a/plugins/all-modules-page/build.gradle.kts +++ b/plugins/all-modules-page/build.gradle.kts @@ -1,10 +1,20 @@ import org.jetbrains.registerDokkaArtifactPublication +plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` +} + registerDokkaArtifactPublication("dokkaAllModulesPage") { artifactId = "all-modules-page-plugin" } dependencies { + compileOnly(project(":core")) + implementation(kotlin("stdlib-jdk8")) + implementation(kotlin("stdlib")) + implementation(kotlin("reflect")) + compileOnly(project(":kotlin-analysis")) implementation(project(":plugins:base")) implementation(project(":plugins:templating")) @@ -29,4 +39,8 @@ dependencies { val jsoup_version: String by project implementation("org.jsoup:jsoup:$jsoup_version") -}
\ No newline at end of file + + testImplementation(project(":test-utils")) + testImplementation(project(":core:test-api")) + testImplementation("org.junit.jupiter:junit-jupiter:5.6.0") +} diff --git a/plugins/android-documentation/build.gradle.kts b/plugins/android-documentation/build.gradle.kts index 79a89165..e1293520 100644 --- a/plugins/android-documentation/build.gradle.kts +++ b/plugins/android-documentation/build.gradle.kts @@ -1,9 +1,22 @@ import org.jetbrains.registerDokkaArtifactPublication +plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` +} + dependencies { + compileOnly(project(":core")) + implementation(kotlin("stdlib-jdk8")) + implementation(kotlin("stdlib")) + implementation(kotlin("reflect")) + implementation(project(":plugins:base")) testImplementation(project(":plugins:base")) testImplementation(project(":plugins:base:base-test-utils")) + testImplementation(project(":test-utils")) + testImplementation(project(":core:test-api")) + testImplementation("org.junit.jupiter:junit-jupiter:5.6.0") } registerDokkaArtifactPublication("androidDocumentationPlugin") { diff --git a/plugins/base/base-test-utils/build.gradle.kts b/plugins/base/base-test-utils/build.gradle.kts index 122b9b92..b7d02115 100644 --- a/plugins/base/base-test-utils/build.gradle.kts +++ b/plugins/base/base-test-utils/build.gradle.kts @@ -1,11 +1,25 @@ import org.jetbrains.registerDokkaArtifactPublication +plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` +} + dependencies { + compileOnly(project(":core")) + implementation(kotlin("stdlib-jdk8")) + implementation(kotlin("stdlib")) + implementation(kotlin("reflect")) + compileOnly(project(":plugins:base")) implementation(project(":core:test-api")) val jsoup_version: String by project implementation("org.jsoup:jsoup:$jsoup_version") implementation(kotlin("test-junit")) + + testImplementation(project(":test-utils")) + testImplementation(project(":core:test-api")) + testImplementation("org.junit.jupiter:junit-jupiter:5.6.0") } registerDokkaArtifactPublication("dokkaBaseTestUtils") { diff --git a/plugins/base/build.gradle.kts b/plugins/base/build.gradle.kts index 93348ed7..089e26d1 100644 --- a/plugins/base/build.gradle.kts +++ b/plugins/base/build.gradle.kts @@ -1,7 +1,16 @@ import org.jetbrains.registerDokkaArtifactPublication +plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` +} dependencies { + compileOnly(project(":core")) + implementation(kotlin("stdlib-jdk8")) + implementation(kotlin("stdlib")) + implementation(kotlin("reflect")) + val coroutines_version: String by project implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version") @@ -28,6 +37,9 @@ dependencies { implementation("org.jetbrains.kotlinx:kotlinx-html-jvm:$kotlinx_html_version") testImplementation(project(":kotlin-analysis")) + testImplementation(project(":test-utils")) + testImplementation(project(":core:test-api")) + testImplementation("org.junit.jupiter:junit-jupiter:5.6.0") } val projectDistDir = project(":plugins:base:frontend").file("dist") diff --git a/plugins/base/frontend/build.gradle.kts b/plugins/base/frontend/build.gradle.kts index aa39d20e..9ed576cd 100644 --- a/plugins/base/frontend/build.gradle.kts +++ b/plugins/base/frontend/build.gradle.kts @@ -1,4 +1,5 @@ plugins { + base id("com.github.node-gradle.node") version "3.2.1" } diff --git a/plugins/build.gradle.kts b/plugins/build.gradle.kts deleted file mode 100644 index 1b15a209..00000000 --- a/plugins/build.gradle.kts +++ /dev/null @@ -1,30 +0,0 @@ -import org.gradle.api.tasks.testing.logging.TestExceptionFormat -import org.gradle.api.tasks.testing.logging.TestLogEvent - -subprojects { - apply { - plugin("maven-publish") - } - - dependencies { - compileOnly(project(":core")) - implementation(kotlin("stdlib-jdk8")) - implementation(kotlin("stdlib")) - implementation(kotlin("reflect")) - - testImplementation(project(":test-utils")) - testImplementation(project(":core:test-api")) - testImplementation("org.junit.jupiter:junit-jupiter:5.6.0") - } - - tasks.test { - useJUnitPlatform() - testLogging { - exceptionFormat = TestExceptionFormat.FULL - events(TestLogEvent.SKIPPED, TestLogEvent.FAILED) - showExceptions = true - showCauses = true - showStackTraces = true - } - } -} diff --git a/plugins/gfm/build.gradle.kts b/plugins/gfm/build.gradle.kts index ee486dfd..bb97cdd3 100644 --- a/plugins/gfm/build.gradle.kts +++ b/plugins/gfm/build.gradle.kts @@ -1,11 +1,24 @@ import org.jetbrains.registerDokkaArtifactPublication +plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` +} + dependencies { + compileOnly(project(":core")) + implementation(kotlin("stdlib-jdk8")) + implementation(kotlin("stdlib")) + implementation(kotlin("reflect")) implementation(project(":plugins:base")) testImplementation(project(":plugins:base")) testImplementation(project(":plugins:base:base-test-utils")) val jackson_version: String by project implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version") + testImplementation(project(":test-utils")) + testImplementation(project(":core:test-api")) + testImplementation("org.junit.jupiter:junit-jupiter:5.6.0") + val jackson_databind_version: String by project constraints { implementation("com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version") { diff --git a/plugins/gfm/gfm-template-processing/build.gradle.kts b/plugins/gfm/gfm-template-processing/build.gradle.kts index b401c0c7..450b33a2 100644 --- a/plugins/gfm/gfm-template-processing/build.gradle.kts +++ b/plugins/gfm/gfm-template-processing/build.gradle.kts @@ -1,6 +1,15 @@ import org.jetbrains.registerDokkaArtifactPublication +plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` +} + dependencies { + compileOnly(project(":core")) + implementation(kotlin("stdlib-jdk8")) + implementation(kotlin("stdlib")) + implementation(kotlin("reflect")) implementation(project(":plugins:base")) implementation(project(":plugins:gfm")) implementation(project(":plugins:all-modules-page")) @@ -8,8 +17,12 @@ dependencies { val coroutines_version: String by project implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version") + + testImplementation(project(":test-utils")) + testImplementation(project(":core:test-api")) + testImplementation("org.junit.jupiter:junit-jupiter:5.6.0") } registerDokkaArtifactPublication("dokkaGfmTemplateProcessing") { artifactId = "gfm-template-processing-plugin" -}
\ No newline at end of file +} diff --git a/plugins/javadoc/build.gradle.kts b/plugins/javadoc/build.gradle.kts index 471e4dda..c41256ca 100644 --- a/plugins/javadoc/build.gradle.kts +++ b/plugins/javadoc/build.gradle.kts @@ -1,6 +1,15 @@ import org.jetbrains.registerDokkaArtifactPublication +plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` +} + dependencies { + compileOnly(project(":core")) + implementation(kotlin("stdlib-jdk8")) + implementation(kotlin("stdlib")) + implementation(kotlin("reflect")) compileOnly(project(":kotlin-analysis")) implementation("com.soywiz.korlibs.korte:korte-jvm:2.7.0") implementation(project(":plugins:base")) @@ -15,6 +24,10 @@ dependencies { val jsoup_version: String by project testImplementation("org.jsoup:jsoup:$jsoup_version") + + testImplementation(project(":test-utils")) + testImplementation(project(":core:test-api")) + testImplementation("org.junit.jupiter:junit-jupiter:5.6.0") } registerDokkaArtifactPublication("javadocPlugin") { diff --git a/plugins/jekyll/build.gradle.kts b/plugins/jekyll/build.gradle.kts index 64cf9800..483c58b3 100644 --- a/plugins/jekyll/build.gradle.kts +++ b/plugins/jekyll/build.gradle.kts @@ -1,8 +1,21 @@ import org.jetbrains.registerDokkaArtifactPublication +plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` +} + dependencies { + compileOnly(project(":core")) + implementation(kotlin("stdlib-jdk8")) + implementation(kotlin("stdlib")) + implementation(kotlin("reflect")) implementation(project(":plugins:base")) implementation(project(":plugins:gfm")) + + testImplementation(project(":test-utils")) + testImplementation(project(":core:test-api")) + testImplementation("org.junit.jupiter:junit-jupiter:5.6.0") } registerDokkaArtifactPublication("jekyllPlugin") { diff --git a/plugins/jekyll/jekyll-template-processing/build.gradle.kts b/plugins/jekyll/jekyll-template-processing/build.gradle.kts index 2ccb6b89..9845a993 100644 --- a/plugins/jekyll/jekyll-template-processing/build.gradle.kts +++ b/plugins/jekyll/jekyll-template-processing/build.gradle.kts @@ -1,6 +1,16 @@ import org.jetbrains.registerDokkaArtifactPublication +plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` +} + dependencies { + compileOnly(project(":core")) + implementation(kotlin("stdlib-jdk8")) + implementation(kotlin("stdlib")) + implementation(kotlin("reflect")) + implementation(project(":plugins:base")) implementation(project(":plugins:jekyll")) implementation(project(":plugins:all-modules-page")) @@ -10,8 +20,12 @@ dependencies { val coroutines_version: String by project implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version") + + testImplementation(project(":test-utils")) + testImplementation(project(":core:test-api")) + testImplementation("org.junit.jupiter:junit-jupiter:5.6.0") } registerDokkaArtifactPublication("dokkaJekyllTemplateProcessing") { artifactId = "jekyll-template-processing-plugin" -}
\ No newline at end of file +} diff --git a/plugins/kotlin-as-java/build.gradle.kts b/plugins/kotlin-as-java/build.gradle.kts index fb20d659..1b759efb 100644 --- a/plugins/kotlin-as-java/build.gradle.kts +++ b/plugins/kotlin-as-java/build.gradle.kts @@ -1,6 +1,15 @@ import org.jetbrains.registerDokkaArtifactPublication +plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` +} + dependencies { + compileOnly(project(":core")) + implementation(kotlin("stdlib-jdk8")) + implementation(kotlin("stdlib")) + implementation(kotlin("reflect")) compileOnly(project(":kotlin-analysis")) implementation(project(":plugins:base")) testImplementation(project(":plugins:base")) @@ -9,6 +18,10 @@ dependencies { val jsoup_version: String by project testImplementation("org.jsoup:jsoup:$jsoup_version") testImplementation(project(":kotlin-analysis")) + + testImplementation(project(":test-utils")) + testImplementation(project(":core:test-api")) + testImplementation("org.junit.jupiter:junit-jupiter:5.6.0") } registerDokkaArtifactPublication("kotlinAsJavaPlugin") { diff --git a/plugins/mathjax/build.gradle.kts b/plugins/mathjax/build.gradle.kts index 0b69a038..07ac053b 100644 --- a/plugins/mathjax/build.gradle.kts +++ b/plugins/mathjax/build.gradle.kts @@ -1,6 +1,15 @@ import org.jetbrains.registerDokkaArtifactPublication +plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` +} + dependencies { + compileOnly(project(":core")) + implementation(kotlin("stdlib-jdk8")) + implementation(kotlin("stdlib")) + implementation(kotlin("reflect")) implementation(project(":plugins:base")) val jsoup_version: String by project @@ -9,6 +18,10 @@ dependencies { testImplementation(project(":core:content-matcher-test-utils")) testImplementation(kotlin("test-junit")) testImplementation(project(":kotlin-analysis")) + + testImplementation(project(":test-utils")) + testImplementation(project(":core:test-api")) + testImplementation("org.junit.jupiter:junit-jupiter:5.6.0") } registerDokkaArtifactPublication("mathjaxPlugin") { diff --git a/plugins/templating/build.gradle.kts b/plugins/templating/build.gradle.kts index ee1067ef..d4909d9b 100644 --- a/plugins/templating/build.gradle.kts +++ b/plugins/templating/build.gradle.kts @@ -1,10 +1,19 @@ import org.jetbrains.registerDokkaArtifactPublication +plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` +} + registerDokkaArtifactPublication("templating-plugin") { artifactId = "templating-plugin" } dependencies { + compileOnly(project(":core")) + implementation(kotlin("stdlib-jdk8")) + implementation(kotlin("stdlib")) + implementation(kotlin("reflect")) implementation(project(":plugins:base")) val coroutines_version: String by project @@ -23,4 +32,8 @@ dependencies { val jsoup_version: String by project implementation("org.jsoup:jsoup:$jsoup_version") testImplementation(project(":plugins:base:base-test-utils")) -}
\ No newline at end of file + + testImplementation(project(":test-utils")) + testImplementation(project(":core:test-api")) + testImplementation("org.junit.jupiter:junit-jupiter:5.6.0") +} diff --git a/plugins/versioning/build.gradle.kts b/plugins/versioning/build.gradle.kts index 7d585a44..0c7ee0a4 100644 --- a/plugins/versioning/build.gradle.kts +++ b/plugins/versioning/build.gradle.kts @@ -1,10 +1,19 @@ import org.jetbrains.registerDokkaArtifactPublication +plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` +} + registerDokkaArtifactPublication("versioning-plugin") { artifactId = "versioning-plugin" } dependencies { + compileOnly(project(":core")) + implementation(kotlin("stdlib-jdk8")) + implementation(kotlin("stdlib")) + implementation(kotlin("reflect")) implementation(project(":plugins:base")) implementation(project(":plugins:templating")) @@ -24,4 +33,8 @@ dependencies { val jsoup_version: String by project implementation("org.jsoup:jsoup:$jsoup_version") implementation("org.apache.maven:maven-artifact:3.8.5") -}
\ No newline at end of file + + testImplementation(project(":test-utils")) + testImplementation(project(":core:test-api")) + testImplementation("org.junit.jupiter:junit-jupiter:5.6.0") +} diff --git a/runners/build.gradle.kts b/runners/build.gradle.kts deleted file mode 100644 index 095367ad..00000000 --- a/runners/build.gradle.kts +++ /dev/null @@ -1,9 +0,0 @@ -subprojects { - apply { - plugin("maven-publish") - } - - tasks.processResources { - duplicatesStrategy = DuplicatesStrategy.WARN - } -} diff --git a/runners/cli/build.gradle.kts b/runners/cli/build.gradle.kts index 73b01acb..b522dbdd 100644 --- a/runners/cli/build.gradle.kts +++ b/runners/cli/build.gradle.kts @@ -2,6 +2,8 @@ import org.jetbrains.DokkaPublicationBuilder.Component.Shadow import org.jetbrains.registerDokkaArtifactPublication plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` id("com.github.johnrengelman.shadow") } @@ -23,8 +25,7 @@ tasks { } } -registerDokkaArtifactPublication("dokkaCli"){ +registerDokkaArtifactPublication("dokkaCli") { artifactId = "dokka-cli" component = Shadow } - diff --git a/runners/gradle-plugin/api/gradle-plugin.api b/runners/gradle-plugin/api/gradle-plugin.api new file mode 100644 index 00000000..fead39f9 --- /dev/null +++ b/runners/gradle-plugin/api/gradle-plugin.api @@ -0,0 +1,179 @@ +public abstract class org/jetbrains/dokka/gradle/AbstractDokkaLeafTask : org/jetbrains/dokka/gradle/AbstractDokkaTask { + public fun <init> ()V + public final fun getDokkaSourceSets ()Lorg/gradle/api/NamedDomainObjectContainer; + protected final fun getUnsuppressedSourceSets ()Ljava/util/List; +} + +public abstract class org/jetbrains/dokka/gradle/AbstractDokkaParentTask : org/jetbrains/dokka/gradle/AbstractDokkaTask { + public fun <init> ()V + public final fun addChildTask (Ljava/lang/String;)V + public final fun addChildTask (Lorg/jetbrains/dokka/gradle/AbstractDokkaTask;)V + public final fun addChildTasks (Ljava/lang/Iterable;Ljava/lang/String;)V + public final fun addSubprojectChildTasks (Ljava/lang/String;)V + public final fun removeChildTask (Ljava/lang/String;)V + public final fun removeChildTask (Lorg/jetbrains/dokka/gradle/AbstractDokkaTask;)V + public final fun removeChildTasks (Ljava/lang/Iterable;)V + public final fun removeChildTasks (Ljava/lang/Iterable;Ljava/lang/String;)V + public final fun removeChildTasks (Lorg/gradle/api/Project;)V + public final fun removeSubprojectChildTasks (Ljava/lang/String;)V +} + +public abstract class org/jetbrains/dokka/gradle/AbstractDokkaTask : org/gradle/api/DefaultTask { + public fun <init> ()V + public final fun doFirst (Lgroovy/lang/Closure;)Lorg/gradle/api/Task; + public final fun doFirst (Lorg/gradle/api/Action;)Lorg/gradle/api/Task; + public abstract fun getCacheRoot ()Lorg/gradle/api/file/DirectoryProperty; + public final fun getFailOnWarning ()Lorg/gradle/api/provider/Property; + public final fun getModuleName ()Lorg/gradle/api/provider/Property; + public final fun getModuleVersion ()Lorg/gradle/api/provider/Property; + public final fun getOfflineMode ()Lorg/gradle/api/provider/Property; + public abstract fun getOutputDirectory ()Lorg/gradle/api/file/DirectoryProperty; + public final fun getPlugins ()Lorg/gradle/api/artifacts/Configuration; + public final fun getPluginsConfiguration ()Lorg/gradle/api/provider/ListProperty; + public final fun getPluginsMapConfiguration ()Lorg/gradle/api/provider/MapProperty; + public final fun getRuntime ()Lorg/gradle/api/artifacts/Configuration; + public final fun getSuppressInheritedMembers ()Lorg/gradle/api/provider/Property; + public final fun getSuppressObviousFunctions ()Lorg/gradle/api/provider/Property; +} + +public final class org/jetbrains/dokka/gradle/DokkaBootstrapFactoryKt { + public static final fun DokkaBootstrap (Lorg/gradle/api/artifacts/Configuration;Lkotlin/reflect/KClass;)Lorg/jetbrains/dokka/DokkaBootstrap; +} + +public abstract class org/jetbrains/dokka/gradle/DokkaCollectorTask : org/jetbrains/dokka/gradle/AbstractDokkaParentTask { + public fun <init> ()V +} + +public abstract interface class org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout { + public abstract fun targetChildOutputDirectory (Lorg/jetbrains/dokka/gradle/DokkaMultiModuleTask;Lorg/jetbrains/dokka/gradle/AbstractDokkaTask;)Lorg/gradle/api/provider/Provider; +} + +public final class org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout$CompactInParent : org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout { + public static final field INSTANCE Lorg/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout$CompactInParent; + public fun targetChildOutputDirectory (Lorg/jetbrains/dokka/gradle/DokkaMultiModuleTask;Lorg/jetbrains/dokka/gradle/AbstractDokkaTask;)Lorg/gradle/api/provider/Provider; +} + +public final class org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout$NoCopy : org/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout { + public static final field INSTANCE Lorg/jetbrains/dokka/gradle/DokkaMultiModuleFileLayout$NoCopy; + public fun targetChildOutputDirectory (Lorg/jetbrains/dokka/gradle/DokkaMultiModuleTask;Lorg/jetbrains/dokka/gradle/AbstractDokkaTask;)Lorg/gradle/api/provider/Provider; +} + +public abstract class org/jetbrains/dokka/gradle/DokkaMultiModuleTask : org/jetbrains/dokka/gradle/AbstractDokkaParentTask { + public fun <init> ()V + public final fun getFileLayout ()Lorg/gradle/api/provider/Property; + public abstract fun getIncludes ()Lorg/gradle/api/file/ConfigurableFileCollection; + public fun getTaskDependencies ()Lorg/gradle/api/internal/tasks/TaskDependencyInternal; + public synthetic fun getTaskDependencies ()Lorg/gradle/api/tasks/TaskDependency; +} + +public class org/jetbrains/dokka/gradle/DokkaPlugin : org/gradle/api/Plugin { + public fun <init> ()V + public synthetic fun apply (Ljava/lang/Object;)V + public fun apply (Lorg/gradle/api/Project;)V +} + +public abstract class org/jetbrains/dokka/gradle/DokkaTask : org/jetbrains/dokka/gradle/AbstractDokkaLeafTask { + public fun <init> ()V +} + +public abstract class org/jetbrains/dokka/gradle/DokkaTaskPartial : org/jetbrains/dokka/gradle/AbstractDokkaLeafTask { + public fun <init> ()V +} + +public class org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder : org/jetbrains/dokka/DokkaConfigurationBuilder { + public fun <init> (Ljava/lang/String;Lorg/gradle/api/Project;Lorg/gradle/api/NamedDomainObjectFactory;)V + public final fun DokkaSourceSetID (Ljava/lang/String;)Lorg/jetbrains/dokka/DokkaSourceSetID; + public synthetic fun build ()Ljava/lang/Object; + public fun build ()Lorg/jetbrains/dokka/DokkaSourceSetImpl; + public final fun dependsOn (Ljava/lang/String;)V + public final fun dependsOn (Lorg/gradle/api/tasks/SourceSet;)V + public final fun dependsOn (Lorg/jetbrains/dokka/DokkaConfiguration$DokkaSourceSet;)V + public final fun dependsOn (Lorg/jetbrains/dokka/DokkaSourceSetID;)V + public final fun dependsOn (Lorg/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder;)V + public final fun externalDocumentationLink (Lgroovy/lang/Closure;)V + public final fun externalDocumentationLink (Ljava/lang/String;Ljava/lang/String;)V + public final fun externalDocumentationLink (Ljava/net/URL;Ljava/net/URL;)V + public final fun externalDocumentationLink (Lorg/gradle/api/Action;)V + public static synthetic fun externalDocumentationLink$default (Lorg/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)V + public static synthetic fun externalDocumentationLink$default (Lorg/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder;Ljava/net/URL;Ljava/net/URL;ILjava/lang/Object;)V + public final fun getApiVersion ()Lorg/gradle/api/provider/Property; + public final fun getClasspath ()Lorg/gradle/api/file/ConfigurableFileCollection; + public final fun getDependentSourceSets ()Lorg/gradle/api/provider/SetProperty; + public final fun getDisplayName ()Lorg/gradle/api/provider/Property; + public final fun getDocumentedVisibilities ()Lorg/gradle/api/provider/SetProperty; + public final fun getExternalDocumentationLinks ()Lorg/gradle/api/provider/SetProperty; + public final fun getIncludeNonPublic ()Lorg/gradle/api/provider/Property; + public final fun getIncludes ()Lorg/gradle/api/file/ConfigurableFileCollection; + public final fun getJdkVersion ()Lorg/gradle/api/provider/Property; + public final fun getLanguageVersion ()Lorg/gradle/api/provider/Property; + public final fun getName ()Ljava/lang/String; + public final fun getNoAndroidSdkLink ()Lorg/gradle/api/provider/Property; + public final fun getNoJdkLink ()Lorg/gradle/api/provider/Property; + public final fun getNoStdlibLink ()Lorg/gradle/api/provider/Property; + public final fun getPerPackageOptions ()Lorg/gradle/api/provider/ListProperty; + public final fun getPlatform ()Lorg/gradle/api/provider/Property; + public final fun getReportUndocumented ()Lorg/gradle/api/provider/Property; + public final fun getSamples ()Lorg/gradle/api/file/ConfigurableFileCollection; + public final fun getSkipDeprecated ()Lorg/gradle/api/provider/Property; + public final fun getSkipEmptyPackages ()Lorg/gradle/api/provider/Property; + public final fun getSourceLinks ()Lorg/gradle/api/provider/SetProperty; + public final fun getSourceRoots ()Lorg/gradle/api/file/ConfigurableFileCollection; + public final fun getSourceSetID ()Lorg/jetbrains/dokka/DokkaSourceSetID; + public final fun getSuppress ()Lorg/gradle/api/provider/Property; + public final fun getSuppressGeneratedFiles ()Lorg/gradle/api/provider/Property; + public final fun getSuppressedFiles ()Lorg/gradle/api/file/ConfigurableFileCollection; + public final fun perPackageOption (Lgroovy/lang/Closure;)V + public final fun perPackageOption (Lorg/gradle/api/Action;)V + public final fun sourceLink (Lgroovy/lang/Closure;)V + public final fun sourceLink (Lorg/gradle/api/Action;)V + public final fun sourceRoot (Ljava/io/File;)V + public final fun sourceRoot (Ljava/lang/String;)V +} + +public final class org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderExtensionsKt { + public static final fun dependsOn (Lorg/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder;Lcom/android/build/gradle/api/AndroidSourceSet;)V + public static final fun dependsOn (Lorg/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder;Lorg/jetbrains/kotlin/gradle/plugin/KotlinSourceSet;)V + public static final fun kotlinSourceSet (Lorg/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder;Lorg/jetbrains/kotlin/gradle/plugin/KotlinSourceSet;)V +} + +public final class org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderFactoryKt { + public static final fun gradleDokkaSourceSetBuilderFactory (Lorg/jetbrains/dokka/gradle/AbstractDokkaTask;)Lorg/gradle/api/NamedDomainObjectFactory; +} + +public final class org/jetbrains/dokka/gradle/GradleExternalDocumentationLinkBuilder : org/jetbrains/dokka/DokkaConfigurationBuilder { + public fun <init> (Lorg/gradle/api/Project;)V + public synthetic fun build ()Ljava/lang/Object; + public fun build ()Lorg/jetbrains/dokka/ExternalDocumentationLinkImpl; + public final fun getPackageListUrl ()Lorg/gradle/api/provider/Property; + public final fun getUrl ()Lorg/gradle/api/provider/Property; +} + +public final class org/jetbrains/dokka/gradle/GradlePackageOptionsBuilder : org/jetbrains/dokka/DokkaConfigurationBuilder { + public fun <init> (Lorg/gradle/api/Project;)V + public synthetic fun build ()Ljava/lang/Object; + public fun build ()Lorg/jetbrains/dokka/PackageOptionsImpl; + public final fun getDocumentedVisibilities ()Lorg/gradle/api/provider/SetProperty; + public final fun getIncludeNonPublic ()Lorg/gradle/api/provider/Property; + public final fun getMatchingRegex ()Lorg/gradle/api/provider/Property; + public final fun getReportUndocumented ()Lorg/gradle/api/provider/Property; + public final fun getSkipDeprecated ()Lorg/gradle/api/provider/Property; + public final fun getSuppress ()Lorg/gradle/api/provider/Property; +} + +public final class org/jetbrains/dokka/gradle/GradleSourceLinkBuilder : org/jetbrains/dokka/DokkaConfigurationBuilder { + public fun <init> (Lorg/gradle/api/Project;)V + public synthetic fun build ()Ljava/lang/Object; + public fun build ()Lorg/jetbrains/dokka/SourceLinkDefinitionImpl; + public final fun getLocalDirectory ()Lorg/gradle/api/provider/Property; + public final fun getRemoteLineSuffix ()Lorg/gradle/api/provider/Property; + public final fun getRemoteUrl ()Lorg/gradle/api/provider/Property; +} + +public final class org/jetbrains/dokka/gradle/SourceSetKotlinGistConfigurationKt { + public static final fun configureWithKotlinSourceSet (Lorg/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder;Lorg/jetbrains/kotlin/gradle/plugin/KotlinSourceSet;)V +} + +public final class org/jetbrains/dokka/gradle/kotlin/KotlinClasspathUtilsKt { + public static final fun isHMPPEnabled (Lorg/gradle/api/Project;)Z +} + diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts index 6845e7f6..89601c69 100644 --- a/runners/gradle-plugin/build.gradle.kts +++ b/runners/gradle-plugin/build.gradle.kts @@ -1,13 +1,10 @@ -import org.gradle.configurationcache.extensions.serviceOf import org.jetbrains.* plugins { `kotlin-dsl` - id("com.gradle.plugin-publish") version "0.20.0" -} - -repositories { - google() + org.jetbrains.conventions.`maven-publish` + org.jetbrains.conventions.`base-java` + id("com.gradle.plugin-publish") } dependencies { @@ -22,7 +19,7 @@ dependencies { testImplementation("com.android.tools.build:gradle:4.0.1") } -// Gradle will put its own version of the stdlib in the classpath, do not pull our own we will end up with +// Gradle will put its own version of the stdlib in the classpath, so not pull our own we will end up with // warnings like 'Runtime JAR files in the classpath should have the same version' configurations.api.configure { excludeGradleCommonDependencies() @@ -86,7 +83,6 @@ publishing { register<MavenPublication>("pluginMaven") { configurePom("Dokka ${project.name}") artifactId = "dokka-gradle-plugin" - artifact(tasks["javadocJar"]) } afterEvaluate { @@ -110,3 +106,7 @@ afterEvaluate { // Workaround for an interesting design choice https://github.co configureSonatypePublicationIfNecessary("pluginMaven", "dokkaGradlePluginPluginMarkerMaven") createDokkaPublishTaskIfNecessary() } + +tasks.processResources { + duplicatesStrategy = DuplicatesStrategy.WARN +} diff --git a/runners/maven-plugin/build.gradle.kts b/runners/maven-plugin/build.gradle.kts index d62b82dd..e6aab8eb 100644 --- a/runners/maven-plugin/build.gradle.kts +++ b/runners/maven-plugin/build.gradle.kts @@ -2,6 +2,11 @@ import org.jetbrains.CrossPlatformExec import org.jetbrains.SetupMaven import org.jetbrains.registerDokkaArtifactPublication +plugins { + org.jetbrains.conventions.`kotlin-jvm` + org.jetbrains.conventions.`maven-publish` +} + val setupMaven by tasks.register<SetupMaven>("setupMaven") dependencies { @@ -16,15 +21,14 @@ dependencies { val mavenBuildDir = setupMaven.mavenBuildDir val mavenBinDir = setupMaven.mavenBinDir -tasks.named<Delete>("clean") { +tasks.clean { delete(mavenBuildDir) delete(mavenBinDir) } -/** - * Generate pom.xml for Maven Plugin Plugin - */ val generatePom by tasks.registering(Copy::class) { + description = "Generate pom.xml for Maven Plugin Plugin" + val dokka_version: String by project inputs.property("dokka_version", dokka_version) @@ -49,10 +53,9 @@ val generatePom by tasks.registering(Copy::class) { } } -/** - * Copy compiled classes to [mavenBuildDir] for Maven Plugin Plugin - */ val syncClasses by tasks.registering(Sync::class) { + description = "Copy compiled classes to the Maven build dir, for Maven Plugin task execution" + dependsOn(tasks.compileKotlin, tasks.compileJava) from("$buildDir/classes/kotlin", "$buildDir/classes/java") into("${setupMaven.mavenBuildDir}/classes/java") @@ -66,20 +69,24 @@ val helpMojo by tasks.registering(CrossPlatformExec::class) { dependsOn(setupMaven, generatePom, syncClasses) workingDir(setupMaven.mavenBuildDir) commandLine(setupMaven.mvn, "-e", "-B", "org.apache.maven.plugins:maven-plugin-plugin:helpmojo") + + outputs.dir(layout.buildDirectory.dir("maven")) } val pluginDescriptor by tasks.registering(CrossPlatformExec::class) { dependsOn(setupMaven, generatePom, syncClasses) workingDir(setupMaven.mavenBuildDir) commandLine(setupMaven.mvn, "-e", "-B", "org.apache.maven.plugins:maven-plugin-plugin:descriptor") + + outputs.dir(layout.buildDirectory.dir("maven/classes/java/main/META-INF/maven")) } val sourceJar by tasks.registering(Jar::class) { archiveClassifier.set("sources") - from(sourceSets["main"].allSource) + from(java.sourceSets["main"].allSource) } -tasks.named<Jar>("jar") { +tasks.jar { dependsOn(pluginDescriptor, helpMojo) metaInf { from("${setupMaven.mavenBuildDir}/classes/java/main/META-INF") diff --git a/settings.gradle.kts b/settings.gradle.kts index 677d7812..91023501 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,54 +1,54 @@ rootProject.name = "dokka" -include("core") -include("core:test-api") -include("core:content-matcher-test-utils") - -include("kotlin-analysis") -include("kotlin-analysis:intellij-dependency") -include("kotlin-analysis:compiler-dependency") - -include("runners:gradle-plugin") -include("runners:cli") -include("runners:maven-plugin") - -include("plugins:base") -include("plugins:base:frontend") -include("plugins:base:search-component") -include("plugins:base:base-test-utils") -include("plugins:all-modules-page") -include("plugins:templating") -include("plugins:versioning") -include("plugins:android-documentation") - -include("plugins:mathjax") -include("plugins:gfm") -include("plugins:gfm:gfm-template-processing") -include("plugins:jekyll") -include("plugins:jekyll:jekyll-template-processing") -include("plugins:kotlin-as-java") -include("plugins:javadoc") - -include("integration-tests") -include("integration-tests:gradle") -include("integration-tests:cli") -include("integration-tests:maven") - -include("test-utils") - -include("mkdocs") +include( + ":core", + ":core:test-api", + ":core:content-matcher-test-utils", + + ":kotlin-analysis", + ":kotlin-analysis:intellij-dependency", + ":kotlin-analysis:compiler-dependency", + + ":runners:gradle-plugin", + ":runners:cli", + ":runners:maven-plugin", + + ":plugins:base", + ":plugins:base:frontend", + ":plugins:base:search-component", + ":plugins:base:base-test-utils", + ":plugins:all-modules-page", + ":plugins:templating", + ":plugins:versioning", + ":plugins:android-documentation", + + ":plugins:mathjax", + ":plugins:gfm", + ":plugins:gfm:gfm-template-processing", + ":plugins:jekyll", + ":plugins:jekyll:jekyll-template-processing", + ":plugins:kotlin-as-java", + ":plugins:javadoc", + + ":integration-tests", + ":integration-tests:gradle", + ":integration-tests:cli", + ":integration-tests:maven", + + ":test-utils", + + ":mkdocs", +) + +val isCiBuild = System.getenv("GITHUB_ACTIONS") != null || System.getenv("TEAMCITY_VERSION") != null pluginManagement { - val kotlin_version: String by settings - plugins { - id("org.jetbrains.kotlin.jvm") version kotlin_version - id("com.github.johnrengelman.shadow") version "7.1.2" - id("com.gradle.plugin-publish") version "0.20.0" + repositories { + gradlePluginPortal() + mavenCentral() } } -val isCiBuild = System.getenv("GITHUB_ACTIONS") != null || System.getenv("TEAMCITY_VERSION") != null - plugins { `gradle-enterprise` } @@ -60,3 +60,42 @@ gradleEnterprise { publishAlwaysIf(isCiBuild) } } + +@Suppress("UnstableApiUsage") +dependencyResolutionManagement { + + // subproject :kotlin-analysis:intellij-dependency requires specific repositories that should not be used in + // the other subprojects, so use PREFER_PROJECT to allow subprojects to override the repositories defined here. + repositoriesMode.set(RepositoriesMode.PREFER_PROJECT) + + repositories { + mavenCentral() + google() + + // Declare the Node.js & Yarn download repositories + // Required by Gradle Node plugin: https://github.com/node-gradle/gradle-node-plugin/blob/3.5.1/docs/faq.md#is-this-plugin-compatible-with-centralized-repositories-declaration + exclusiveContent { + forRepository { + ivy("https://nodejs.org/dist/") { + name = "Node Distributions at $url" + patternLayout { artifact("v[revision]/[artifact](-v[revision]-[classifier]).[ext]") } + metadataSources { artifact() } + content { includeModule("org.nodejs", "node") } + } + } + filter { includeGroup("org.nodejs") } + } + + exclusiveContent { + forRepository { + ivy("https://github.com/yarnpkg/yarn/releases/download") { + name = "Yarn Distributions at $url" + patternLayout { artifact("v[revision]/[artifact](-v[revision]).[ext]") } + metadataSources { artifact() } + content { includeModule("com.yarnpkg", "yarn") } + } + } + filter { includeGroup("com.yarnpkg") } + } + } +} diff --git a/test-utils/build.gradle.kts b/test-utils/build.gradle.kts index 23e7ef40..c80472fd 100644 --- a/test-utils/build.gradle.kts +++ b/test-utils/build.gradle.kts @@ -1,3 +1,6 @@ +plugins { + org.jetbrains.conventions.`kotlin-jvm` +} dependencies { api(kotlin("test-junit")) |