Skip to content
This repository has been archived by the owner on Nov 17, 2022. It is now read-only.

Commit

Permalink
Issue #47 Invalid File on Mac OS X
Browse files Browse the repository at this point in the history
Added logging information so that the full path can be obtained.

Also reworked macosx product build a bit to help tycho generate the correct
information.
  • Loading branch information
kingargyle committed Jul 1, 2017
1 parent d0af179 commit a55fcc5
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 1 deletion.
Binary file modified bundles/us.nineworlds.xstreamer.branding/splash.bmp
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package us.nineworlds.xstreamer.model.template;

import org.apache.commons.io.FileUtils;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;

public class SquadTemplateModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class Activator extends AbstractUIPlugin {

private static long countDownTime;
private static Activator plugin;
public static final String BUNDLE_ID = "us.nineworlds.xstreamer";

public Activator() {
plugin = this;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package us.nineworlds.xstreamer;

import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;

public class Logger {

static final ILog logger = Activator.getDefault().getLog();


public static void info(String message) {
log(IStatus.INFO, IStatus.OK, message, null);
}

public static void error(String message, Throwable exception) {
log(IStatus.ERROR, IStatus.ERROR, message, exception);
}

public static void error(String message) {
log(IStatus.ERROR, IStatus.ERROR, message, null);
}

private static void log(int severity, int code, String message, Throwable exception) {
log(createStatus(severity, code, message, exception));
}

private static IStatus createStatus(int severity, int code, String message, Throwable exception) {
return new Status(severity, Activator.BUNDLE_ID, code, message, exception);
}

private static void log(IStatus status) {
logger.log(status);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.io.File;
import java.util.List;

import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.FileFieldEditor;
Expand All @@ -24,6 +25,8 @@
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;

import us.nineworlds.xstreamer.Logger;
import us.nineworlds.xstreamer.core.Activator;
import us.nineworlds.xstreamer.model.template.SquadTemplateModel;

public abstract class AbstractPlayerTemplatesPreferencePage extends FieldEditorPreferencePage {
Expand Down Expand Up @@ -76,6 +79,8 @@ public void selectionChanged(final SelectionChangedEvent event) {
templateFile.setEmptyStringAllowed(false);
SquadTemplateModel model = (SquadTemplateModel) selection.getFirstElement();
String fullPath = templateDirectory + File.separator + model.getPath() + model.getFilename();
Logger.info("Template Full Path: " + fullPath);

templateFile.setStringValue(fullPath);
templateFile.setFilterPath(new File(fullPath));
}
Expand Down Expand Up @@ -140,5 +145,14 @@ public String getColumnText(Object element, int columnIndex) {
}

}

@Override
public void setErrorMessage(String newMessage) {
if (newMessage != null) {
Logger.error(newMessage + "\nTemplateFile = " + templateFile.getStringValue());
}

super.setErrorMessage(newMessage);
}

}
9 changes: 9 additions & 0 deletions releng/us.nineworlds.xstreamer.product/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@
<linux>tar.gz</linux>
<macosx>tar.gz</macosx>
</formats>
<products>
<product>
<id>us.nineworlds.xstreamer.xstreamer</id>
<rootFolder>xstreamer</rootFolder>
<rootFolders>
<macosx>XStreamer.app</macosx>
</rootFolders>
</product>
</products>
</configuration>
<executions>
<execution>
Expand Down
3 changes: 2 additions & 1 deletion releng/us.nineworlds.xstreamer.product/xstreamer.product
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<image path="/us.nineworlds.xstreamer.branding/images/xstreamer_lg.png"/>
<text>
XStreamer Squad Helper
Version 0.5.0
Version 0.6.1
</text>
</aboutInfo>

Expand Down Expand Up @@ -37,6 +37,7 @@ Version 0.5.0
</win>
</launcher>


<vm>
<linux include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8</linux>
<macos include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8</macos>
Expand Down

0 comments on commit a55fcc5

Please sign in to comment.