Skip to content

Commit

Permalink
initial included-build refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
aSemy committed Sep 4, 2023
1 parent 61619d5 commit 7e7ec5d
Show file tree
Hide file tree
Showing 36 changed files with 1,262 additions and 53 deletions.
26 changes: 13 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
id("org.jetbrains.conventions.base")
id("org.jetbrains.conventions.dokka")

alias(libs.plugins.kotlinx.binaryCompatibilityValidator)
// alias(libs.plugins.kotlinx.binaryCompatibilityValidator)
alias(libs.plugins.nexusPublish)
}

Expand Down Expand Up @@ -38,15 +38,15 @@ val dokkaPublish by tasks.registering {
}
}

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
"frontend", // :plugins:base:frontend

"integration-tests", // :integration-tests
"gradle", // :integration-tests:gradle
"cli", // :integration-tests:cli
"maven", // integration-tests:maven
)
}
//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
// "frontend", // :plugins:base:frontend
//
// "integration-tests", // :integration-tests
// "gradle", // :integration-tests:gradle
// "cli", // :integration-tests:cli
// "maven", // integration-tests:maven
// )
//}
31 changes: 31 additions & 0 deletions dokka-integration-tests/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

@file:Suppress("UnstableApiUsage")

rootProject.name = "dokka-integration-tests"

pluginManagement {
includeBuild("../build-logic")

repositories {
gradlePluginPortal()
mavenCentral()
}
}

dependencyResolutionManagement {
repositories {
mavenCentral()
}
}

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

include(
":cli",
":gradle",
":maven",
":utilities",
)
30 changes: 30 additions & 0 deletions dokka-runners/cli/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

@file:Suppress("UnstableApiUsage")

rootProject.name = "cli"

pluginManagement {
includeBuild("../../build-logic")

repositories {
mavenCentral()
gradlePluginPortal()
}
}

dependencyResolutionManagement {
repositories {
mavenCentral()
}

versionCatalogs {
create("libs") {
from(files("../../gradle/libs.versions.toml"))
}
}
}

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
102 changes: 102 additions & 0 deletions dokka-runners/gradle-plugin-classic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

import org.jetbrains.*

plugins {
id("org.jetbrains.conventions.gradle-plugin")
}

dependencies {
// TODO dependency should be `org.jetbrains.dokka:dokka-core`, because that's the published artifact ID, but the
// core subproject name doesn't match this
api("org.jetbrains.dokka:core")

compileOnly(libs.gradlePlugin.kotlin)
compileOnly(libs.gradlePlugin.android)

testImplementation(kotlin("test"))
testImplementation(libs.gradlePlugin.kotlin)
testImplementation(libs.gradlePlugin.android)
}

// 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()
}

/**
* These dependencies will be provided by Gradle, and we should prevent version conflict
* Code taken from the Kotlin Gradle plugin:
* https://github.com/JetBrains/kotlin/blob/70e15b281cb43379068facb82b8e4bcb897a3c4f/buildSrc/src/main/kotlin/GradleCommon.kt#L72
*/
fun Configuration.excludeGradleCommonDependencies() {
dependencies
.withType<ModuleDependency>()
.configureEach {
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib")
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk7")
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-jdk8")
exclude(group = "org.jetbrains.kotlin", module = "kotlin-stdlib-common")
exclude(group = "org.jetbrains.kotlin", module = "kotlin-reflect")
exclude(group = "org.jetbrains.kotlin", module = "kotlin-script-runtime")
}
}

gradlePlugin {
plugins {
create("dokkaGradlePlugin") {
id = "org.jetbrains.dokka"
displayName = "Dokka plugin"
description = "Dokka, the Kotlin documentation tool"
implementationClass = "org.jetbrains.dokka.gradle.DokkaPlugin"
version = dokkaVersion
isAutomatedPublishing = true
}
}
}

pluginBundle {
website = "https://www.kotlinlang.org/"
vcsUrl = "https://github.com/kotlin/dokka.git"
tags = listOf("dokka", "kotlin", "kdoc", "android", "documentation")

mavenCoordinates {
groupId = "org.jetbrains.dokka"
artifactId = "dokka-gradle-plugin"
}
}

publishing {
publications {
register<MavenPublication>("dokkaGradlePluginForIntegrationTests") {
artifactId = "dokka-gradle-plugin"
from(components["java"])
version = "for-integration-tests-SNAPSHOT"
}

register<MavenPublication>("pluginMaven") {
artifactId = "dokka-gradle-plugin"
}
}
}

tasks.validatePlugins {
enableStricterValidation.set(true)
}

