diff --git a/grgit-gradle/src/main/groovy/org/ajoberstar/grgit/gradle/GrgitPlugin.groovy b/grgit-gradle/src/main/groovy/org/ajoberstar/grgit/gradle/GrgitPlugin.groovy index cb627949..e7519270 100644 --- a/grgit-gradle/src/main/groovy/org/ajoberstar/grgit/gradle/GrgitPlugin.groovy +++ b/grgit-gradle/src/main/groovy/org/ajoberstar/grgit/gradle/GrgitPlugin.groovy @@ -22,11 +22,11 @@ class GrgitPlugin implements Plugin { grgit.close() } - project.allprojects { prj -> - if (prj.ext.has('grgit')) { + project.allprojects { Project prj -> + if (prj.extensions.hasProperty('grgit')) { prj.logger.warn("Project ${prj.path} already has a grgit property. Remove org.ajoberstar.grgit from either ${prj.path} or ${project.path}.") } - prj.ext.grgit = grgit + prj.extensions.add(Grgit,"grgit", grgit) } } catch (Exception e) { project.logger.debug("Failed trying to find git repository for ${project.path}", e)