Skip to content

Commit

Permalink
build: Add launch4j-maven-plugin (#1577)
Browse files Browse the repository at this point in the history
Signed-off-by: unknowIfGuestInDream <[email protected]>
  • Loading branch information
unknowIfGuestInDream authored Jun 9, 2024
1 parent b9d1d13 commit b4ddec0
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 0 deletions.
27 changes: 27 additions & 0 deletions core/src/test/java/com/tlcsdm/core/util/GitlabApiTest.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
/*
* Copyright (c) 2024 unknowIfGuestInDream.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of unknowIfGuestInDream, any associated website, nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL UNKNOWIFGUESTINDREAM BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package com.tlcsdm.core.util;

import cn.hutool.core.comparator.VersionComparator;
Expand Down
27 changes: 27 additions & 0 deletions core/src/test/java/com/tlcsdm/core/util/VideoAndAudioUtilTest.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
/*
* Copyright (c) 2024 unknowIfGuestInDream.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of unknowIfGuestInDream, any associated website, nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL UNKNOWIFGUESTINDREAM BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package com.tlcsdm.core.util;

import com.tlcsdm.core.exception.UnExpectedResultException;
Expand Down
27 changes: 27 additions & 0 deletions core/src/test/java/com/tlcsdm/core/util/VoskTest.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
/*
* Copyright (c) 2024 unknowIfGuestInDream.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of unknowIfGuestInDream, any associated website, nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL UNKNOWIFGUESTINDREAM BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package com.tlcsdm.core.util;

import org.junit.jupiter.api.Test;
Expand Down
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<git-commit-id-maven-plugin.version>8.0.2</git-commit-id-maven-plugin.version>
<versions-maven-plugin.version>2.16.2</versions-maven-plugin.version>
<sortpom-maven-plugin.version>4.0.0</sortpom-maven-plugin.version>
<launch4j-maven-plugin.version>2.5.1</launch4j-maven-plugin.version>
<lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
<!-- if you update the checkstyle version make sure you update the google_checks.xml inside the repository -->
<checkstyle.version>10.17.0</checkstyle.version>
Expand Down Expand Up @@ -1717,6 +1718,11 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>${launch4j-maven-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
Binary file added smc/config/logo.ico
Binary file not shown.
95 changes: 95 additions & 0 deletions smc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,99 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>exe</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.tlcsdm.smc.SmcSampler</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<executions>
<execution>
<id>l4j-gui</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>gui</headerType>
<outfile>target/SmcTool.exe</outfile>
<downloadUrl>https://adoptium.net/?variant=openjdk17</downloadUrl>
<jar>target/${project.artifactId}-jar-with-dependencies.jar</jar>
<errTitle>Launching error</errTitle>
<icon>config/logo.ico</icon>
<classPath>
<mainClass>com.tlcsdm.smc.SmcSampler</mainClass>
<preCp>anything</preCp>
</classPath>
<jre>
<minVersion>17.0.0</minVersion>
<requires64Bit>true</requires64Bit>
<opts>
<opt>-Dfile.encoding=UTF-8</opt>
<opt>--add-exports java.base/java.lang=ALL-UNNAMED</opt>
<opt>--add-exports java.desktop/sun.awt=ALL-UNNAMED</opt>
<opt>--add-exports java.desktop/sun.java2d=ALL-UNNAMED</opt>
</opts>
</jre>
<versionInfo>
<fileVersion>${project.version}.0</fileVersion>
<txtFileVersion>${project.version}</txtFileVersion>
<fileDescription>Smart Configuration Tool</fileDescription>
<copyright>MIT, ${maven.build.timestamp} ${project.organization.name}
</copyright>
<productVersion>${project.version}.0</productVersion>
<txtProductVersion>${project.version}</txtProductVersion>
<companyName>${project.organization.name}</companyName>
<productName>SmcTool</productName>
<internalName>SmcTool</internalName>
<originalFilename>SmcTool.exe</originalFilename>
</versionInfo>
<!-- <splash>-->
<!-- <file>${basedir}/src/main/installer/images/splash.bmp</file>-->
<!-- <waitForWindow>true</waitForWindow>-->
<!-- <timeout>60</timeout>-->
<!-- <timeoutErr>false</timeoutErr>-->
<!-- </splash>-->
<messages>
<startupErr>Startup error</startupErr>
<launcherErr>Launcher Error</launcherErr>
<jreNotFoundErr>You need to download Java version 17 or higher.</jreNotFoundErr>
<jreVersionErr>You need to download Java version 17 or higher.</jreVersionErr>
<instanceAlreadyExistsMsg>Application is already running.
</instanceAlreadyExistsMsg>
</messages>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit b4ddec0

Please sign in to comment.