Skip to content

Refactor afterEvaluated1 to afterEvaluated2 and update version#241

Merged
twisti-dev merged 1 commit intoversion/1.21.11from
fix/gradle-plugin
Mar 11, 2026
Merged

Refactor afterEvaluated1 to afterEvaluated2 and update version#241
twisti-dev merged 1 commit intoversion/1.21.11from
fix/gradle-plugin

Conversation

@twisti-dev
Copy link
Contributor

No description provided.

@twisti-dev twisti-dev self-assigned this Mar 11, 2026
Copilot AI review requested due to automatic review settings March 11, 2026 17:39
@twisti-dev twisti-dev merged commit ed2087b into version/1.21.11 Mar 11, 2026
4 of 5 checks passed
@twisti-dev twisti-dev deleted the fix/gradle-plugin branch March 11, 2026 17:40
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 refactors the Paper Gradle plugin lifecycle hook so shared Paper configuration runs in a final afterEvaluated1, while platform-specific logic moves into a new overridable afterEvaluated2. It also bumps the Gradle plugin module version.

Changes:

  • Introduce afterEvaluated2 in AbstractPaperSurfPlugin and delegate to it from a now-final afterEvaluated1.
  • Update PaperPluginSurfPlugin to override afterEvaluated2 instead of afterEvaluated1.
  • Bump surf-api-gradle-plugin version from -1.13.0 to -1.13.1.

Reviewed changes

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

File Description
surf-api-gradle-plugin/src/main/kotlin/dev/slne/surf/surfapi/gradle/platform/paper/plugin/PaperPluginSurfPlugin.kt Migrates Paper plugin-specific after-evaluation setup to the new afterEvaluated2 hook.
surf-api-gradle-plugin/src/main/kotlin/dev/slne/surf/surfapi/gradle/platform/paper/AbstractPaperSurfPlugin.kt Makes Paper shared after-evaluation behavior final and adds a new overridable hook for extensions.
surf-api-gradle-plugin/build.gradle.kts Increments the module version suffix.

}

override fun Project.afterEvaluated1(extension: E) {
final override fun Project.afterEvaluated1(extension: E) {
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

afterEvaluated1 overrides a protected hook from AbstractCoreSurfPlugin, but this override widens visibility (no protected). For consistency with the lifecycle-hook pattern used elsewhere (e.g. CommonSurfPlugin.afterEvaluated0, AbstractCoreSurfPlugin.afterEvaluated1), consider keeping this override protected while making it final (or otherwise ensure this hook isn’t unintentionally callable from unrelated code within the module).

Suggested change
final override fun Project.afterEvaluated1(extension: E) {
protected final override fun Project.afterEvaluated1(extension: E) {

Copilot uses AI. Check for mistakes.
Comment on lines +48 to +50
open fun Project.afterEvaluated2(extension: E) {

}
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

afterEvaluated2 is introduced as an open (public) hook with an empty body. Other lifecycle hooks in this plugin hierarchy are protected open, which better communicates intended usage and prevents unrelated module-internal code from calling it. Consider changing this to protected open and collapsing the empty implementation to {} (or adding a comment explaining why the hook exists).

Suggested change
open fun Project.afterEvaluated2(extension: E) {
}
protected open fun Project.afterEvaluated2(extension: E) {}

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.

2 participants