Skip to content

Commit cffa0ba

Browse files
committed
start creation windows exe file
1 parent 4e34bd6 commit cffa0ba

File tree

3 files changed

+72
-17
lines changed

3 files changed

+72
-17
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Thumbs.db
3838

3939
# Application specific
4040
android_emulator_config.properties
41+
jre/
4142
*.log
4243

4344
# Java

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,21 @@ cd AndroidEmulatorManager
3535
mvn clean package
3636
java -jar target/android-emulator-manager-3.0.0-jar-with-dependencies.jar
3737
```
38+
### Build with EXE output (require java)
39+
40+
```bash
41+
git clone https://github.com/NmurtasDev/AndroidEmulatorManager.git
42+
cd AndroidEmulatorManager
43+
mvn clean package -Pwindows
44+
```
45+
### Build with EXE output (dont require java)
46+
47+
```bash
48+
git clone https://github.com/NmurtasDev/AndroidEmulatorManager.git
49+
cd AndroidEmulatorManager
50+
jlink --output jre --add-modules java.base,java.desktop --strip-debug --compress=2 --no-header-files --no-man-pages
51+
mvn clean package -Pwindows-standalone
52+
```
3853

3954
## Usage
4055

pom.xml

Lines changed: 56 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
55
http://maven.apache.org/xsd/maven-4.0.0.xsd">
6+
67
<modelVersion>4.0.0</modelVersion>
78

89
<groupId>net.nicolamurtas</groupId>
@@ -65,6 +66,7 @@
6566

6667
<build>
6768
<plugins>
69+
6870
<!-- Maven Compiler Plugin -->
6971
<plugin>
7072
<groupId>org.apache.maven.plugins</groupId>
@@ -77,29 +79,14 @@
7779
</configuration>
7880
</plugin>
7981

80-
<!-- Maven Surefire Plugin for tests -->
82+
<!-- Maven Surefire Plugin -->
8183
<plugin>
8284
<groupId>org.apache.maven.plugins</groupId>
8385
<artifactId>maven-surefire-plugin</artifactId>
8486
<version>3.2.2</version>
8587
</plugin>
8688

87-
<!-- Maven Jar Plugin with Main-Class -->
88-
<plugin>
89-
<groupId>org.apache.maven.plugins</groupId>
90-
<artifactId>maven-jar-plugin</artifactId>
91-
<version>3.3.0</version>
92-
<configuration>
93-
<archive>
94-
<manifest>
95-
<mainClass>net.nicolamurtas.android.emulator.AndroidEmulatorManager</mainClass>
96-
<addClasspath>true</addClasspath>
97-
</manifest>
98-
</archive>
99-
</configuration>
100-
</plugin>
101-
102-
<!-- Maven Assembly Plugin for fat JAR -->
89+
<!-- Fat JAR con dipendenze -->
10390
<plugin>
10491
<groupId>org.apache.maven.plugins</groupId>
10592
<artifactId>maven-assembly-plugin</artifactId>
@@ -124,6 +111,58 @@
124111
</execution>
125112
</executions>
126113
</plugin>
114+
115+
<!-- Launch4j Plugin per EXE -->
116+
<plugin>
117+
<groupId>com.akathist.maven.plugins.launch4j</groupId>
118+
<artifactId>launch4j-maven-plugin</artifactId>
119+
<version>1.7.25</version>
120+
<executions>
121+
<execution>
122+
<id>launch4j-exe</id>
123+
<phase>package</phase>
124+
<goals>
125+
<goal>launch4j</goal>
126+
</goals>
127+
</execution>
128+
</executions>
129+
<configuration>
130+
<outfile>${project.build.directory}/${project.artifactId}-${project.version}${exe.suffix}.exe</outfile>
131+
<jar>${project.build.directory}/${project.artifactId}-${project.version}-jar-with-dependencies.jar</jar>
132+
<mainClass>net.nicolamurtas.android.emulator.AndroidEmulatorManager</mainClass>
133+
<errTitle>Android Emulator Manager</errTitle>
134+
<chdir>.</chdir>
135+
<priority>normal</priority>
136+
<stayAlive>false</stayAlive>
137+
<restartOnCrash>false</restartOnCrash>
138+
<minVersion>21</minVersion>
139+
<bundledJrePath>${bundled.jre.path}</bundledJrePath>
140+
<bundledJre64Bit>true</bundledJre64Bit>
141+
<requires64Bit>true</requires64Bit>
142+
</configuration>
143+
</plugin>
127144
</plugins>
128145
</build>
146+
147+
<!-- Profili per EXE -->
148+
<profiles>
149+
<!-- Richiede JRE di sistema -->
150+
<profile>
151+
<id>windows</id>
152+
<properties>
153+
<bundled.jre.path></bundled.jre.path>
154+
<exe.suffix></exe.suffix>
155+
</properties>
156+
</profile>
157+
158+
<!-- Include una JRE locale -->
159+
<profile>
160+
<id>windows-standalone</id>
161+
<properties>
162+
<bundled.jre.path>jre</bundled.jre.path>
163+
<exe.suffix>-standalone</exe.suffix>
164+
</properties>
165+
</profile>
166+
</profiles>
167+
129168
</project>

0 commit comments

Comments
 (0)