mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
building for win and linux
This commit is contained in:
+108
-16
@@ -427,22 +427,28 @@
|
||||
<!-- Clean up temporary directory -->
|
||||
<delete dir="${project.build.directory}/docker-tmp" />
|
||||
|
||||
<!-- Linux-specific build -->
|
||||
<echo message="Linux build will execute: ${isLinux}" />
|
||||
<exec executable="bash" failonerror="true" osfamily="unix">
|
||||
<arg line="-c 'echo Building AppImage natively on Linux...'" />
|
||||
</exec>
|
||||
|
||||
<!-- Install dependencies if needed -->
|
||||
<exec executable="bash" failonerror="true" osfamily="unix">
|
||||
<arg line="-c 'which appimagetool || (echo "Installing appimagetool..." && sudo apt-get update && sudo apt-get install -y libfuse2 fuse && wget -O /tmp/appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage && chmod +x /tmp/appimagetool && sudo mv /tmp/appimagetool /usr/local/bin/)'" />
|
||||
</exec>
|
||||
|
||||
<!-- Build AppImage -->
|
||||
<exec executable="bash" failonerror="true" osfamily="unix">
|
||||
<arg line="-c 'appimagetool ${appdir.dir} ${project.build.directory}/${appimage.output.file}'" />
|
||||
</exec>
|
||||
|
||||
<!-- <!– Linux-specific build –>-->
|
||||
<!-- <echo message="Linux build will execute: ${isLinux}" />-->
|
||||
<!-- <exec executable="bash" failonerror="true" osfamily="unix">-->
|
||||
<!-- <arg line="-c 'echo Building AppImage natively on Linux...'" />-->
|
||||
<!-- </exec>-->
|
||||
<!-- -->
|
||||
<!-- <!– Install dependencies if needed –>-->
|
||||
<!-- <exec executable="bash" failonerror="true" osfamily="unix">-->
|
||||
<!-- <arg line="-c 'which appimagetool || (echo "Installing appimagetool..." && sudo apt-get update && sudo apt-get install -y libfuse2 fuse && wget -O /tmp/appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage && chmod +x /tmp/appimagetool && sudo mv /tmp/appimagetool /usr/local/bin/)'" />-->
|
||||
<!-- </exec>-->
|
||||
<!-- -->
|
||||
<!-- <!– Build AppImage –>-->
|
||||
<!-- <exec executable="bash" failonerror="true" osfamily="unix">-->
|
||||
<!-- <arg line="-c 'appimagetool ${appdir.dir} ${project.build.directory}/${appimage.output.file}'" />-->
|
||||
<!-- </exec>-->
|
||||
|
||||
<!-- Create zip package -->
|
||||
<zip destfile="${project.build.directory}/diylc-${project.version}-linux.zip">
|
||||
<zipfileset file="${project.build.directory}/${appimage.output.file}"
|
||||
filemode="755" />
|
||||
</zip>
|
||||
|
||||
<echo message="AppImage build completed successfully! Output: ${project.build.directory}/${appimage.output.file}" />
|
||||
</target>
|
||||
</configuration>
|
||||
@@ -452,5 +458,91 @@
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<!-- Windows InnoSetup build profile using Docker -->
|
||||
<profile>
|
||||
<id>win64-installer</id>
|
||||
<properties>
|
||||
<jdk.version>17.0.14+7</jdk.version>
|
||||
<jdk.version.file>17.0.14_7</jdk.version.file>
|
||||
<jdk.archive.win64>OpenJDK17U-jre_x64_windows_hotspot_${jdk.version.file}.zip</jdk.archive.win64>
|
||||
<jdk.url.win64>https://github.com/adoptium/temurin17-binaries/releases/download/jdk-${jdk.version}/${jdk.archive.win64}</jdk.url.win64>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- Download and extract JRE -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>download-extract-jre</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<!-- Clean old jre_win folder -->
|
||||
<delete dir="${project.build.directory}/jre_win" />
|
||||
|
||||
<!-- Create folder to hold extracted JRE -->
|
||||
<mkdir dir="${project.build.directory}/jre_win" />
|
||||
|
||||
<!-- Download JRE 64-bit for Windows -->
|
||||
<mkdir dir="${project.build.directory}/downloads" />
|
||||
<get src="${jdk.url.win64}"
|
||||
dest="${project.build.directory}/downloads/${jdk.archive.win64}"
|
||||
usetimestamp="true" />
|
||||
|
||||
<!-- Extract JRE into jre_win -->
|
||||
<unzip src="${project.build.directory}/downloads/${jdk.archive.win64}"
|
||||
dest="${project.build.directory}/jre_win" />
|
||||
|
||||
<!-- Move files up one level -->
|
||||
<move todir="${project.build.directory}/jre_win">
|
||||
<fileset dir="${project.build.directory}/jre_win/jdk-${jdk.version}-jre" />
|
||||
</move>
|
||||
|
||||
<!-- Remove empty top-level folder -->
|
||||
<delete dir="${project.build.directory}/jre_win/jdk-${jdk.version}-jre" />
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- Run InnoSetup -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>build-windows-installer</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>docker</executable>
|
||||
<arguments>
|
||||
<argument>run</argument>
|
||||
<argument>--rm</argument>
|
||||
<argument>-v</argument>
|
||||
<argument>${project.basedir}:/workspace</argument>
|
||||
<argument>amake/innosetup</argument>
|
||||
<argument>/Ddiylcver=${project.version}</argument>
|
||||
<argument>/Darch=x64</argument>
|
||||
<argument>/workspace/deploy/win/install.iss</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
Reference in New Issue
Block a user