Skip to content

Commit

Permalink
windows distr
Browse files Browse the repository at this point in the history
  • Loading branch information
viktor44 committed Mar 26, 2024
1 parent 7c4e3b2 commit e3a6823
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 52 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:
distribution: 'temurin'
architecture: x64
- run: ./mvnw clean package --batch-mode --no-transfer-progress
- run: |
%JAVA_HOME%\bin\jpackage.exe --type exe --input target\out\lib --dest target\distr\win --main-jar zooinspector-n-1.1.RC1.jar --main-class org.apache.zookeeper.inspector.ZooInspector
- run: "%JAVA_HOME%\bin\jpackage.exe" @target\jpackage-win.args --type exe
shell: cmd
- uses: actions/upload-artifact@v4
with:
name: my-artifact
path: target/distr/win/*.exe
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
target/
temp/
.mvn/wrapper/*.jar
.classpath
.project
.factorypath
.settings
/temp
.settings/
10 changes: 3 additions & 7 deletions etc/build-win.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ cd %~dp0..

set JAVA_HOME=%JAVA17_HOME%

rem call mvn clean package -DskipTests
call mvn clean package -DskipTests

"%JAVA_HOME%\bin\jpackage.exe" ^
--type exe ^
--input target\out\lib ^
--dest target\distr\win ^
--main-jar zooinspector-n-1.1.RC1.jar ^
--main-class org.apache.zookeeper.inspector.ZooInspector
"%JAVA_HOME%\bin\jpackage.exe" @target\jpackage-win.args --type app-image
"%JAVA_HOME%\bin\jpackage.exe" @target\jpackage-win.args --type exe


endlocal
Binary file added etc/distr/app.ico
Binary file not shown.
28 changes: 0 additions & 28 deletions etc/distr/zooInspector.cmd

This file was deleted.

38 changes: 35 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zooinspector-n</artifactId>
<version>1.1.RC1</version>
<version>1.1.RC2</version>
<packaging>jar</packaging>

<properties>
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<zookeeper.version>3.7.0</zookeeper.version>
<zookeeper.version>3.7.2</zookeeper.version>
<guava.version>18.0</guava.version>
<slf4j.version>1.7.30</slf4j.version>
<log4j.version>1.2.17</log4j.version>
Expand Down Expand Up @@ -66,6 +66,19 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>parse-version</id>
<goals>
<goal>parse-version</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand All @@ -91,12 +104,31 @@
</resources>
</configuration>
</execution>
<execution>
<id>jpackage-args</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
<resources>
<resource>
<directory>${basedir}/src/assembly</directory>
<filtering>true</filtering>
<includes>
<include>jpackage-win.args</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<version>3.7.1</version>
<executions>
<execution>
<phase>package</phase>
Expand Down
8 changes: 8 additions & 0 deletions src/assembly/jpackage-win.args
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--icon etc\distr\app.ico
--input target\out\lib
--dest target\distr\win
--name ZooInspectorN
--vendor Viktor44
--app-version ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}
--main-jar ${project.build.finalName}.jar

27 changes: 17 additions & 10 deletions src/main/java/org/apache/zookeeper/inspector/ZooInspector.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
package org.apache.zookeeper.inspector;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.List;

import javax.swing.JFrame;
import javax.swing.JOptionPane;
Expand All @@ -39,29 +41,34 @@ public class ZooInspector {

public static IconResource iconResource;

/**
* @param args
* - not used. The value of these parameters will have no effect
* on the application
*/
public static void main(String[] args) {
public static void main(final String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
JFrame frame = new JFrame(APP_NAME);
final JFrame frame = new JFrame(APP_NAME);

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
iconResource = new IconResource();
final ZooInspectorPanel zooInspectorPanel = new ZooInspectorPanel(
new ZooInspectorManagerImpl(), iconResource);
final ZooInspectorPanel zooInspectorPanel = new ZooInspectorPanel(new ZooInspectorManagerImpl(), iconResource);
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
super.windowClosed(e);
zooInspectorPanel.disconnect(true);
}
});
final Toolkit toolkit = Toolkit.getDefaultToolkit();
frame.setIconImages(
List.of(
toolkit.createImage(ZooInspector.class.getResource("/icons/app_16.png")),
toolkit.createImage(ZooInspector.class.getResource("/icons/app_24.png")),
toolkit.createImage(ZooInspector.class.getResource("/icons/app_32.png")),
toolkit.createImage(ZooInspector.class.getResource("/icons/app_64.png")),
toolkit.createImage(ZooInspector.class.getResource("/icons/app_128.png"))
)
);
frame.setLocationByPlatform(true);
frame.setContentPane(zooInspectorPanel);
frame.setSize(new Dimension(1024, 768));
frame.setSize(800, 600);
frame.setVisible(true);

JOptionPane.setRootFrame(frame);
Expand Down
Binary file added src/main/resources/icons/app_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/icons/app_16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/icons/app_24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/icons/app_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/icons/app_64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e3a6823

Please sign in to comment.