Skip to content

Commit

Permalink
Enable syntax highlighting
Browse files Browse the repository at this point in the history
I saw that the project is discontinued. But maybe you still want some colors for your README. Thanks for the work!
  • Loading branch information
johnjohndoe authored May 8, 2024
1 parent ffcda2e commit e9e00ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 '<version>'
}
Expand All @@ -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 {
Expand Down Expand Up @@ -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<GrgitService>` 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<GrgitService> 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());
Expand Down

0 comments on commit e9e00ea

Please sign in to comment.