From e9e00ea215b4105972ed04848d6644ea37c53442 Mon Sep 17 00:00:00 2001 From: Tobias Preuss Date: Wed, 8 May 2024 09:06:02 +0200 Subject: [PATCH] Enable syntax highlighting I saw that the project is discontinued. But maybe you still want some colors for your README. Thanks for the work! --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c2385c49..a3ab543a 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Apply the `org.ajoberstar.grgit` plugin in any project that needs to access a `G NOTE: This plugin eagerly opens a Grgit instance, which may not be needed depending on the tasks you want to run. If this is not desired, see the next section. -``` +``` groovy plugins { id 'org.ajoberstar.grgit' version '' } @@ -68,7 +68,7 @@ Apply the `org.ajoberstar.grgit.service` plugin instead of `org.ajoberstar.grgit This approach ensures you only open a `Grgit` instance when a task is run that uses it. -``` +``` groovy import org.ajoberstar.grgit.gradle.GrgitService plugins { @@ -100,7 +100,7 @@ If you are writing a custom Gradle plugin, you'll want to use one or both of the - If you need a `Grgit` instance representing the repository the project is in, use `org.ajoberstar.grgit.service` and use the `GrgitServiceExtension` to access the shared `GrgitService`. Wire this into any tasks or whatever needs to use the service via `Property` for full lazy evaluation benefits. - If you need a `Grgit` instance that's separate from the project's repository, declare your own `GrgitService` naming it something _not_ prefixed with `grgit*`. - ``` + ``` groovy Provider serviceProvider = project.getGradle().getSharedServices().registerIfAbsent("grgit", GrgitService.class, spec -> { // use getCurrentDirectory() if you need to search upwards from the provided directory spec.getParameters().getCurrentDirectory().set(project.getLayout().getProjectDirectory());