feat: добавляем win/linux профили для сборки с разными javafx
This commit is contained in:
@@ -48,6 +48,12 @@
|
|||||||
<exclude>**/*-linux.jar</exclude>
|
<exclude>**/*-linux.jar</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</filter>
|
</filter>
|
||||||
|
<filter>
|
||||||
|
<artifact>*:javafx-*</artifact>
|
||||||
|
<excludes>
|
||||||
|
<exclude>*</exclude>
|
||||||
|
</excludes>
|
||||||
|
</filter>
|
||||||
</filters>
|
</filters>
|
||||||
<dependencySet>
|
<dependencySet>
|
||||||
<outputDirectory>/</outputDirectory>
|
<outputDirectory>/</outputDirectory>
|
||||||
@@ -132,6 +138,9 @@
|
|||||||
<copy>
|
<copy>
|
||||||
<fileset />
|
<fileset />
|
||||||
</copy>
|
</copy>
|
||||||
|
<copy>
|
||||||
|
<fileset />
|
||||||
|
</copy>
|
||||||
<zip />
|
<zip />
|
||||||
</target>
|
</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
+56
-4
@@ -17,6 +17,9 @@
|
|||||||
<project.inceptionYear>2026</project.inceptionYear>
|
<project.inceptionYear>2026</project.inceptionYear>
|
||||||
<project.description>ZernMC Launcher - just a minimalistic launcher by SashegDev</project.description>
|
<project.description>ZernMC Launcher - just a minimalistic launcher by SashegDev</project.description>
|
||||||
<mainClass>me.sashegdev.zernmc.launcher.Main</mainClass>
|
<mainClass>me.sashegdev.zernmc.launcher.Main</mainClass>
|
||||||
|
<javafx.classifier>win</javafx.classifier>
|
||||||
|
<os.suffix>win</os.suffix>
|
||||||
|
<skip.launch4j>false</skip.launch4j>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@@ -82,6 +85,20 @@
|
|||||||
<version>21.0.2</version>
|
<version>21.0.2</version>
|
||||||
<classifier>win</classifier>
|
<classifier>win</classifier>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.openjfx</groupId>
|
||||||
|
<artifactId>javafx-controls</artifactId>
|
||||||
|
<version>21.0.2</version>
|
||||||
|
<classifier>linux</classifier>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.openjfx</groupId>
|
||||||
|
<artifactId>javafx-web</artifactId>
|
||||||
|
<version>21.0.2</version>
|
||||||
|
<classifier>linux</classifier>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter</artifactId>
|
<artifactId>junit-jupiter</artifactId>
|
||||||
@@ -178,11 +195,14 @@
|
|||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<!-- Launch4j для создания .exe -->
|
<!-- Launch4j для создания .exe (только для Windows) -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>com.akathist.maven.plugins.launch4j</groupId>
|
<groupId>com.akathist.maven.plugins.launch4j</groupId>
|
||||||
<artifactId>launch4j-maven-plugin</artifactId>
|
<artifactId>launch4j-maven-plugin</artifactId>
|
||||||
<version>2.5.0</version>
|
<version>2.5.0</version>
|
||||||
|
<configuration>
|
||||||
|
<skip>${skip.launch4j}</skip>
|
||||||
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>l4j</id>
|
<id>l4j</id>
|
||||||
@@ -238,13 +258,15 @@
|
|||||||
<fileset dir="${user.home}/launcher/jre/jre21"/>
|
<fileset dir="${user.home}/launcher/jre/jre21"/>
|
||||||
</copy>
|
</copy>
|
||||||
|
|
||||||
<!-- Копируем JavaFX JAR в builds -->
|
<!-- Копируем JavaFX JAR в builds (только для текущей OS) -->
|
||||||
<copy todir="../server/builds/lib-javafx" overwrite="true">
|
<copy todir="../server/builds/lib-javafx" overwrite="true">
|
||||||
<fileset dir="${project.build.directory}/lib-javafx"/>
|
<fileset dir="${project.build.directory}/lib-javafx">
|
||||||
|
<include>*${javafx.classifier}.jar</include>
|
||||||
|
</fileset>
|
||||||
</copy>
|
</copy>
|
||||||
|
|
||||||
<!-- Создаём zip с .exe, jre21 и lib-javafx (без .jar и build.version) -->
|
<!-- Создаём zip с .exe, jre21 и lib-javafx (без .jar и build.version) -->
|
||||||
<zip destfile="../server/builds/ZernMCLauncher-${project.version}.zip"
|
<zip destfile="../server/builds/ZernMCLauncher-${project.version}-${os.suffix}.zip"
|
||||||
basedir="../server/builds"
|
basedir="../server/builds"
|
||||||
includes="ZernMCLauncher.exe,jre21/**,lib-javafx/**"
|
includes="ZernMCLauncher.exe,jre21/**,lib-javafx/**"
|
||||||
excludes="*.jar,build.version"/>
|
excludes="*.jar,build.version"/>
|
||||||
@@ -279,5 +301,35 @@
|
|||||||
<server.url>http://87.120.187.36:1582</server.url>
|
<server.url>http://87.120.187.36:1582</server.url>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
|
|
||||||
|
<!-- ==================== WINDOWS BUILD ==================== -->
|
||||||
|
<profile>
|
||||||
|
<id>win</id>
|
||||||
|
<activation>
|
||||||
|
<os>
|
||||||
|
<family>windows</family>
|
||||||
|
</os>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<javafx.classifier>win</javafx.classifier>
|
||||||
|
<os.suffix>win</os.suffix>
|
||||||
|
<skip.launch4j>false</skip.launch4j>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
|
||||||
|
<!-- ==================== LINUX BUILD ==================== -->
|
||||||
|
<profile>
|
||||||
|
<id>linux</id>
|
||||||
|
<activation>
|
||||||
|
<os>
|
||||||
|
<family>unix</family>
|
||||||
|
</os>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<javafx.classifier>linux</javafx.classifier>
|
||||||
|
<os.suffix>linux</os.suffix>
|
||||||
|
<skip.launch4j>true</skip.launch4j>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
</project>
|
</project>
|
||||||
@@ -186,12 +186,20 @@ public class Main {
|
|||||||
try {
|
try {
|
||||||
String javaPath = System.getProperty("java.home") + "/bin/java";
|
String javaPath = System.getProperty("java.home") + "/bin/java";
|
||||||
String jarPath = getCurrentJarPath().toAbsolutePath().toString();
|
String jarPath = getCurrentJarPath().toAbsolutePath().toString();
|
||||||
|
String launcherDir = jarPath.substring(0, jarPath.lastIndexOf(java.io.File.separator));
|
||||||
|
String javafxPath = launcherDir + java.io.File.separator + "lib-javafx";
|
||||||
|
|
||||||
System.out.println(ZAnsi.brightGreen("Перезапуск лаунчера с новой версией..."));
|
System.out.println(ZAnsi.brightGreen("Перезапуск лаунчера с новой версией..."));
|
||||||
|
|
||||||
new ProcessBuilder(javaPath, "-jar", jarPath)
|
ProcessBuilder pb = new ProcessBuilder(
|
||||||
.inheritIO()
|
javaPath,
|
||||||
.start();
|
"--module-path=" + javafxPath,
|
||||||
|
"--add-modules=javafx.controls,javafx.web",
|
||||||
|
"--add-reads=javafx.graphics=ALL-UNNAMED",
|
||||||
|
"-jar", jarPath
|
||||||
|
);
|
||||||
|
pb.inheritIO();
|
||||||
|
pb.start();
|
||||||
|
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user