Skip to content

Make build-logic plugins expose binary plugins#3047

Merged
paul-dingemans merged 3 commits intopinterest:masterfrom
mateuszkwiecinski:migrate_away_kotlin_dsl
Jul 12, 2025
Merged

Make build-logic plugins expose binary plugins#3047
paul-dingemans merged 3 commits intopinterest:masterfrom
mateuszkwiecinski:migrate_away_kotlin_dsl

Conversation

@mateuszkwiecinski
Copy link
Copy Markdown
Contributor

Description

Latest development has been facing challenges due to Kotlin version enforced by kotlin-dsl plugin.
This PR migrates build-logic to leverage binary plugins so the build-logic project is no longer affected by kotlin-dsl plugin restrictions.

Checklist

Before submitting the PR, please check following (checks which are not relevant may be ignored):

  • Commit message are well written. In addition to a short title, the commit message also explain why a change is made.
  • At least one commit message contains a reference Closes #<xxx> or Fixes #<xxx> (replace<xxx> with issue number)
  • Tests are added
  • KtLint format has been applied on source code itself and violations are fixed
  • PR title is short and clear (it is used as description in the release changelog)
  • PR description added (background information)

Documentation is updated. See difference between snapshot and release documentation

  • Snapshot documentation in case documentation is to be released together with a code change
  • Release documentation in case documentation is related to a released version of ktlint and has to be published as soon as the change is merged to master

Copy link
Copy Markdown
Contributor Author

@mateuszkwiecinski mateuszkwiecinski left a comment

Choose a reason for hiding this comment

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

The build should be ready for review. Please accept the changes only if you find it as understandable as the current setup 😅
I'd say it's not worth merging if it feels worse in any way. I believe all of kotlin-dsl restrictions can always be worked around, like we did in the poko plugin bump

Comment thread build-logic/build.gradle.kts
Comment thread build-logic/build.gradle.kts
Comment thread build-logic/build.gradle.kts
Comment thread build-logic/build.gradle.kts
Comment thread build-logic/build.gradle.kts
Comment thread build-logic/src/main/kotlin/DokkaPlugin.kt
@mateuszkwiecinski mateuszkwiecinski marked this pull request as ready for review July 6, 2025 15:18
Copy link
Copy Markdown
Collaborator

@paul-dingemans paul-dingemans left a comment

Choose a reason for hiding this comment

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

Cool. I think that for me the complexity is comparable to the old situation. There are just many parts in the build process that I am not really acquainted with. I trust on your experience that this is easier to maintain.

Comment thread build-logic/src/main/kotlin/KotlinCommonPlugin.kt
Comment thread build-logic/src/main/kotlin/PublicationPlugin.kt Outdated
@mateuszkwiecinski mateuszkwiecinski force-pushed the migrate_away_kotlin_dsl branch from a78577c to b38d5cc Compare July 8, 2025 14:34
Comment thread build-logic/src/main/kotlin/KotlinCommonPlugin.kt Outdated
@mateuszkwiecinski mateuszkwiecinski force-pushed the migrate_away_kotlin_dsl branch 2 times, most recently from e8dab5d to ddf6ac4 Compare July 10, 2025 06:33
@paul-dingemans paul-dingemans merged commit 84fa732 into pinterest:master Jul 12, 2025
14 of 26 checks passed
@mateuszkwiecinski mateuszkwiecinski deleted the migrate_away_kotlin_dsl branch July 13, 2025 06:45
@paul-dingemans paul-dingemans added this to the 1.7.0 milestone Jul 14, 2025
Comment on lines +12 to +14
pluginManager.apply("ktlint-kotlin-common")
pluginManager.apply("ktlint-dokka")
pluginManager.apply("ktlint-publication")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
pluginManager.apply("ktlint-kotlin-common")
pluginManager.apply("ktlint-dokka")
pluginManager.apply("ktlint-publication")
pluginManager.apply(KotlinCommonPlugin::class.java)
pluginManager.apply(DokkaPlugin::class.java)
pluginManager.apply(PublicationPlugin::class.java)

Why not these?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

They are functionally the same and the benefit is string format is more similar to what's used within projects' build.gradle.kts files

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The class usages are type-safe in the context.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

They are functionally the same and the benefit is string format is more similar to what's used within projects' build.gradle.kts files

I favor this approach as well. A simple search reveals all relevant places:
Screenshot 2025-07-16 at 17 40 52

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