Skip to content

Commit

Permalink
Generate grgit extension for Gradle Kotlin DSL
Browse files Browse the repository at this point in the history
  • Loading branch information
JLLeitschuh committed Jun 5, 2019
1 parent efe830d commit 7f464b4
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ class GrgitPlugin implements Plugin<Project> {
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)
project.ext.grgit = null
}
}
}

0 comments on commit 7f464b4

Please sign in to comment.