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

Commit

Permalink
Issue fix issue with template not being exported
Browse files Browse the repository at this point in the history
The imperial assault data bundle was exported wrong and
didn't include the templates directory.  This didn't show up
in debugging because of the way eclipse runs the bundles.
  • Loading branch information
kingargyle committed Nov 3, 2017
1 parent 67e15b6 commit f3f3a9e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Activator() {
public void start(BundleContext context) throws Exception {
Activator.context = context;

Bundle dataBundle = Platform.getBundle(us.nineworlds.xstreamer.ia.data.Activator.DATA_BUNDLE_ID);
Bundle dataBundle = Platform.getBundle("us.nineworlds.xstreamer.ia.data");
IPath deploymentsPath = new Path("deployments/deployments.json");
IPath commandCardsPath = new Path("commandCards/commandcards.json");

Expand Down
1 change: 0 additions & 1 deletion bundles/us.nineworlds.xstreamer.ia.data/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
6 changes: 0 additions & 6 deletions bundles/us.nineworlds.xstreamer.ia.data/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,4 @@ Bundle-ManifestVersion: 2
Bundle-Name: Data
Bundle-SymbolicName: us.nineworlds.xstreamer.ia.data
Bundle-Version: 0.7.0.qualifier
Bundle-Activator: us.nineworlds.xstreamer.ia.data.Activator
Require-Bundle: org.eclipse.core.runtime,
us.nineworlds.xstreamer.lib;bundle-version="0.7.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: us.nineworlds.xstreamer.ia.data
Eclipse-BundleShape: dir
7 changes: 3 additions & 4 deletions bundles/us.nineworlds.xstreamer.ia.data/build.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
commandCards/,\
deployments/
deployments/,\
templates/

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import freemarker.template.Configuration;
import freemarker.template.Template;
import us.nineworlds.iadata.IASpec;
import us.nineworlds.xstreamer.Logger;
import us.nineworlds.xstreamer.ia.core.Activator;

public class GenerateArmyJob extends Job {
Expand Down Expand Up @@ -73,10 +74,12 @@ private IStatus writeArmy(boolean obsRefreshFlag, String templateInputDirectory,
armyTemplate.process(input, playerArmyFile);
} catch (Exception e) {
e.printStackTrace();
Logger.error("Exception writing Army " + templateOutputDirectory, e);
return Status.CANCEL_STATUS;
} finally {
IOUtils.closeQuietly(playerArmyFile);
}
Logger.info("File " + playerFilename + " written successfully");
return Status.OK_STATUS;
}

Expand All @@ -91,7 +94,7 @@ private String templateInputDirectory() {
File templateDirectory = FileUtils.toFile(realUrl);
templateInputDirectory = templateDirectory.getCanonicalPath().toString() + File.separator + "army" + File.separator + "html";
} catch (Exception ex) {

Logger.error("Exception creating Template Input Directory ", ex);
}
return templateInputDirectory;
}
Expand Down

0 comments on commit f3f3a9e

Please sign in to comment.