Skip to content

Commit

Permalink
Switch from AppAssembler to Maven Assembly plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
neilcsmith-net committed Nov 6, 2023
1 parent f2a12b1 commit 49c23f7
Show file tree
Hide file tree
Showing 7 changed files with 249 additions and 118 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<module>praxiscore-hub</module>
<module>praxiscore-script</module>
<module>praxiscore-launcher</module>
<module>praxiscore-bin</module>
<module>praxiscore-data</module>
<module>praxiscore-video</module>
<module>praxiscore-video-code</module>
Expand All @@ -50,6 +49,7 @@
<module>praxiscore-code-ivy</module>
<module>praxiscore-launcher-jline</module>
<module>praxiscore-purl</module>
<module>praxiscore-bin</module>
</modules>

<scm>
Expand Down
46 changes: 28 additions & 18 deletions praxiscore-bin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,6 @@

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>2.1.0</version>
<configuration>
<repositoryLayout>flat</repositoryLayout>
<repositoryName>mods</repositoryName>
<useWildcardClassPath>true</useWildcardClassPath>
<unixScriptTemplate>${project.basedir}/src/bin/unixBinTemplate</unixScriptTemplate>
<windowsScriptTemplate>${project.basedir}/src/bin/windowsBinTemplate</windowsScriptTemplate>
<programs>
<program>
<mainClass>org.praxislive.bin.Main</mainClass>
<id>praxis</id>
</program>
</programs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand All @@ -48,6 +30,28 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<id>make-bin-dir</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>praxiscore</finalName>
<descriptors>
<descriptor>${basedir}/src/assembly/dir.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
<attach>false</attach>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
Expand Down Expand Up @@ -174,6 +178,12 @@
<groupId>${project.groupId}</groupId>
<artifactId>praxiscore-video-pgl-natives</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
23 changes: 23 additions & 0 deletions praxiscore-bin/src/assembly/_dist.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<component xmlns="http://maven.apache.org/ASSEMBLY-COMPONENT/2.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY-COMPONENT/2.1.0 https://maven.apache.org/xsd/assembly-component-2.1.0.xsd">
<dependencySets>
<dependencySet>
<outputDirectory>mods</outputDirectory>
</dependencySet>
</dependencySets>
<files>
<file>
<source>src/assembly/bin/praxis</source>
<outputDirectory>bin</outputDirectory>
<lineEnding>unix</lineEnding>
<fileMode>0755</fileMode>
</file>
<file>
<source>src/assembly/bin/praxis.cmd</source>
<outputDirectory>bin</outputDirectory>
<lineEnding>dos</lineEnding>
</file>
</files>
</component>
31 changes: 31 additions & 0 deletions praxiscore-bin/src/assembly/bin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you 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.
-->
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.1 https://maven.apache.org/xsd/assembly-2.1.1.xsd">
<id>bin</id>
<formats>
<format>tar.gz</format>
<format>zip</format>
</formats>
<componentDescriptors>
<componentDescriptor>src/assembly/_dist.xml</componentDescriptor>
</componentDescriptors>
</assembly>
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
#!/usr/bin/env sh
@LICENSE_HEADER@
# ----------------------------------------------------------------------------
# Copyright (c) 2023 Neil C Smith.
#
# 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.
# ----------------------------------------------------------------------------
#
# Derived from AppAssembler plugin launcher script
# Copyright (c) 2001-2006 The Apache Software Foundation.

# resolve links - $0 may be a softlink
PRG="$0"
Expand All @@ -19,7 +36,7 @@ BASEDIR=`cd "$PRGDIR/.." >/dev/null; pwd`

# Reset the REPO variable. If you need to influence this use the environment setup file.
REPO=
@ENV_SETUP@


if [ -z "$JAVACMD" ] ; then
if [ -x "$BASEDIR/jdk/" ] ; then
Expand Down Expand Up @@ -83,7 +100,7 @@ fi

if [ -z "$REPO" ]
then
REPO="$BASEDIR"/@REPO@
REPO="$BASEDIR"/mods
fi

# For Cygwin, switch paths to Windows format before running java
Expand All @@ -94,12 +111,12 @@ if $cygwin; then
[ -n "$REPO" ] && REPO=`cygpath --path --windows "$REPO"`
fi

exec "$JAVACMD" $JAVA_OPTS @EXTRA_JVM_ARGUMENTS@ \
exec "$JAVACMD" $JAVA_OPTS \
-p "$REPO" \
-Dapp.name="@APP_NAME@" \
-Dapp.name="praxis" \
-Dapp.pid="$$" \
-Dapp.repo="$REPO" \
-Dapp.home="$BASEDIR" \
-Dbasedir="$BASEDIR" \
-m org.praxislive.bin/@MAINCLASS@ \
@APP_ARGUMENTS@"$@"@UNIX_BACKGROUND@
-m org.praxislive.bin/org.praxislive.bin.Main \
"$@"
Loading

0 comments on commit 49c23f7

Please sign in to comment.