diff --git a/src/main/groovy/com/github/breadmoirai/githubreleaseplugin/GithubReleasePlugin.groovy b/src/main/groovy/com/github/breadmoirai/githubreleaseplugin/GithubReleasePlugin.groovy index 4ad501e..c32e4b6 100644 --- a/src/main/groovy/com/github/breadmoirai/githubreleaseplugin/GithubReleasePlugin.groovy +++ b/src/main/groovy/com/github/breadmoirai/githubreleaseplugin/GithubReleasePlugin.groovy @@ -25,16 +25,11 @@ import org.slf4j.LoggerFactory class GithubReleasePlugin implements Plugin { - private Project project - private GithubReleaseTask task - @Override void apply(Project project) { - this.project = project - def ext = project.extensions.create('githubRelease', GithubReleaseExtension, project) - task = project.tasks.create('githubRelease', GithubReleaseTask) { + project.tasks.register('githubRelease', GithubReleaseTask) { it.with { setAuthorization ext.authorizationProvider setOwner ext.ownerProvider @@ -52,7 +47,7 @@ class GithubReleasePlugin implements Plugin { setDryRun ext.dryRunProvider setApiEndpoint ext.apiEndpointProvider } - } as GithubReleaseTask + } } }