Skip to content

Commit

Permalink
gh-2 minimal selfcontained executable
Browse files Browse the repository at this point in the history
  • Loading branch information
nmwael committed Sep 30, 2024
1 parent 5aef275 commit 04d71bb
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 17 deletions.
6 changes: 6 additions & 0 deletions console/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
windows https://download.oracle.com/graalvm/23/latest/graalvm-jdk-23_windows-x64_bin.zip
https://github.com/upx/upx/releases/tag/v4.2.4

run:
maven install -Pnative
upx-4.2.4-win64\upx.exe -k my-app.exe
63 changes: 63 additions & 0 deletions console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,69 @@
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven-jar-plugin.version>3.2.2</maven-jar-plugin.version>
<native.maven.plugin.version>0.10.3</native.maven.plugin.version>

</properties>
<build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration>
<archive>
<manifest>
<mainClass>com.gvm.samples.App</mainClass>
</manifest>
</archive>
</configuration>
</plugin>

</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>${native.maven.plugin.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<id>build-native</id>
<goals>
<goal>compile-no-fork</goal>
</goals>
<phase>package</phase>
</execution>

</executions>
<configuration>
<imageName>my-app</imageName>
<verbose>true</verbose>
<!-- For Quick Build (22.1+) -->
<!-- <quickBuild>true</quickBuild> -->
<buildArgs>

<buildArg>-Os</buildArg>
<buildArg>--emit build-report</buildArg>

<!-- For mostly static native image (only on Linux AMD64 systems) -->
<!-- <buildArg>-H:+StaticExecutableWithDynamicLibC</buildArg> -->
<!-- To generate the Native Image build output JSON (22.3+) -->
<!-- <buildArg>-H:BuildOutputJSONFile=build.json</buildArg> -->
</buildArgs>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
17 changes: 0 additions & 17 deletions console/src/main/java/person/nmwael/summerofcode24/Main.java

This file was deleted.

0 comments on commit 04d71bb

Please sign in to comment.