Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate buildSrc to composite build #2912

Merged
merged 7 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build-logic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# About build-logic Module

This module aims to share common build logic for whole projects, previously we were using [buildSrc](https://docs.gradle.org/7.6/userguide/organizing_gradle_projects.html#sec:build_sources),
but for some reasons like "A change in buildSrc causes the whole project to become out-of-date", we are migrating to [composite builds](https://docs.gradle.org/7.6/userguide/composite_builds.html),
which avoids the side effects of buildSrc.

For more information, you can ref https://proandroiddev.com/stop-using-gradle-buildsrc-use-composite-builds-instead-3c38ac7a2ab3.
1 change: 0 additions & 1 deletion buildSrc/build.gradle.kts → build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,4 @@ dependencies {
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")
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = "buildSrc"
rootProject.name = "build-logic"

pluginManagement {
repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package org.jetbrains.conventions
*/

plugins {
`java`
java
}

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ plugins {
id("org.jetbrains.conventions.kotlin-jvm")
}

val integrationTestSourceSet = sourceSets.create("integrationTest") {
val integrationTestSourceSet: SourceSet = sourceSets.create("integrationTest") {
compileClasspath += sourceSets.main.get().output
runtimeClasspath += sourceSets.main.get().output
}

val integrationTestImplementation by configurations.getting {
val integrationTestImplementation: Configuration by configurations.getting {
extendsFrom(configurations.implementation.get())
}

val integrationTestRuntimeOnly by configurations.getting {
val integrationTestRuntimeOnly: Configuration by configurations.getting {
extendsFrom(configurations.runtimeOnly.get())
}

Expand Down
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import org.jetbrains.ValidatePublications
import org.jetbrains.publicationChannels

plugins {
org.jetbrains.conventions.base
id("org.jetbrains.dokka")
id("io.github.gradle-nexus.publish-plugin")

id("org.jetbrains.kotlinx.binary-compatibility-validator")
id("org.jetbrains.conventions.base") apply false
id("org.jetbrains.dokka") version "1.8.10"
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("com.gradle.plugin-publish") version "0.20.0"
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.12.1"
}

val dokka_version: String by project
Expand Down
4 changes: 2 additions & 2 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import org.jetbrains.dokkaVersion
import org.jetbrains.registerDokkaArtifactPublication

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

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion core/content-matcher-test-utils/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
org.jetbrains.conventions.`kotlin-jvm`
id("org.jetbrains.conventions.kotlin-jvm")
}

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions core/test-api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.registerDokkaArtifactPublication

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

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
org.jetbrains.conventions.`kotlin-jvm`
id("org.jetbrains.conventions.kotlin-jvm")
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/cli/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar

plugins {
org.jetbrains.conventions.`dokka-integration-test`
id("org.jetbrains.conventions.dokka-integration-test")
id("com.github.johnrengelman.shadow")
}

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/gradle/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.dependsOnMavenLocalPublication

plugins {
org.jetbrains.conventions.`dokka-integration-test`
id("org.jetbrains.conventions.dokka-integration-test")
}

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/maven/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import org.jetbrains.SetupMaven
import org.jetbrains.dependsOnMavenLocalPublication

plugins {
org.jetbrains.conventions.`dokka-integration-test`
id("org.jetbrains.conventions.dokka-integration-test")
}

evaluationDependsOn(":runners:maven-plugin")
Expand Down
4 changes: 2 additions & 2 deletions kotlin-analysis/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.registerDokkaArtifactPublication

plugins {
org.jetbrains.conventions.`kotlin-jvm`
org.jetbrains.conventions.`maven-publish`
id("org.jetbrains.conventions.kotlin-jvm")
id("org.jetbrains.conventions.maven-publish")
id("com.github.johnrengelman.shadow")
}

Expand Down
4 changes: 2 additions & 2 deletions kotlin-analysis/compiler-dependency/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import org.jetbrains.DokkaPublicationBuilder.Component.Shadow
import org.jetbrains.registerDokkaArtifactPublication

plugins {
org.jetbrains.conventions.`kotlin-jvm`
org.jetbrains.conventions.`maven-publish`
id("org.jetbrains.conventions.kotlin-jvm")
id("org.jetbrains.conventions.maven-publish")
id("com.github.johnrengelman.shadow")
}

Expand Down
4 changes: 2 additions & 2 deletions kotlin-analysis/intellij-dependency/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import org.jetbrains.DokkaPublicationBuilder.Component.Shadow
import org.jetbrains.registerDokkaArtifactPublication

plugins {
org.jetbrains.conventions.`kotlin-jvm`
org.jetbrains.conventions.`maven-publish`
id("org.jetbrains.conventions.kotlin-jvm")
id("org.jetbrains.conventions.maven-publish")
id("com.github.johnrengelman.shadow")
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/all-modules-page/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.registerDokkaArtifactPublication

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

registerDokkaArtifactPublication("dokkaAllModulesPage") {
Expand Down
4 changes: 2 additions & 2 deletions plugins/android-documentation/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.registerDokkaArtifactPublication

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

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions plugins/base/base-test-utils/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.registerDokkaArtifactPublication

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

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions plugins/base/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.registerDokkaArtifactPublication

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

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions plugins/gfm/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.registerDokkaArtifactPublication

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

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions plugins/gfm/gfm-template-processing/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.registerDokkaArtifactPublication

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

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions plugins/javadoc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.registerDokkaArtifactPublication

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

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions plugins/jekyll/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.registerDokkaArtifactPublication

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

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions plugins/jekyll/jekyll-template-processing/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.registerDokkaArtifactPublication

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

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions plugins/kotlin-as-java/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.registerDokkaArtifactPublication

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

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions plugins/mathjax/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.registerDokkaArtifactPublication

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

dependencies {
Expand Down
4 changes: 2 additions & 2 deletions plugins/templating/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.registerDokkaArtifactPublication

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

registerDokkaArtifactPublication("templating-plugin") {
Expand Down
4 changes: 2 additions & 2 deletions plugins/versioning/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.jetbrains.registerDokkaArtifactPublication

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

registerDokkaArtifactPublication("versioning-plugin") {
Expand Down
4 changes: 2 additions & 2 deletions runners/cli/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import org.jetbrains.DokkaPublicationBuilder.Component.Shadow
import org.jetbrains.registerDokkaArtifactPublication

plugins {
org.jetbrains.conventions.`kotlin-jvm`
org.jetbrains.conventions.`maven-publish`
id("org.jetbrains.conventions.kotlin-jvm")
id("org.jetbrains.conventions.maven-publish")
id("com.github.johnrengelman.shadow")
}

Expand Down
4 changes: 2 additions & 2 deletions runners/gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import org.jetbrains.*

plugins {
`kotlin-dsl`
org.jetbrains.conventions.`maven-publish`
org.jetbrains.conventions.`base-java`
id("org.jetbrains.conventions.maven-publish")
id("org.jetbrains.conventions.base-java")
id("com.gradle.plugin-publish")
}

Expand Down
4 changes: 2 additions & 2 deletions runners/maven-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import org.jetbrains.SetupMaven
import org.jetbrains.registerDokkaArtifactPublication

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

val setupMaven by tasks.register<SetupMaven>("setupMaven")
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ include(

":mkdocs",
)
includeBuild("build-logic")

val isCiBuild = System.getenv("GITHUB_ACTIONS") != null || System.getenv("TEAMCITY_VERSION") != null

Expand Down
2 changes: 1 addition & 1 deletion test-utils/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
org.jetbrains.conventions.`kotlin-jvm`
id("org.jetbrains.conventions.kotlin-jvm")
}

dependencies {
Expand Down