Skip to content

Commit

Permalink
Add golang based launcher
Browse files Browse the repository at this point in the history
The compiled, static binaries are used instead of a python script.
This is drop-in replacement with the same configuration/usage.
Implementation is covered by tests to ensure compatibility.

Co-authored-by: Jan Waś <[email protected]>
  • Loading branch information
wendigo and nineinchnick committed Nov 14, 2024
1 parent 9024dd9 commit 75ecbc2
Show file tree
Hide file tree
Showing 32 changed files with 3,502 additions and 527 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
with:
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: false
- name: Maven Install
run: ./mvnw install -B -V -DskipTests -Dair.check.skip-all
- name: Maven Tests
Expand Down
2 changes: 2 additions & 0 deletions launcher/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cover.out
src/main/resources/binaries/**/launcher2
44 changes: 42 additions & 2 deletions launcher/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,46 @@

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>build</id>
<goals>
<goal>exec</goal>
</goals>
<phase>compile</phase>
<configuration>
<executable>src/main/go/build.sh</executable>
</configuration>
</execution>
<execution>
<id>test</id>
<goals>
<goal>exec</goal>
</goals>
<phase>test</phase>
<configuration>
<skip>${skipTests}</skip>
<workingDirectory>${project.basedir}/src/main/go</workingDirectory>
<executable>go</executable>
<arguments>
<argument>test</argument>
<argument>-v</argument>
<argument>-race</argument>
<argument>-parallel=10</argument>
<argument>-timeout=10s</argument>
<argument>./...</argument>
</arguments>
<environmentVariables>
<JAVA_HOME />
</environmentVariables>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
Expand All @@ -35,15 +75,15 @@
</execution>

<execution>
<id>properties-tgz</id>
<id>static-tgz</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<attach>true</attach>
<descriptors>
<descriptor>src/main/assemblies/properties.xml</descriptor>
<descriptor>src/main/assemblies/static.xml</descriptor>
</descriptors>
</configuration>
</execution>
Expand Down
4 changes: 4 additions & 0 deletions launcher/src/main/assemblies/bin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,9 @@
<directory>src/main/resources/procname</directory>
<outputDirectory>/bin/procname</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/resources/binaries</directory>
<outputDirectory>/bin/</outputDirectory>
</fileSet>
</fileSets>
</assembly>
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@
<source>src/main/resources/launcher.properties</source>
<outputDirectory>/bin</outputDirectory>
</file>
<file>
<source>src/main/resources/launcher</source>
<outputDirectory>/bin</outputDirectory>
</file>
</files>
</assembly>
Loading

0 comments on commit 75ecbc2

Please sign in to comment.