Skip to content

Commit eb72808

Browse files
committed
renaming Astra Shell and integration with Parent
1 parent cb73bbc commit eb72808

36 files changed

+223
-781
lines changed

astra-sdk/pom.xml.versionsBackup

Lines changed: 0 additions & 67 deletions
This file was deleted.

astra-sh/src/test/resources/main.cmd

Lines changed: 0 additions & 90 deletions
This file was deleted.

astra-sh/src/test/resources/sh.yml

Whitespace-only changes.
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<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/maven-v4_0_0.xsd">
3+
<parent>
4+
<artifactId>astra-sdk-parent</artifactId>
5+
<groupId>com.datastax.astra</groupId>
6+
<version>0.3.1-SNAPSHOT</version>
7+
</parent>
8+
<modelVersion>4.0.0</modelVersion>
9+
<artifactId>astra-sh</artifactId>
10+
<name>+ astra-shell</name>
11+
<build>
12+
<pluginManagement>
13+
<plugins>
14+
<plugin>
15+
<groupId>org.codehaus.mojo</groupId>
16+
<artifactId>exec-maven-plugin</artifactId>
17+
<version>${maven-plugin-exec.version}</version>
18+
<executions>
19+
<execution>
20+
<goals>
21+
<goal>exec</goal>
22+
</goals>
23+
</execution>
24+
</executions>
25+
<configuration>
26+
<mainClass>com.datastax.astra.AstraShell</mainClass>
27+
<additionalClasspathElements>
28+
<additionalClasspathElement>src/test/resources</additionalClasspathElement>
29+
</additionalClasspathElements>
30+
</configuration>
31+
</plugin>
32+
</plugins>
33+
</pluginManagement>
34+
<plugins>
35+
<plugin>
36+
<artifactId>maven-shade-plugin</artifactId>
37+
<version>3.3.0</version>
38+
<executions>
39+
<execution>
40+
<goals>
41+
<goal>shade</goal>
42+
</goals>
43+
<configuration>
44+
<shadedArtifactAttached>true</shadedArtifactAttached>
45+
<transformers>
46+
<transformer>
47+
<mainClass>com.datastax.astra.AstraShell</mainClass>
48+
</transformer>
49+
</transformers>
50+
<filters>
51+
<filter>
52+
<artifact>*:*</artifact>
53+
<excludes>
54+
<exclude>META-INF/*.SF</exclude>
55+
<exclude>META-INF/*.DSA</exclude>
56+
<exclude>META-INF/*.RSA</exclude>
57+
</excludes>
58+
</filter>
59+
</filters>
60+
</configuration>
61+
</execution>
62+
</executions>
63+
</plugin>
64+
</plugins>
65+
</build>
66+
<dependencies>
67+
<dependency>
68+
<groupId>org.junit.jupiter</groupId>
69+
<artifactId>junit-jupiter-engine</artifactId>
70+
<version>5.8.2</version>
71+
<scope>test</scope>
72+
<exclusions>
73+
<exclusion>
74+
<artifactId>junit-platform-engine</artifactId>
75+
<groupId>org.junit.platform</groupId>
76+
</exclusion>
77+
</exclusions>
78+
</dependency>
79+
<dependency>
80+
<groupId>org.junit.platform</groupId>
81+
<artifactId>junit-platform-runner</artifactId>
82+
<version>1.8.2</version>
83+
<scope>test</scope>
84+
<exclusions>
85+
<exclusion>
86+
<artifactId>junit</artifactId>
87+
<groupId>junit</groupId>
88+
</exclusion>
89+
<exclusion>
90+
<artifactId>junit-platform-launcher</artifactId>
91+
<groupId>org.junit.platform</groupId>
92+
</exclusion>
93+
<exclusion>
94+
<artifactId>junit-platform-suite-api</artifactId>
95+
<groupId>org.junit.platform</groupId>
96+
</exclusion>
97+
<exclusion>
98+
<artifactId>junit-platform-suite-commons</artifactId>
99+
<groupId>org.junit.platform</groupId>
100+
</exclusion>
101+
</exclusions>
102+
</dependency>
103+
</dependencies>
104+
<properties>
105+
<commons-cli.version>1.5.0</commons-cli.version>
106+
<maven-plugin-exec.version>3.0.0</maven-plugin-exec.version>
107+
<jansi.version>2.4.0</jansi.version>
108+
<commons-lang.version>3.12.0</commons-lang.version>
109+
</properties>
110+
</project>

astra-sh/pom.xml renamed to astra-shell/pom.xml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66
<artifactId>astra-sh</artifactId>
7-
<name>+ astra-sh</name>
7+
<name>+ astra-shell</name>
88
<packaging>jar</packaging>
99

1010
<parent>
@@ -41,7 +41,7 @@
4141
<artifactId>commons-lang3</artifactId>
4242
<version>${commons-lang.version}</version>
4343
</dependency>
44-
44+
4545
<!-- Unit tests -->
4646
<dependency>
4747
<groupId>org.junit.jupiter</groupId>
@@ -88,5 +88,39 @@
8888
</plugin>
8989
</plugins>
9090
</pluginManagement>
91+
92+
<plugins>
93+
<plugin>
94+
<groupId>org.apache.maven.plugins</groupId>
95+
<artifactId>maven-shade-plugin</artifactId>
96+
<version>3.3.0</version>
97+
<executions>
98+
<execution>
99+
<goals>
100+
<goal>shade</goal>
101+
</goals>
102+
<configuration>
103+
<shadedArtifactAttached>true</shadedArtifactAttached>
104+
<transformers>
105+
<transformer
106+
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
107+
<mainClass>com.datastax.astra.AstraShell</mainClass>
108+
</transformer>
109+
</transformers>
110+
<filters>
111+
<filter>
112+
<artifact>*:*</artifact>
113+
<excludes>
114+
<exclude>META-INF/*.SF</exclude>
115+
<exclude>META-INF/*.DSA</exclude>
116+
<exclude>META-INF/*.RSA</exclude>
117+
</excludes>
118+
</filter>
119+
</filters>
120+
</configuration>
121+
</execution>
122+
</executions>
123+
</plugin>
124+
</plugins>
91125
</build>
92126
</project>
File renamed without changes.

astra-sh/src/main/java/com/datastax/astra/AstraShell.java renamed to astra-shell/src/main/java/com/datastax/astra/AstraShell.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public static void main(String[] args) throws Exception {
4646
* Parsing and initializaion
4747
*/
4848
String token = parseStartCommand(args);
49+
4950
ShellContext ctx = ShellContext.getInstance();
5051
ctx.init(token);
5152
ctx.validate();
@@ -67,6 +68,18 @@ public static void main(String[] args) throws Exception {
6768
}
6869
}
6970

71+
/**
72+
* Syntax sugar to help with tests
73+
*
74+
* @param args
75+
* arguments
76+
* @throws Exception
77+
* error during parsing or interpreting command
78+
*/
79+
public static void exec(String... args) throws Exception {
80+
main(args);
81+
}
82+
7083
/**
7184
* Parse user input to get command asked.
7285
*
@@ -150,7 +163,7 @@ private static String parseStartCommand(String[] args) {
150163

151164
// --help or -h = Show help and quit
152165
if (cli.hasOption(optionHelp)) {
153-
new HelpFormatter().printHelp("astra", startOptions);
166+
new HelpFormatter().printHelp("astra [CMD] [OPTIONS]", startOptions);
154167
SUCCESS.exit();
155168
}
156169

@@ -173,6 +186,10 @@ private static String parseStartCommand(String[] args) {
173186
if (cli.hasOption(optionToken)) {
174187
token = cli.getOptionValue(optionToken);
175188
}
189+
190+
if (cli.getArgList().size() == 1) {
191+
// NOT INTERACTIVE
192+
}
176193

177194
} catch (ParseException e) {
178195
Out.error(e.getMessage());

0 commit comments

Comments
 (0)