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

Executable CLI #32

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions build-graal.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set JAVA_HOME=C:\tools\graalvm-ce-java11-21.0.0
set PATH=%JAVA_HOME%\bin;%PATH%
cd keyconnect-cli
mvn -DskipTests -P release package
5 changes: 3 additions & 2 deletions keyconnect-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<okhttp.version>4.9.1</okhttp.version>
</properties>

<dependencies>
Expand All @@ -39,12 +40,12 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.8.1</version>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>4.8.1</version>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down
3 changes: 2 additions & 1 deletion keyconnect-chainbase/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<spring-boot.version>2.3.3.RELEASE</spring-boot.version>
<okhttp.version>4.9.1</okhttp.version>
</properties>

<dependencyManagement>
Expand All @@ -42,7 +43,7 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.0</version>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>app.keyconnect</groupId>
Expand Down
127 changes: 126 additions & 1 deletion keyconnect-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>4.5.2</version>
<version>4.6.1</version>
</dependency>
<dependency>
<groupId>app.keyconnect.api</groupId>
Expand Down Expand Up @@ -63,10 +63,46 @@
<artifactId>slf4j-simple</artifactId>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>1.7.25</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>native-image-maven-plugin</artifactId>
<version>21.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli-codegen</artifactId>
<version>4.6.1</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
<plugins>
<!--<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
&lt;!&ndash; annotationProcessorPaths requires maven-compiler-plugin version 3.5 or higher &ndash;&gt;
<version>3.8.1</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>info.picocli</groupId>
<artifactId>picocli-codegen</artifactId>
<version>4.6.1</version>
</path>
</annotationProcessorPaths>
<compilerArgs>
<arg>-Aproject=${project.groupId}/${project.artifactId}</arg>
</compilerArgs>
</configuration>
</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
Expand All @@ -75,6 +111,8 @@
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<finalName>kc</finalName>
<appendAssemblyId>false</appendAssemblyId>
<archive>
<manifest>
<mainClass>app.keyconnect.cli.CommandLineApplication</mainClass>
Expand All @@ -94,4 +132,91 @@
</plugins>
</build>

<profiles>
<profile>
<id>release</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>native-image-maven-plugin</artifactId>
<version>21.0.0</version>
<executions>
<execution>
<goals>
<goal>native-image</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
<configuration>
<buildArgs>-H:+ReportExceptionStackTraces --no-fallback --enable-all-security-services</buildArgs>
<imageName>kc</imageName>
</configuration>
</plugin>
<!--<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>1.7.25</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
</execution>
</executions>
<configuration>
<headerType>console</headerType>
<outfile>${project.build.directory}/kc.exe</outfile>
<jar>${project.build.directory}/kc.jar</jar>
<jre>
<path>./jre</path>
<minVersion>15.0.2</minVersion>
</jre>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>download-files</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
&lt;!&ndash; download file &ndash;&gt;
<get src="https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.2%2B7/OpenJDK15U-jre_x64_windows_hotspot_15.0.2_7.zip"
dest="${project.build.directory}/jre.zip"
verbose="false"

usetimestamp="true"/>
<unzip src="${project.build.directory}/jre.zip"
dest="${project.build.directory}/jre"/>
<move todir="${project.build.directory}/jre" overwrite="true">
<fileset dir="${project.build.directory}/jre/jdk-15.0.2+7-jre">
<include name="**/*"/>
</fileset>
</move>
<delete dir="${project.build.directory}/jre/jdk-15.0.2+7-jre"/>
<delete dir="${project.build.directory}/jre.zip"/>
<zip destfile="${project.build.directory}/kc-win.zip"
basedir="${project.build.directory}"
includes="jre/**,kc.exe"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>-->
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import app.keyconnect.api.client.BlockchainsApi;
import app.keyconnect.api.client.RatesApi;
import app.keyconnect.api.client.ServerApi;
import okhttp3.logging.HttpLoggingInterceptor;
import org.jetbrains.annotations.NotNull;
import picocli.CommandLine.Option;

Expand Down
3 changes: 2 additions & 1 deletion keyconnect-rippled-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
<okhttp.version>4.9.1</okhttp.version>
</properties>

<dependencies>
Expand All @@ -38,7 +39,7 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.8.1</version>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>io.gsonfire</groupId>
Expand Down
3 changes: 2 additions & 1 deletion keyconnect-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<spring-boot.version>2.3.8.RELEASE</spring-boot.version>
<junit-jupiter.version>5.3.2</junit-jupiter.version>
<start-class>app.keyconnect.server.KeyConnectApplication</start-class>
<okhttp.version>4.9.1</okhttp.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -68,7 +69,7 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.0</version>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
Expand Down