Merge branch 'master' into feature/mirror2

This commit is contained in:
Bane Stojkovic
2025-03-21 23:00:35 +01:00
5 changed files with 189 additions and 49 deletions
+16 -1
View File
@@ -2,4 +2,19 @@
JAVA_BIN="$(which java)" JAVA_BIN="$(which java)"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CLASS_PATH="${DIR}/diylc.jar" CLASS_PATH="${DIR}/diylc.jar"
exec java -Xms512m -Xmx4096m -Dorg.diylc.scriptRun=true -Dfile.encoding=UTF-8 -cp "$CLASS_PATH" --add-exports java.desktop/com.apple.eawt.event=ALL-UNNAMED --add-exports java.desktop/com.apple.eio=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED --add-opens java.desktop/java.awt.geom=ALL-UNNAMED org.diylc.DIYLCStarter "$@"
exec java \
-Xms1024m \
-Xmx4096m \
-Dorg.diylc.scriptRun=true \
-Dfile.encoding=UTF-8 \
-cp "$CLASS_PATH" \
--add-exports java.desktop/com.apple.eawt.event=ALL-UNNAMED \
--add-exports java.desktop/com.apple.eio=ALL-UNNAMED \
--add-opens java.base/java.util=ALL-UNNAMED \
--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.text=ALL-UNNAMED \
--add-opens java.desktop/java.awt=ALL-UNNAMED \
--add-opens java.desktop/java.awt.font=ALL-UNNAMED \
--add-opens java.desktop/java.awt.geom=ALL-UNNAMED \
org.diylc.DIYLCStarter "$@"
+72
View File
@@ -0,0 +1,72 @@
#!/bin/bash
# Build the AppImage
echo "Building AppImage..."
cd ../..
#mvn clean package -P linux-appimage
# Check if build was successful
if [ $? -ne 0 ]; then
echo "Build failed!"
exit 1
fi
# Get the AppImage path
APPIMAGE="target/DIYLayoutCreator-5.1.0-x86_64.AppImage"
ZIP_FILE="target/diylc-5.1.0-linux.zip"
# Check if files exist
if [ ! -f "$APPIMAGE" ]; then
echo "AppImage not found at $APPIMAGE"
exit 1
fi
if [ ! -f "$ZIP_FILE" ]; then
echo "Zip file not found at $ZIP_FILE"
exit 1
fi
# Create test directory
TEST_DIR="target/appimage-test"
rm -rf "$TEST_DIR"
mkdir -p "$TEST_DIR"
# Copy files to test directory
echo "Copying files to test directory..."
cp "$APPIMAGE" "$TEST_DIR/"
cp "$ZIP_FILE" "$TEST_DIR/"
# Extract zip file
echo "Extracting zip file..."
cd "$TEST_DIR"
unzip "diylc-5.1.0-linux.zip"
# Make AppImage executable
chmod +x "DIYLayoutCreator-5.1.0-x86_64.AppImage"
# Test AppImage structure
echo "Testing AppImage structure..."
if [ -f "DIYLayoutCreator-5.1.0-x86_64.AppImage" ]; then
echo "AppImage file exists and is executable"
echo "AppImage size: $(ls -lh DIYLayoutCreator-5.1.0-x86_64.AppImage | awk '{print $5}')"
echo "AppImage permissions: $(ls -l DIYLayoutCreator-5.1.0-x86_64.AppImage | awk '{print $1}')"
# Check if AppImage has the correct magic number
if file "DIYLayoutCreator-5.1.0-x86_64.AppImage" | grep -q "ELF 64-bit LSB executable"; then
echo "AppImage has correct ELF format"
else
echo "Warning: AppImage might not have correct ELF format"
fi
# Check if AppImage has the correct AppImage magic bytes
if dd if="DIYLayoutCreator-5.1.0-x86_64.AppImage" bs=8 count=1 2>/dev/null | grep -q "AI"; then
echo "AppImage has correct AppImage magic bytes"
else
echo "Warning: AppImage might not have correct AppImage magic bytes"
fi
echo "AppImage structure test completed successfully!"
else
echo "AppImage file not found in test directory!"
exit 1
fi
@@ -24,7 +24,7 @@
<requires64Bit>true</requires64Bit> <requires64Bit>true</requires64Bit>
<minVersion>17</minVersion> <minVersion>17</minVersion>
<maxVersion></maxVersion> <maxVersion></maxVersion>
<initialHeapSize>512</initialHeapSize> <initialHeapSize>1024</initialHeapSize>
<maxHeapSize>4096</maxHeapSize> <maxHeapSize>4096</maxHeapSize>
<opt>-Dorg.diylc.scriptRun=true</opt> <opt>-Dorg.diylc.scriptRun=true</opt>
<opt>-Dfile.encoding=UTF-8</opt> <opt>-Dfile.encoding=UTF-8</opt>
+98 -45
View File
@@ -260,47 +260,6 @@
</target> </target>
</configuration> </configuration>
</execution> </execution>
<execution>
<id>sign-jar-launcher</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Extract JavaAppLauncher -->
<unzip src="${project.build.directory}/diylc.jar" dest="${project.build.directory}/jar-contents">
<patternset>
<include name="com/oracle/appbundler/JavaAppLauncher"/>
</patternset>
</unzip>
<!-- Make it executable -->
<chmod file="${project.build.directory}/jar-contents/com/oracle/appbundler/JavaAppLauncher" perm="755"/>
<!-- Sign the launcher -->
<exec executable="codesign" failonerror="true">
<arg value="--force"/>
<arg value="--sign"/>
<arg value="${env.APPLE_DEVELOPER_IDENTITY}"/>
<arg value="--timestamp"/>
<arg value="--options"/>
<arg value="runtime"/>
<arg value="--entitlements"/>
<arg value="${project.basedir}/deploy/mac/entitlements.plist"/>
<arg value="--all-architectures"/>
<arg value="--strict"/>
<arg value="--verbose"/>
<arg value="${project.build.directory}/jar-contents/com/oracle/appbundler/JavaAppLauncher"/>
</exec>
<!-- Update the jar with signed launcher -->
<jar destfile="${project.build.directory}/diylc.jar" update="true">
<fileset dir="${project.build.directory}/jar-contents"/>
</jar>
</target>
</configuration>
</execution>
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
@@ -539,9 +498,17 @@
<fileset dir="${appdir.dir}" /> <fileset dir="${appdir.dir}" />
</copy> </copy>
<!-- Run AppImageTool in Docker --> <!-- Ensure proper permissions in Docker volume -->
<exec executable="chmod" failonerror="true" osfamily="mac">
<arg line="-R 755 ${project.build.directory}/docker-tmp/AppDir/AppRun" />
</exec>
<exec executable="chmod" failonerror="true" osfamily="mac">
<arg line="-R 755 ${project.build.directory}/docker-tmp/AppDir/usr/bin/diylc.sh" />
</exec>
<!-- Run AppImageTool in Docker with proper volume mounting -->
<exec executable="docker" failonerror="true" osfamily="mac"> <exec executable="docker" failonerror="true" osfamily="mac">
<arg line="run --rm -v &quot;${project.build.directory}/docker-tmp:/workspace&quot; -w /workspace appimagecrafters/appimage-builder:latest /bin/bash -c &quot;ARCH=x86_64 appimagetool AppDir ${appimage.output.file}&quot;" /> <arg line="run --rm -v &quot;${project.build.directory}/docker-tmp:/workspace&quot; -w /workspace appimagecrafters/appimage-builder:latest /bin/bash -c &quot;chmod +x AppDir/AppRun AppDir/usr/bin/diylc.sh &amp;&amp; ARCH=x86_64 appimagetool AppDir ${appimage.output.file}&quot;" />
</exec> </exec>
<!-- Copy the AppImage to the build directory --> <!-- Copy the AppImage to the build directory -->
@@ -703,6 +670,49 @@
</configuration> </configuration>
</execution> </execution>
<!-- Sign JAR launcher -->
<execution>
<id>sign-jar-launcher</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Extract JavaAppLauncher -->
<unzip src="${project.build.directory}/diylc.jar" dest="${project.build.directory}/jar-contents">
<patternset>
<include name="com/oracle/appbundler/JavaAppLauncher"/>
</patternset>
</unzip>
<!-- Make it executable -->
<chmod file="${project.build.directory}/jar-contents/com/oracle/appbundler/JavaAppLauncher" perm="755"/>
<!-- Sign the launcher -->
<exec executable="codesign" failonerror="true">
<arg value="--force"/>
<arg value="--sign"/>
<arg value="${env.APPLE_DEVELOPER_IDENTITY}"/>
<arg value="--timestamp"/>
<arg value="--options"/>
<arg value="runtime"/>
<arg value="--entitlements"/>
<arg value="${project.basedir}/deploy/mac/entitlements.plist"/>
<arg value="--all-architectures"/>
<arg value="--strict"/>
<arg value="--verbose"/>
<arg value="${project.build.directory}/jar-contents/com/oracle/appbundler/JavaAppLauncher"/>
</exec>
<!-- Update the jar with signed launcher -->
<jar destfile="${project.build.directory}/diylc.jar" update="true">
<fileset dir="${project.build.directory}/jar-contents"/>
</jar>
</target>
</configuration>
</execution>
<!-- Create macOS app bundle --> <!-- Create macOS app bundle -->
<execution> <execution>
<id>create-mac-bundle</id> <id>create-mac-bundle</id>
@@ -740,7 +750,7 @@
<runtime dir="${jre.dest.osx}/Contents/Home" /> <runtime dir="${jre.dest.osx}/Contents/Home" />
<arch name="x86_64"/> <arch name="x86_64"/>
<classpath file="${project.build.directory}/diylc.jar" /> <classpath file="${project.build.directory}/diylc.jar" />
<option value="-Xms512m" /> <option value="-Xms1024m" />
<option value="-Xmx4096m" /> <option value="-Xmx4096m" />
<option value="--add-exports=java.desktop/com.apple.eawt.event=ALL-UNNAMED" /> <option value="--add-exports=java.desktop/com.apple.eawt.event=ALL-UNNAMED" />
<option value="--add-exports=java.desktop/com.apple.eio=ALL-UNNAMED" /> <option value="--add-exports=java.desktop/com.apple.eio=ALL-UNNAMED" />
@@ -973,6 +983,49 @@
</configuration> </configuration>
</execution> </execution>
<!-- Sign JAR launcher -->
<execution>
<id>sign-jar-launcher</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Extract JavaAppLauncher -->
<unzip src="${project.build.directory}/diylc.jar" dest="${project.build.directory}/jar-contents">
<patternset>
<include name="com/oracle/appbundler/JavaAppLauncher"/>
</patternset>
</unzip>
<!-- Make it executable -->
<chmod file="${project.build.directory}/jar-contents/com/oracle/appbundler/JavaAppLauncher" perm="755"/>
<!-- Sign the launcher -->
<exec executable="codesign" failonerror="true">
<arg value="--force"/>
<arg value="--sign"/>
<arg value="${env.APPLE_DEVELOPER_IDENTITY}"/>
<arg value="--timestamp"/>
<arg value="--options"/>
<arg value="runtime"/>
<arg value="--entitlements"/>
<arg value="${project.basedir}/deploy/mac/entitlements.plist"/>
<arg value="--all-architectures"/>
<arg value="--strict"/>
<arg value="--verbose"/>
<arg value="${project.build.directory}/jar-contents/com/oracle/appbundler/JavaAppLauncher"/>
</exec>
<!-- Update the jar with signed launcher -->
<jar destfile="${project.build.directory}/diylc.jar" update="true">
<fileset dir="${project.build.directory}/jar-contents"/>
</jar>
</target>
</configuration>
</execution>
<!-- Create macOS app bundle --> <!-- Create macOS app bundle -->
<execution> <execution>
<id>create-mac-bundle</id> <id>create-mac-bundle</id>
@@ -1011,7 +1064,7 @@
<arch name="arm64"/> <arch name="arm64"/>
<arch name="arm64e"/> <arch name="arm64e"/>
<classpath file="${project.build.directory}/diylc.jar" /> <classpath file="${project.build.directory}/diylc.jar" />
<option value="-Xms512m" /> <option value="-Xms1024m" />
<option value="-Xmx4096m" /> <option value="-Xmx4096m" />
<option value="--add-exports=java.desktop/com.apple.eawt.event=ALL-UNNAMED" /> <option value="--add-exports=java.desktop/com.apple.eawt.event=ALL-UNNAMED" />
<option value="--add-exports=java.desktop/com.apple.eio=ALL-UNNAMED" /> <option value="--add-exports=java.desktop/com.apple.eio=ALL-UNNAMED" />
+2 -2
View File
@@ -23,7 +23,7 @@
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target> <maven.compiler.target>17</maven.compiler.target>
<log4j.version>1.2.15</log4j.version> <log4j.version>1.2.15</log4j.version>
<xstream.version>1.4.19</xstream.version> <xstream.version>1.4.21</xstream.version>
</properties> </properties>
<!-- Build configuration will be defined below --> <!-- Build configuration will be defined below -->
@@ -61,7 +61,7 @@
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.7</version> <version>4.13.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>