essential-actions

Clone or download

add gitaction to git

Modified Files

A gitclone/pom.xml
+95 −0
--- /dev/null
+++ b/gitclone/pom.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>com.stream-pi</groupId>
+ <artifactId>gitclone</artifactId>
+ <version>1.0.0</version>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.1.0</version>
+ <executions>
+ <execution>
+ <id>test-jar</id>
+ <phase>package</phase>
+ <goals>
+ <goal>test-jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.8.1</version>
+ <configuration>
+ <release>11</release>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <properties>
+ <ActionAPIVersion>1.0.0-SNAPSHOT</ActionAPIVersion>
+
+ <JavaFXVersion>16-ea+6</JavaFXVersion>
+
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <maven.compiler.source>11</maven.compiler.source>
+ <maven.compiler.target>11</maven.compiler.target>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.eclipse.jgit</groupId>
+ <artifactId>org.eclipse.jgit</artifactId>
+ <version>5.9.0.202009080501-r</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openjfx</groupId>
+ <artifactId>javafx-controls</artifactId>
+ <version>${JavaFXVersion}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openjfx</groupId>
+ <artifactId>javafx-graphics</artifactId>
+ <version>${JavaFXVersion}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.openjfx</groupId>
+ <artifactId>javafx-base</artifactId>
+ <version>${JavaFXVersion}</version>
+ </dependency>
+
+
+
+ <dependency>
+ <groupId>com.stream-pi</groupId>
+ <artifactId>action-api</artifactId>
+ <version>${ActionAPIVersion}</version>
+ </dependency>
+
+
+
+
+ <dependency>
+ <groupId>org.kordamp.ikonli</groupId>
+ <artifactId>ikonli-material-pack</artifactId>
+ <version>11.5.0</version>
+ </dependency>
+
+
+ </dependencies>
+
+</project>
--- /dev/null
+++ b/gitclone/src/main/java/com/stream_pi/gitclone/GitClone.java
@@ -0,0 +1,68 @@
+package com.stream_pi.gitclone;
+
+import com.stream_pi.action_api.actionproperty.property.ControlType;
+import com.stream_pi.action_api.actionproperty.property.FileExtensionFilter;
+import com.stream_pi.action_api.actionproperty.property.Property;
+import com.stream_pi.action_api.actionproperty.property.Type;
+import com.stream_pi.action_api.externalplugin.NormalAction;
+import com.stream_pi.util.alert.StreamPiAlert;
+import com.stream_pi.util.exception.MinorException;
+import com.stream_pi.util.version.Version;
+import javafx.scene.control.Button;
+
+import java.io.File;
+
+import org.eclipse.jgit.api.CloneCommand;
+import org.eclipse.jgit.api.Git;
+import org.eclipse.jgit.api.errors.GitAPIException;
+import org.eclipse.jgit.api.errors.InvalidRemoteException;
+import org.eclipse.jgit.api.errors.TransportException;
+
+public class GitClone extends NormalAction
+{
+
+ private Git call;
+
+
+ public GitClone()
+ {
+ setName("Git - Git Clone");
+ setAuthor("quimodotcom");
+ setHelpLink("https://github.com/quimodotcom/essentialactions");
+ setServerButtonGraphic("fas-git");
+ setVersion(new Version(1,0,1));
+
+ setCategory("Git Integration");
+
+ }
+
+ @Override
+ public void initProperties() throws Exception {
+ //Called First
+
+ Property property1 = new Property("cloneURL", Type.STRING);
+ property1.setDefaultValueStr("https://hmmmmyummy.com/somegitrepo");
+ property1.setDisplayName("Git Repo URL");
+
+ Property property2 = new Property("path", Type.STRING);
+ property2.setDisplayName("Output Path");
+
+
+ addClientProperties(
+ property1,
+ property2
+ );
+ }
+
+
+ @Override
+ public void onActionClicked() throws MinorException, InvalidRemoteException, TransportException, GitAPIException
+ {
+ CloneCommand git = Git.cloneRepository();
+ Property property1 = getClientProperties().getSingleProperty("cloneURL");
+ git.setURI(property1.getStringValue());
+ git.setDirectory(new File(getClientProperties().getSingleProperty("path").getStringValue()));
+ git.setCloneAllBranches(true);
+ git.call();
+ }
+}
--- /dev/null
+++ b/gitclone/src/main/java/module-info.java
@@ -0,0 +1,7 @@
+module com.stream_pi.gitclone
+{
+ requires com.stream_pi.action_api;
+ requires org.kordamp.ikonli.javafx;
+ requires org.eclipse.jgit;
+ provides com.stream_pi.action_api.externalplugin.ExternalPlugin with com.stream_pi.gitclone.GitClone;
+}