Skip to content

Convert distro build scripts from Groovy to Kotlin DSL #14176

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

steverao
Copy link
Contributor

@steverao steverao commented Jul 3, 2025

No description provided.

@steverao steverao marked this pull request as ready for review July 10, 2025 02:22
@steverao steverao requested a review from a team as a code owner July 10, 2025 02:22
@trask trask requested a review from Copilot July 15, 2025 02:56
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR converts all distro example build scripts from Groovy (.gradle) to Kotlin DSL (.gradle.kts), removes the old Groovy counterparts, and introduces Kotlin-based convention plugins under buildSrc for formatting, shadowing, and instrumentation.

  • Migrate root and subproject settings/build scripts to Kotlin DSL
  • Remove legacy Groovy scripts and consolidate conventions in buildSrc
  • Update dependency management and plugin declarations in Kotlin

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
examples/distro/testing/agent-for-testing/build.gradle.kts Kotlin DSL version of the agent-for-testing build
examples/distro/smoke-tests/build.gradle.kts Kotlin DSL smoke tests build script
examples/distro/settings.gradle.kts Kotlin DSL settings with pluginManagement
examples/distro/settings.gradle Removed legacy Groovy settings
examples/distro/instrumentation/servlet-3/build.gradle.kts Kotlin DSL servlet-3 instrumentation build
examples/distro/instrumentation/servlet-3/build.gradle Removed Groovy servlet-3 script
examples/distro/instrumentation/build.gradle.kts Kotlin DSL instrumentation aggregator script
examples/distro/instrumentation/build.gradle Removed legacy Groovy instrumentation script
examples/distro/gradle/spotless.license.java New license header file for Spotless
examples/distro/gradle/shadow.gradle Removed legacy Groovy shadow conventions
examples/distro/gradle/instrumentation.gradle Removed Groovy instrumentation conventions
examples/distro/dependencyManagement/build.gradle.kts Kotlin DSL BOM/platform management
examples/distro/custom/build.gradle.kts Kotlin DSL custom project build
examples/distro/buildSrc/src/main/kotlin/otel.spotless-conventions.gradle.kts New Kotlin Spotless convention plugin
examples/distro/buildSrc/src/main/kotlin/otel.shadow-conventions.gradle.kts New Kotlin ShadowJar convention plugin
examples/distro/buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts New Kotlin Java conventions plugin
examples/distro/buildSrc/src/main/kotlin/otel.instrumentation-conventions.gradle.kts New Kotlin instrumentation conventions plugin
examples/distro/buildSrc/build.gradle.kts buildSrc Kotlin DSL setup, Spotless & plugin deps
examples/distro/build.gradle.kts Root Kotlin DSL build script
examples/distro/build.gradle Removed Groovy root build script
examples/distro/bootstrap/build.gradle.kts Kotlin DSL bootstrap project build stub
examples/distro/bootstrap/build.gradle Removed Groovy bootstrap script
examples/distro/agent/build.gradle.kts Kotlin DSL agent distro build
examples/distro/agent/build.gradle Removed Groovy agent build script

}

val instrumentationTest = tasks.named("test")
val instrumentationDeps = dependencies
Copy link
Preview

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The instrumentationDeps variable is declared but never used. Consider removing it to reduce noise.

Suggested change
val instrumentationDeps = dependencies

Copilot uses AI. Check for mistakes.

}

val otelVersion = "1.51.0"
val otelAlphaVersion = otelVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")
Copy link
Preview

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The otelAlphaVersion variable is defined but not used anywhere in this script. You can remove it to simplify the code.

Suggested change
val otelAlphaVersion = otelVersion.replaceFirst("(-SNAPSHOT)?$".toRegex(), "-alpha$1")

Copilot uses AI. Check for mistakes.

Comment on lines +3 to +6
}

dependencies {
}
Copy link
Preview

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This dependencies block is empty and can be removed to declutter the build script.

Suggested change
}
dependencies {
}
}

Copilot uses AI. Check for mistakes.

@@ -1,5 +1,5 @@
plugins {
id "java"
id("otel.java-conventions")
}

dependencies {
Copy link
Preview

Copilot AI Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This dependencies block is empty and can be removed since there are no dependencies defined.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant