WIP: adding jlink build step

This commit is contained in:
Johan Maasing 2025-06-01 19:06:34 +02:00
parent 3175339bae
commit 5da8a2edd8
6 changed files with 63 additions and 21 deletions

View file

@ -11,28 +11,13 @@
<files>
<file>
<source>src/main/resources/run.sh</source>
<outputDirectory></outputDirectory>
<outputDirectory/>
<filtered>true</filtered>
</file>
</files>
<dependencySets>
<dependencySet>
<outputDirectory>libs</outputDirectory>
<excludes>
<exclude>nu.zoom.dsl:parser:*</exclude>
</excludes>
<useStrictFiltering>true</useStrictFiltering>
<outputFileNameMapping>${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension}</outputFileNameMapping>
<useTransitiveDependencies>true</useTransitiveDependencies>
<unpack>false</unpack>
<scope>runtime</scope>
<useProjectArtifact>false</useProjectArtifact>
</dependencySet>
<dependencySet>
<outputDirectory></outputDirectory>
<includes>
<include>nu.zoom.dsl:parser:*</include>
</includes>
<useStrictFiltering>true</useStrictFiltering>
<outputFileNameMapping>${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension}</outputFileNameMapping>
<useTransitiveDependencies>true</useTransitiveDependencies>

View file

@ -1,4 +1,4 @@
#! /bin/sh
#! /bin/bash
set -euo pipefail
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "${SCRIPT_DIR}"
java -jar parser-${artifact.baseVersion}.jar "$@"
java --module-path "${SCRIPT_DIR}"/libs -m nu.zoom.endgen/nu.zoom.dsl.cli.EndpointsCLI "$@"

49
endgen-jlink/pom.xml Normal file
View file

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
// Copyright 2025 "Johan Maasing" <johan@zoom.nu>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<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>
<parent>
<groupId>nu.zoom.dsl</groupId>
<artifactId>endgen</artifactId>
<version>1.3-SNAPSHOT</version>
</parent>
<artifactId>endgen-jlink</artifactId>
<dependencies>
<dependency>
<groupId>nu.zoom.dsl</groupId>
<artifactId>parser</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jlink-plugin</artifactId>
<version>3.2.0</version>
<extensions>true</extensions>
<configuration>
<!-- configuration elements goes here -->
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -52,6 +52,7 @@
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<release>${maven.compiler.target}</release>
</configuration>
</plugin>
<plugin>
@ -61,9 +62,9 @@
<configuration>
<archive>
<manifest>
<classpathPrefix>libs/</classpathPrefix>
<addClasspath>true</addClasspath>
<mainClass>nu.zoom.dsl.cli.EndpointsCLI</mainClass>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
</archive>
</configuration>

View file

@ -0,0 +1,6 @@
module nu.zoom.endgen {
requires freemarker;
requires info.picocli;
requires org.antlr.antlr4.runtime;
opens nu.zoom.dsl.cli to info.picocli;
}

View file

@ -66,6 +66,7 @@
<module>parser</module>
<module>endgen-dist</module>
<module>endgen-maven-plugin</module>
<module>endgen-jlink</module>
</modules>
</project>