mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-01 19:15:52 +01:00
CLI Support for repository actions (#1987)
To make SCM-Manager more accessible and to make it easier using scripts against the server, we created a command line interface. This command line interface can be used to perform the default actions like create, modify and delete repositories. It is also very flexible and can be extended by plugins. The CLI already supports internationalization, help texts, input validation, loose and table-like templates and nested subcommands. Check the cli guidelines to learn how add new cli commands. Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
This commit is contained in:
@@ -34,6 +34,7 @@ import org.mapstruct.Mapper;
|
||||
import org.w3c.dom.DOMException;
|
||||
import org.w3c.dom.Document;
|
||||
import org.xml.sax.SAXException;
|
||||
import picocli.CommandLine;
|
||||
import sonia.scm.annotation.ClassSetElement.ClassWithAttributes;
|
||||
import sonia.scm.plugin.PluginAnnotation;
|
||||
import sonia.scm.plugin.Requires;
|
||||
@@ -98,7 +99,8 @@ public final class ScmAnnotationProcessor extends AbstractProcessor {
|
||||
private static final Set<ClassAnnotation> CLASS_ANNOTATIONS =
|
||||
ImmutableSet.of(new ClassAnnotation("rest-resource", Path.class),
|
||||
new ClassAnnotation("rest-provider", Provider.class),
|
||||
new ClassAnnotation("mapper", Mapper.class));
|
||||
new ClassAnnotation("mapper", Mapper.class),
|
||||
new ClassAnnotation("cli-command", CommandLine.Command.class));
|
||||
|
||||
@Override
|
||||
public boolean process(Set<? extends TypeElement> annotations,
|
||||
@@ -144,7 +146,8 @@ public final class ScmAnnotationProcessor extends AbstractProcessor {
|
||||
TypeElement annotation = null;
|
||||
|
||||
for (TypeElement typeElement : annotations) {
|
||||
if (typeElement.getQualifiedName().toString().equals(annotationClass.getName())) {
|
||||
// Replace $ with . to match subclasses
|
||||
if (typeElement.getQualifiedName().toString().equals(annotationClass.getName().replace("$", "."))) {
|
||||
annotation = typeElement;
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user