tasks.withType<PublishToMavenRepository>().configureEach {
onlyIf { publication != publishing.publications["dokkaGradlePluginForIntegrationTests"] }
}

afterEvaluate { // Workaround for an interesting design choice https://github.com/gradle/gradle/blob/c4f935f77377f1783f70ec05381c8182b3ade3ea/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/MavenPluginPublishPlugin.java#L49
configureSpacePublicationIfNecessary("pluginMaven", "dokkaGradlePluginPluginMarkerMaven")
configureSonatypePublicationIfNecessary("pluginMaven", "dokkaGradlePluginPluginMarkerMaven")
createDokkaPublishTaskIfNecessary()
}

tasks.processResources {
duplicatesStrategy = DuplicatesStrategy.WARN
}
6 changes: 6 additions & 0 deletions dokka-runners/gradle-plugin-classic/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
#

# Project Settings
dokka_version=1.9.10-SNAPSHOT
33 changes: 33 additions & 0 deletions dokka-runners/gradle-plugin-classic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

@file:Suppress("UnstableApiUsage")

rootProject.name = "gradle-plugin-classic"

pluginManagement {
includeBuild("../../build-logic")

repositories {
mavenCentral()
gradlePluginPortal()
}
}

dependencyResolutionManagement {
repositories {
mavenCentral()
google()
}

versionCatalogs {
create("libs") {
from(files("../../gradle/libs.versions.toml"))
}
}
}

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

includeBuild("../../dokka-subprojects")
30 changes: 30 additions & 0 deletions dokka-runners/gradle-plugin/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

@file:Suppress("UnstableApiUsage")

rootProject.name = "gradle-plugin"

pluginManagement {
includeBuild("../../build-logic")

repositories {
mavenCentral()
gradlePluginPortal()
}
}

dependencyResolutionManagement {
repositories {
mavenCentral()
}

versionCatalogs {
create("libs") {
from(files("../../gradle/libs.versions.toml"))
}
}
}

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
32 changes: 32 additions & 0 deletions dokka-runners/maven-plugin/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

@file:Suppress("UnstableApiUsage")

rootProject.name = "maven-plugin"

pluginManagement {
includeBuild("../../build-logic")

repositories {
mavenCentral()
gradlePluginPortal()
}
}

dependencyResolutionManagement {
repositories {
mavenCentral()
}

versionCatalogs {
create("libs") {
from(files("../../gradle/libs.versions.toml"))
}
}
}

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

includeBuild("../../dokka-subprojects")
22 changes: 22 additions & 0 deletions dokka-subprojects/analysis-java-psi/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
id("org.jetbrains.conventions.kotlin-jvm")
}

dependencies {
compileOnly(projects.core)

api(libs.intellij.java.psi.api)

implementation(projects.analysisMarkdownJb)

implementation(libs.intellij.java.psi.impl)
implementation(libs.intellij.platform.util.api)
implementation(libs.intellij.platform.util.rt)

implementation(libs.kotlinx.coroutines.core)
implementation(libs.jsoup)
}
18 changes: 18 additions & 0 deletions dokka-subprojects/analysis-kotlin-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

import org.jetbrains.registerDokkaArtifactPublication

plugins {
id("org.jetbrains.conventions.kotlin-jvm")
id("org.jetbrains.conventions.maven-publish")
}

dependencies {
compileOnly(projects.core)
}

registerDokkaArtifactPublication("analysisKotlinApi") {
artifactId = "analysis-kotlin-api"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
id("org.jetbrains.conventions.kotlin-jvm")
}

dependencies {
compileOnly(projects.core)
compileOnly(projects.analysisKotlinApi)

api(libs.kotlin.compiler)

implementation(projects.analysisMarkdownJb)
implementation(projects.analysisJavaPsi)

testImplementation(kotlin("test"))
testImplementation(projects.coreContentMatcherTestUtils)
testImplementation(projects.coreTestApi)

// TODO [beresnev] get rid of it
compileOnly(libs.kotlinx.coroutines.core)
}
17 changes: 17 additions & 0 deletions dokka-subprojects/analysis-kotlin-descriptors-ide/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
id("org.jetbrains.conventions.kotlin-jvm")
}

dependencies {
compileOnly(projects.core)
compileOnly(projects.analysisKotlinApi)

implementation(projects.analysisKotlinDescriptorsCompiler)

// TODO [beresnev] get rid of it
compileOnly(libs.kotlinx.coroutines.core)
}
Loading

0 comments on commit 7e7ec5d

Please sign in to comment.