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

Commit

Permalink
Added app creation for MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob van Mourik committed Jan 4, 2017
1 parent 44e7f69 commit 73f57e1
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 30 deletions.
8 changes: 4 additions & 4 deletions .inno.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define AppName "i18n-editor"
#define AppVersion "0.8.1"
#define AppVersion "0.9.0"
#define AppPublisher "JvMs Software"
#define AppURL "https://github.com/jcbvm/ember-i18n-editor"
#define AppExeName "i18n-editor.exe"
Expand All @@ -17,8 +17,8 @@ DisableProgramGroupPage=auto
DisableDirPage=auto
AlwaysShowDirOnReadyPage=yes
LicenseFile=LICENSE
OutputBaseFilename={#AppName}-{#AppVersion}
OutputDir=dist
OutputBaseFilename={#AppName}-{#AppVersion}-setup
OutputDir=target\{#AppName}-{#AppVersion}
SetupIconFile=src\main\resources\images\icon.ico
UninstallDisplayIcon={uninstallexe}
Compression=lzma
Expand All @@ -36,7 +36,7 @@ Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

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

[Icons]
Expand Down
29 changes: 23 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.jvms</groupId>
<artifactId>i18n-editor</artifactId>
<version>0.8.1</version>
<version>0.9.0</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
Expand Down Expand Up @@ -51,7 +51,7 @@
<configuration>
<archive>
<manifest>
<mainClass>com.jvms.i18neditor.Editor</mainClass>
<mainClass>com.jvms.i18neditor.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
Expand All @@ -61,6 +61,23 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>sh.tak.appbundler</groupId>
<artifactId>appbundle-maven-plugin</artifactId>
<version>1.2.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>bundle</goal>
</goals>
<configuration>
<mainClass>com.jvms.i18neditor.Main</mainClass>
<iconFile>images/icons.icns</iconFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
Expand All @@ -73,11 +90,11 @@
</goals>
<configuration>
<headerType>gui</headerType>
<outfile>${project.build.directory}/${project.artifactId}.exe</outfile>
<outfile>${project.build.directory}/${project.artifactId}-${project.version}/${project.artifactId}.exe</outfile>
<jar>${project.build.directory}/${project.artifactId}-${project.version}-jar-with-dependencies.jar</jar>
<errTitle>i18n Editor</errTitle>
<classPath>
<mainClass>com.jvms.i18neditor.Editor</mainClass>
<mainClass>com.jvms.i18neditor.Main</mainClass>
</classPath>
<jre>
<minVersion>1.8.0</minVersion>
Expand All @@ -100,12 +117,12 @@
<configuration>
<target>
<copy file="${project.build.directory}/${project.artifactId}-${project.version}-jar-with-dependencies.jar"
toFile="${basedir}/dist/${project.artifactId}-${project.version}.jar"/>
toFile="${project.build.directory}/${project.artifactId}-${project.version}/${project.artifactId}.jar"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
</project>
24 changes: 4 additions & 20 deletions src/main/java/com/jvms/i18neditor/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;

import org.apache.commons.lang3.SystemUtils;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.jvms.i18neditor.Resource.ResourceType;
Expand All @@ -59,9 +56,9 @@ public class Editor extends JFrame {
private final static long serialVersionUID = 1113029729495390082L;

public final static Path SETTINGS_PATH = Paths.get(System.getProperty("user.home"), ".i18n-editor");
public final static String TITLE = "i18n Editor";
public final static String VERSION = "0.8.1";
public final static String COPYRIGHT_YEAR = "2016";
public final static String TITLE = "i18n-editor";
public final static String VERSION = "0.9.0";
public final static String COPYRIGHT_YEAR = "2016 - 2017";
public final static String GITHUB_REPO = "jcbvm/ember-i18n-editor";
public final static int DEFAULT_WIDTH = 1024;
public final static int DEFAULT_HEIGHT = 768;
Expand Down Expand Up @@ -470,20 +467,6 @@ public void launch() {
}
}

public static void main(String[] args) {
SwingUtilities.invokeLater(() -> {
try {
// Only use native look an feel when not running Linux, Linux might cause visual issues
if (!SystemUtils.IS_OS_LINUX) {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
} catch (Exception e) {
//
}
new Editor().launch();
});
}

private boolean loadResourcesFromHistory() {
List<String> dirs = settings.getListProperty("history");
if (!dirs.isEmpty()) {
Expand Down Expand Up @@ -545,6 +528,7 @@ private void setupUI() {

resourcesScrollPane = new JScrollPane(resourcesPanel);
resourcesScrollPane.getViewport().setOpaque(false);
resourcesScrollPane.setBackground(resourcesPanel.getBackground());

contentPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, translationsPanel, resourcesScrollPane);
editorMenu = new EditorMenu(this, translationTree);
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/com/jvms/i18neditor/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.jvms.i18neditor;

import javax.swing.SwingUtilities;
import javax.swing.UIManager;

import org.apache.commons.lang3.SystemUtils;

public class Main {

public static void main(String[] args) {
if (SystemUtils.IS_OS_MAC) {
System.setProperty("apple.laf.useScreenMenuBar", "true");
}
// Only use native look an feel when not running Linux, Linux might cause visual issues
if (!SystemUtils.IS_OS_LINUX) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
//
}
}
SwingUtilities.invokeLater(() -> {
new Editor().launch();
});
}
}
Binary file added src/main/resources/images/icons.icns
Binary file not shown.

0 comments on commit 73f57e1

Please sign in to comment.