All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ajoberstar.grgit.gradle.GrgitServicePlugin Maven / Gradle / Ivy

There is a newer version: 5.3.0
Show newest version
package org.ajoberstar.grgit.gradle;

import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.provider.Provider;

public class GrgitServicePlugin implements Plugin {
  @Override
  public void apply(Project project) {
    GrgitServiceExtension extension = project.getExtensions().create("grgitService", GrgitServiceExtension.class);

    Provider serviceProvider = project.getGradle().getSharedServices().registerIfAbsent("grgit", GrgitService.class, spec -> {
      spec.getParameters().getCurrentDirectory().set(project.getLayout().getProjectDirectory());
      spec.getParameters().getInitIfNotExists().set(false);
      spec.getMaxParallelUsages().set(1);
    });

    extension.getService().set(serviceProvider);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy