Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable syntax highlighting #401

Merged
merged 1 commit into from
Oct 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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