Skip to content

Conversation

@crowforkotlin
Copy link
Contributor

@crowforkotlin crowforkotlin commented Nov 10, 2025

  1. Plugins and dependencies are now managed uniformly using TOML, including Gradle's built-in plugins.

  2. File names have been renamed for easier searching and a more aesthetically pleasing appearance when prefixes are the same.

image

Copilot AI review requested due to automatic review settings November 10, 2025 09:35
Copy link

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 refactors a Kotlin compiler plugin template by renaming project modules from generic names to more descriptive names with a "template-" prefix and modernizing the build configuration to use Gradle version catalogs.

Key changes:

  • Renames modules from compiler-plugin, gradle-plugin, and plugin-annotations to template-compiler-plugin, template-gradle-plugin, and template-plugin-annotations
  • Migrates plugin declarations in build files from string-based to version catalog aliases
  • Adds complete implementation of compiler plugin infrastructure including FIR extension, IR generation, Gradle plugin, and test fixtures

Reviewed Changes

Copilot reviewed 10 out of 38 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
settings.gradle.kts Updates module names to use "template-" prefix
build.gradle.kts Reorganizes plugin declarations and updates references to use version catalog
gradle/libs.versions.toml Adds comprehensive library and plugin definitions with version catalog structure
template-plugin-annotations/build.gradle.kts Converts plugin declarations to use version catalog aliases
template-plugin-annotations/src/.../SomeAnnotation.kt Adds new annotation class for plugin
template-plugin-annotations/api/plugin-annotations.api Adds binary compatibility validation API signature
template-gradle-plugin/build.gradle.kts Updates to use version catalog and corrects project references
template-gradle-plugin/src/.../SimpleGradlePlugin.kt Implements Gradle plugin support for compiler plugin
template-gradle-plugin/src/.../SimpleGradleExtension.kt Adds extension class for Gradle plugin configuration
template-compiler-plugin/build.gradle.kts Migrates dependencies to version catalog and updates project references
template-compiler-plugin/src/.../SimplePluginComponentRegistrar.kt Implements compiler plugin registrar
template-compiler-plugin/src/.../SimplePluginRegistrar.kt Registers FIR extensions
template-compiler-plugin/src/.../SimpleCommandLineProcessor.kt Implements command line processor for plugin
template-compiler-plugin/src/.../fir/SimpleClassGenerator.kt Implements FIR declaration generation extension
template-compiler-plugin/src/.../ir/SimpleIrGenerationExtension.kt Implements IR generation extension
template-compiler-plugin/src/.../ir/SimpleIrBodyGenerator.kt Generates IR body for synthetic declarations
template-compiler-plugin/src/.../ir/AbstractTransformerForGenerator.kt Provides base transformer for IR generation
template-compiler-plugin/test-fixtures/.../services/* Adds test configuration services
template-compiler-plugin/test-fixtures/.../runners/* Adds abstract test runner classes
template-compiler-plugin/test-fixtures/.../GenerateTests.kt Updates test generation paths
template-compiler-plugin/testData/* Adds test data files and expected output
template-compiler-plugin/test-gen/* Adds generated test classes
template-compiler-plugin/resources/META-INF/services/* Adds service provider configuration files
compiler-plugin/test-gen/* Updates generated test file paths in legacy location

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

kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
build-config = { id = "com.github.gmazzo.buildconfig", version.ref = "build-config" }
binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "bcv" }
kotlin-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlin-binaryCompatibilityValidator"}
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

Missing space after closing brace. Should be kotlin-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlin-binaryCompatibilityValidator" }

Suggested change
kotlin-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlin-binaryCompatibilityValidator"}
kotlin-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlin-binaryCompatibilityValidator" }

Copilot uses AI. Check for mistakes.
build-config = { id = "com.github.gmazzo.buildconfig", version.ref = "build-config" }
binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "bcv" }
kotlin-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlin-binaryCompatibilityValidator"}
buildconfig = { id = "com.github.gmazzo.buildconfig", version.ref = "buildconfig"}
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

Missing space after closing brace. Should be buildconfig = { id = "com.github.gmazzo.buildconfig", version.ref = "buildconfig" }

Suggested change
buildconfig = { id = "com.github.gmazzo.buildconfig", version.ref = "buildconfig"}
buildconfig = { id = "com.github.gmazzo.buildconfig", version.ref = "buildconfig" }

Copilot uses AI. Check for mistakes.
kotlin-annotations-jvm = { group = "org.jetbrains.kotlin", name = "kotlin-annotations-jvm", version.ref = "kotlin" }
kotlin-compiler = { group = "org.jetbrains.kotlin", name = "kotlin-compiler", version.ref = "kotlin" }
kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin" }
kotlin-gradle-plugin-api = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin-api", version.ref = "kotlin" }
Copy link

Copilot AI Nov 10, 2025

Choose a reason for hiding this comment

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

Extra trailing space after kotlin-gradle-plugin-api. Consider removing the space for consistency with other library declarations.

Suggested change
kotlin-gradle-plugin-api = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin-api", version.ref = "kotlin" }
kotlin-gradle-plugin-api = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin-api", version.ref = "kotlin" }

Copilot uses AI. Check for mistakes.
Copy link
Member

@bnorm bnorm left a comment

Choose a reason for hiding this comment

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

I like the Toml + Gradle updates here but I'm still thinking about the subproject renaming part. If you can separate these changes into different PRs, I can merge the Toml changes and provide some feedback on the renaming.

@crowforkotlin crowforkotlin deleted the branch Kotlin:master November 13, 2025 03:08
@crowforkotlin crowforkotlin deleted the master branch November 13, 2025 03:08
@crowforkotlin
Copy link
Contributor Author

I like the Toml + Gradle updates here but I'm still thinking about the subproject renaming part. If you can separate these changes into different PRs, I can merge the Toml changes and provide some feedback on the renaming.

Actually, I think this naming seems pretty good, just like my own projects and this zipline project. The naming and structure look very clear. This is just my personal opinion.

image image

Thank you for your feedback. I did refer to previous posts where someone had already added TOML, but it didn't seem complete. So, I plan to first clarify the configuration part based on this template to make the architecture look better.

#35

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.

2 participants