mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Merge branch 'master' into feature/mirror2
This commit is contained in:
@@ -2,4 +2,19 @@
|
||||
JAVA_BIN="$(which java)"
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
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
@@ -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>
|
||||
<minVersion>17</minVersion>
|
||||
<maxVersion></maxVersion>
|
||||
<initialHeapSize>512</initialHeapSize>
|
||||
<initialHeapSize>1024</initialHeapSize>
|
||||
<maxHeapSize>4096</maxHeapSize>
|
||||
<opt>-Dorg.diylc.scriptRun=true</opt>
|
||||
<opt>-Dfile.encoding=UTF-8</opt>
|
||||
|
||||
+98
-45
@@ -260,47 +260,6 @@
|
||||
</target>
|
||||
</configuration>
|
||||
</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>
|
||||
</plugin>
|
||||
</plugins>
|
||||
@@ -539,9 +498,17 @@
|
||||
<fileset dir="${appdir.dir}" />
|
||||
</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">
|
||||
<arg line="run --rm -v "${project.build.directory}/docker-tmp:/workspace" -w /workspace appimagecrafters/appimage-builder:latest /bin/bash -c "ARCH=x86_64 appimagetool AppDir ${appimage.output.file}"" />
|
||||
<arg line="run --rm -v "${project.build.directory}/docker-tmp:/workspace" -w /workspace appimagecrafters/appimage-builder:latest /bin/bash -c "chmod +x AppDir/AppRun AppDir/usr/bin/diylc.sh && ARCH=x86_64 appimagetool AppDir ${appimage.output.file}"" />
|
||||
</exec>
|
||||
|
||||
<!-- Copy the AppImage to the build directory -->
|
||||
@@ -703,6 +670,49 @@
|
||||
</configuration>
|
||||
</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 -->
|
||||
<execution>
|
||||
<id>create-mac-bundle</id>
|
||||
@@ -740,7 +750,7 @@
|
||||
<runtime dir="${jre.dest.osx}/Contents/Home" />
|
||||
<arch name="x86_64"/>
|
||||
<classpath file="${project.build.directory}/diylc.jar" />
|
||||
<option value="-Xms512m" />
|
||||
<option value="-Xms1024m" />
|
||||
<option value="-Xmx4096m" />
|
||||
<option value="--add-exports=java.desktop/com.apple.eawt.event=ALL-UNNAMED" />
|
||||
<option value="--add-exports=java.desktop/com.apple.eio=ALL-UNNAMED" />
|
||||
@@ -973,6 +983,49 @@
|
||||
</configuration>
|
||||
</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 -->
|
||||
<execution>
|
||||
<id>create-mac-bundle</id>
|
||||
@@ -1011,7 +1064,7 @@
|
||||
<arch name="arm64"/>
|
||||
<arch name="arm64e"/>
|
||||
<classpath file="${project.build.directory}/diylc.jar" />
|
||||
<option value="-Xms512m" />
|
||||
<option value="-Xms1024m" />
|
||||
<option value="-Xmx4096m" />
|
||||
<option value="--add-exports=java.desktop/com.apple.eawt.event=ALL-UNNAMED" />
|
||||
<option value="--add-exports=java.desktop/com.apple.eio=ALL-UNNAMED" />
|
||||
|
||||
Reference in New Issue
Block a user