Skip to content
This repository was archived by the owner on Mar 15, 2023. It is now read-only.

Commit 73f57e1

Browse files
author
Jacob van Mourik
committed
Added app creation for MacOS
1 parent 44e7f69 commit 73f57e1

File tree

5 files changed

+57
-30
lines changed

5 files changed

+57
-30
lines changed

.inno.iss

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define AppName "i18n-editor"
2-
#define AppVersion "0.8.1"
2+
#define AppVersion "0.9.0"
33
#define AppPublisher "JvMs Software"
44
#define AppURL "https://github.com/jcbvm/ember-i18n-editor"
55
#define AppExeName "i18n-editor.exe"
@@ -17,8 +17,8 @@ DisableProgramGroupPage=auto
1717
DisableDirPage=auto
1818
AlwaysShowDirOnReadyPage=yes
1919
LicenseFile=LICENSE
20-
OutputBaseFilename={#AppName}-{#AppVersion}
21-
OutputDir=dist
20+
OutputBaseFilename={#AppName}-{#AppVersion}-setup
21+
OutputDir=target\{#AppName}-{#AppVersion}
2222
SetupIconFile=src\main\resources\images\icon.ico
2323
UninstallDisplayIcon={uninstallexe}
2424
Compression=lzma
@@ -36,7 +36,7 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{
3636
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
3737

3838
[Files]
39-
Source: "target\{#AppExeName}"; DestDir: "{app}"; Flags: ignoreversion
39+
Source: "target\{#AppName}-{#AppVersion}\{#AppExeName}"; DestDir: "{app}"; Flags: ignoreversion
4040
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
4141

4242
[Icons]

pom.xml

+23-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.jvms</groupId>
55
<artifactId>i18n-editor</artifactId>
6-
<version>0.8.1</version>
6+
<version>0.9.0</version>
77
<packaging>jar</packaging>
88
<dependencies>
99
<dependency>
@@ -51,7 +51,7 @@
5151
<configuration>
5252
<archive>
5353
<manifest>
54-
<mainClass>com.jvms.i18neditor.Editor</mainClass>
54+
<mainClass>com.jvms.i18neditor.Main</mainClass>
5555
</manifest>
5656
</archive>
5757
<descriptorRefs>
@@ -61,6 +61,23 @@
6161
</execution>
6262
</executions>
6363
</plugin>
64+
<plugin>
65+
<groupId>sh.tak.appbundler</groupId>
66+
<artifactId>appbundle-maven-plugin</artifactId>
67+
<version>1.2.0</version>
68+
<executions>
69+
<execution>
70+
<phase>package</phase>
71+
<goals>
72+
<goal>bundle</goal>
73+
</goals>
74+
<configuration>
75+
<mainClass>com.jvms.i18neditor.Main</mainClass>
76+
<iconFile>images/icons.icns</iconFile>
77+
</configuration>
78+
</execution>
79+
</executions>
80+
</plugin>
6481
<plugin>
6582
<groupId>com.akathist.maven.plugins.launch4j</groupId>
6683
<artifactId>launch4j-maven-plugin</artifactId>
@@ -73,11 +90,11 @@
7390
</goals>
7491
<configuration>
7592
<headerType>gui</headerType>
76-
<outfile>${project.build.directory}/${project.artifactId}.exe</outfile>
93+
<outfile>${project.build.directory}/${project.artifactId}-${project.version}/${project.artifactId}.exe</outfile>
7794
<jar>${project.build.directory}/${project.artifactId}-${project.version}-jar-with-dependencies.jar</jar>
7895
<errTitle>i18n Editor</errTitle>
7996
<classPath>
80-
<mainClass>com.jvms.i18neditor.Editor</mainClass>
97+
<mainClass>com.jvms.i18neditor.Main</mainClass>
8198
</classPath>
8299
<jre>
83100
<minVersion>1.8.0</minVersion>
@@ -100,12 +117,12 @@
100117
<configuration>
101118
<target>
102119
<copy file="${project.build.directory}/${project.artifactId}-${project.version}-jar-with-dependencies.jar"
103-
toFile="${basedir}/dist/${project.artifactId}-${project.version}.jar"/>
120+
toFile="${project.build.directory}/${project.artifactId}-${project.version}/${project.artifactId}.jar"/>
104121
</target>
105122
</configuration>
106123
</execution>
107124
</executions>
108125
</plugin>
109126
</plugins>
110127
</build>
111-
</project>
128+
</project>

src/main/java/com/jvms/i18neditor/Editor.java

+4-20
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,9 @@
3030
import javax.swing.JScrollPane;
3131
import javax.swing.JSplitPane;
3232
import javax.swing.SwingUtilities;
33-
import javax.swing.UIManager;
3433
import javax.swing.event.TreeSelectionEvent;
3534
import javax.swing.event.TreeSelectionListener;
3635

37-
import org.apache.commons.lang3.SystemUtils;
38-
3936
import com.google.common.collect.Lists;
4037
import com.google.common.collect.Maps;
4138
import com.jvms.i18neditor.Resource.ResourceType;
@@ -59,9 +56,9 @@ public class Editor extends JFrame {
5956
private final static long serialVersionUID = 1113029729495390082L;
6057

6158
public final static Path SETTINGS_PATH = Paths.get(System.getProperty("user.home"), ".i18n-editor");
62-
public final static String TITLE = "i18n Editor";
63-
public final static String VERSION = "0.8.1";
64-
public final static String COPYRIGHT_YEAR = "2016";
59+
public final static String TITLE = "i18n-editor";
60+
public final static String VERSION = "0.9.0";
61+
public final static String COPYRIGHT_YEAR = "2016 - 2017";
6562
public final static String GITHUB_REPO = "jcbvm/ember-i18n-editor";
6663
public final static int DEFAULT_WIDTH = 1024;
6764
public final static int DEFAULT_HEIGHT = 768;
@@ -470,20 +467,6 @@ public void launch() {
470467
}
471468
}
472469

473-
public static void main(String[] args) {
474-
SwingUtilities.invokeLater(() -> {
475-
try {
476-
// Only use native look an feel when not running Linux, Linux might cause visual issues
477-
if (!SystemUtils.IS_OS_LINUX) {
478-
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
479-
}
480-
} catch (Exception e) {
481-
//
482-
}
483-
new Editor().launch();
484-
});
485-
}
486-
487470
private boolean loadResourcesFromHistory() {
488471
List<String> dirs = settings.getListProperty("history");
489472
if (!dirs.isEmpty()) {
@@ -545,6 +528,7 @@ private void setupUI() {
545528

546529
resourcesScrollPane = new JScrollPane(resourcesPanel);
547530
resourcesScrollPane.getViewport().setOpaque(false);
531+
resourcesScrollPane.setBackground(resourcesPanel.getBackground());
548532

549533
contentPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, translationsPanel, resourcesScrollPane);
550534
editorMenu = new EditorMenu(this, translationTree);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.jvms.i18neditor;
2+
3+
import javax.swing.SwingUtilities;
4+
import javax.swing.UIManager;
5+
6+
import org.apache.commons.lang3.SystemUtils;
7+
8+
public class Main {
9+
10+
public static void main(String[] args) {
11+
if (SystemUtils.IS_OS_MAC) {
12+
System.setProperty("apple.laf.useScreenMenuBar", "true");
13+
}
14+
// Only use native look an feel when not running Linux, Linux might cause visual issues
15+
if (!SystemUtils.IS_OS_LINUX) {
16+
try {
17+
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
18+
} catch (Exception e) {
19+
//
20+
}
21+
}
22+
SwingUtilities.invokeLater(() -> {
23+
new Editor().launch();
24+
});
25+
}
26+
}

src/main/resources/images/icons.icns

188 KB
Binary file not shown.

0 commit comments

Comments
 (0)