Skip to content

Fix dependencies of the plugin-bundle module#70

Merged
alexander-yevsyukov merged 8 commits intomasterfrom
fix-dependency-on-compiler-gradle-api
Feb 12, 2026
Merged

Fix dependencies of the plugin-bundle module#70
alexander-yevsyukov merged 8 commits intomasterfrom
fix-dependency-on-compiler-gradle-api

Conversation

@alexander-yevsyukov
Copy link
Contributor

@alexander-yevsyukov alexander-yevsyukov commented Feb 12, 2026

This PR extends the code of manipulation with pom.xml in the plugin-bunle module so that CoreJvm Gradle Plugin can work by its own without requiring Compiler Gradle Plugin being already in the build classpath.

The tests/build.gradle.kts was adjusted accordingly.

Other notable changes

  • Gradle plugins that CoreJvm Copiler Gradle Plugin now applies the needed plugins via their classes rather than IDs. This is done so to highlight the fact of requiring corresponding dependencies being in the classpath, rather than requiring the user to add these dependencies either in the build classpath or via the plugin IDs to the project.

Copilot AI review requested due to automatic review settings February 12, 2026 20:29
@alexander-yevsyukov alexander-yevsyukov self-assigned this Feb 12, 2026
Copy link
Contributor

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 enables the CoreJvm Gradle Plugin to work independently without requiring the Compiler Gradle Plugin to be explicitly added to the build classpath. The changes make the plugin-bundle self-contained by including all necessary compiler dependencies as runtime dependencies in the published POM, while removing the requirement for users to manually add these dependencies.

Changes:

  • Bumped version from 2.0.0-SNAPSHOT.051 to 2.0.0-SNAPSHOT.052
  • Extended plugin-bundle to add compiler dependencies (compiler-gradle-plugin, compiler-gradle-api, compiler-params, protobuf-java-util) to the published POM with appropriate exclusions
  • Removed explicit Compiler plugin classpath dependencies from tests/build.gradle.kts since they're now provided transitively
  • Changed plugin application from string ID to type-safe class references in CoreJvmPlugin and CompilerConfigPlugin
  • Added gradleKotlinDsl() compileOnly dependency to support Kotlin DSL extension functions

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
version.gradle.kts Version bump to 2.0.0-SNAPSHOT.052
pom.xml Version bump to match new snapshot version
plugin-bundle/build.gradle.kts Added compiler dependencies (compiler-gradle-plugin, compiler-gradle-api, compiler-params, protobuf-java-util) to POM manipulation with exclusions; minor grammar fix in comment
tests/build.gradle.kts Removed explicit Compiler plugin classpath dependencies that are now provided transitively
gradle-plugins/src/main/kotlin/io/spine/tools/core/jvm/gradle/plugins/CoreJvmPlugin.kt Changed to apply ProtobufPlugin by class instead of by ID; renamed helper method from apply to doApply for clarity
gradle-plugins/src/main/kotlin/io/spine/tools/core/jvm/gradle/plugins/CompilerConfigPlugin.kt Changed to apply CompilerGradlePlugin by class; removed unused imports
gradle-plugins/build.gradle.kts Added gradleKotlinDsl() as compileOnly dependency for Kotlin DSL extensions
dependencies.md Auto-generated dependency report with updated timestamps and version references

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review February 12, 2026 20:39
Copilot AI review requested due to automatic review settings February 12, 2026 20:39
@alexander-yevsyukov alexander-yevsyukov changed the title Fix dependencies of the plugin-bundle Fix dependencies of the plugin-bundle module Feb 12, 2026
@alexander-yevsyukov alexander-yevsyukov requested review from armiol and removed request for Copilot February 12, 2026 20:39
Copilot AI review requested due to automatic review settings February 12, 2026 20:51
Copy link
Contributor

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 78 to 82
private fun Project.applyProtobufPlugin() {
if (!pluginManager.hasPlugin(ProtobufGradlePlugin.id)) {
// We carry the plugin as a runtime dependency of the fat JAR.
// So it will be available in the build classpath and found by the ID.
pluginManager.apply(ProtobufGradlePlugin.id)
project.apply<ProtobufPlugin>()
}
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

applyProtobufPlugin() applies Protobuf by class (apply<ProtobufPlugin>()) but the surrounding logic still relies on plugin ID checks/callbacks (hasPlugin(ProtobufGradlePlugin.id) here, and withPlugin(ProtobufGradlePlugin.id) in apply). When a plugin is applied by type, Gradle does not reliably associate it with an ID, so the ID-based check/callback may not observe the plugin and applyCoreJvmPlugins() may never run when Protobuf wasn’t already applied by ID. Prefer class-based checks/hooks (e.g., plugins.hasPlugin(ProtobufPlugin::class.java) / plugins.withType(ProtobufPlugin::class.java)) or apply CoreJvm plugins immediately after applying Protobuf.

Copilot uses AI. Check for mistakes.
* Add the dependency on the Protobuf Java Util library because it is
* used from the `compiler-params` module. Since we exclude the dependencies
* on Protobuf, we need to add the Util library manually.
* The code in `pom.xml` would look like this:
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

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

There’s an extra leading space in the block comment line before “The code in pom.xml would look like this:”, which makes the comment formatting inconsistent with the surrounding KDoc-style blocks. Consider removing the extra space for consistent formatting.

Suggested change
* The code in `pom.xml` would look like this:
* The code in `pom.xml` would look like this:

Copilot uses AI. Check for mistakes.
@alexander-yevsyukov alexander-yevsyukov merged commit ee09347 into master Feb 12, 2026
13 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the fix-dependency-on-compiler-gradle-api branch February 12, 2026 21:27
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.

3 participants