Properties not found in closures

If we reference a property of an task inside a closure then we receive the follow error. If we reference it with the it operator it work:

* What went wrong:
A problem occurred evaluating root project 'test'.
> Could not set unknown property 'identity' for task ':dmg' of type com.inet.gradle.setup.dmg.Dmg.

This is a small build script for Gradle 7.2 to demonstrate problem:

plugins {
  id "de.inetsoftware.setupbuilder" version "7.2.11"
dmg {
    codeSign {
        it.identity = 'foobar'
        identity = 'foobar' // <- failed

Before there was some changes for Gradle 7 inside of the SetupBuilder Plugin it has work. Why Gradle does not search anymore inside the current object and try it with the parent closure? What we need to change on the SetupBuilder Plugin?

The sources of the plugin are at:

PS: There was a signature change from:

public void setCodeSign( Closure<OSXCodeSign<Dmg, SetupBuilder>> closure )


public void setCodeSign( Action<? super OSXCodeSign<? super Dmg,? super SetupBuilder>> action )

Can this be related to the problem? What is best practice here?