mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
mac build fixes
move update and variants file to core project and integrate into Jar
This commit is contained in:
@@ -33,6 +33,7 @@ import java.io.FileInputStream;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.Modifier;
|
import java.lang.reflect.Modifier;
|
||||||
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -98,12 +99,14 @@ public class Presenter implements IPlugInPort {
|
|||||||
|
|
||||||
private static final Logger LOG = Logger.getLogger(Presenter.class);
|
private static final Logger LOG = Logger.getLogger(Presenter.class);
|
||||||
|
|
||||||
public static VersionNumber CURRENT_VERSION = new VersionNumber(3, 0, 0);
|
public static VersionNumber CURRENT_VERSION = new VersionNumber(4, 0, 0);
|
||||||
public static List<Version> RECENT_VERSIONS = null;
|
public static List<Version> RECENT_VERSIONS = null;
|
||||||
// Read the latest version from the local update.xml file
|
// Read the latest version from the local update.xml file
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
BufferedInputStream in = new BufferedInputStream(new FileInputStream("update.xml"));
|
URL resource = Presenter.class.getClassLoader().getResource("org/diylc/presenter/update.xml");
|
||||||
|
if (resource != null) {
|
||||||
|
BufferedInputStream in = new BufferedInputStream(resource.openStream());
|
||||||
XStream xStream = new XStream(new DomDriver());
|
XStream xStream = new XStream(new DomDriver());
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
List<Version> allVersions = (List<Version>) xStream.fromXML(in);
|
List<Version> allVersions = (List<Version>) xStream.fromXML(in);
|
||||||
@@ -118,6 +121,7 @@ public class Presenter implements IPlugInPort {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
in.close();
|
in.close();
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.error("Could not find version number, using default", e);
|
LOG.error("Could not find version number, using default", e);
|
||||||
}
|
}
|
||||||
@@ -127,15 +131,18 @@ public class Presenter implements IPlugInPort {
|
|||||||
private static Map<String, List<Template>> defaultVariantMap = null;
|
private static Map<String, List<Template>> defaultVariantMap = null;
|
||||||
static {
|
static {
|
||||||
try {
|
try {
|
||||||
BufferedInputStream in = new BufferedInputStream(new FileInputStream("variants.xml"));
|
URL resource = Presenter.class.getClassLoader().getResource("org/diylc/presenter/variants.xml");
|
||||||
|
if (resource != null) {
|
||||||
|
BufferedInputStream in = new BufferedInputStream(resource.openStream());
|
||||||
XStream xStream = new XStream(new DomDriver());
|
XStream xStream = new XStream(new DomDriver());
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Map<String, List<Template>> map = (Map<String, List<Template>>) xStream.fromXML(in);
|
Map<String, List<Template>> map = (Map<String, List<Template>>) xStream.fromXML(in);
|
||||||
defaultVariantMap = new TreeMap<String, List<Template>>(String.CASE_INSENSITIVE_ORDER);
|
defaultVariantMap = new TreeMap<String, List<Template>>(String.CASE_INSENSITIVE_ORDER);
|
||||||
defaultVariantMap.putAll(map);
|
defaultVariantMap.putAll(map);
|
||||||
in.close();
|
in.close();
|
||||||
LOG.info(String.format("Loaded default variants for %d components", defaultVariantMap == null ? 0
|
LOG.info(String.format("Loaded default variants for %d components",
|
||||||
: defaultVariantMap.size()));
|
defaultVariantMap == null ? 0 : defaultVariantMap.size()));
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.error("Could not load default variants", e);
|
LOG.error("Could not load default variants", e);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -72,6 +72,7 @@
|
|||||||
<attribute name="Class-Path" value="${manifest.class.path}" />
|
<attribute name="Class-Path" value="${manifest.class.path}" />
|
||||||
<attribute name="SplashScreen-Image" value="splash.png" />
|
<attribute name="SplashScreen-Image" value="splash.png" />
|
||||||
</manifest>
|
</manifest>
|
||||||
|
<zipfileset dir="." includes="config.properties" />
|
||||||
</jar>
|
</jar>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
@@ -96,7 +97,6 @@
|
|||||||
<arg value="-nosign"/>
|
<arg value="-nosign"/>
|
||||||
<arg value="-v"/>
|
<arg value="-v"/>
|
||||||
</exec>-->
|
</exec>-->
|
||||||
<mkdir dir="${jar.dir}\DIYLC.app" />
|
|
||||||
<bundleapp
|
<bundleapp
|
||||||
outputdirectory="${build.dir}"
|
outputdirectory="${build.dir}"
|
||||||
name="DIYLC"
|
name="DIYLC"
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
<option value="-Xdock:icon=Contents/Resources/diylc.icns"/>
|
<option value="-Xdock:icon=Contents/Resources/diylc.icns"/>
|
||||||
</bundleapp>
|
</bundleapp>
|
||||||
<zip destfile="${build.dir}/diylc-${diylc.version}-osx.zip">
|
<zip destfile="${build.dir}/diylc-${diylc.version}-osx.zip">
|
||||||
<zipfileset filemode="755" dir="${jar.dir}/DIYLC.app" prefix="DIYLC.app" />
|
<zipfileset filemode="755" dir="${build.dir}/DIYLC.app" prefix="DIYLC.app" />
|
||||||
</zip>
|
</zip>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
@@ -142,13 +142,10 @@
|
|||||||
<zipfileset dir="templates" prefix="templates" />
|
<zipfileset dir="templates" prefix="templates" />
|
||||||
<zipfileset dir="themes" prefix="themes" />
|
<zipfileset dir="themes" prefix="themes" />
|
||||||
<zipfileset dir="fonts" prefix="fonts" />
|
<zipfileset dir="fonts" prefix="fonts" />
|
||||||
<zipfileset dir="." includes="update.xml" />
|
<zipfileset dir="." includes="splash.png" />
|
||||||
<zipfileset dir="." includes="config.properties" />
|
|
||||||
<zipfileset dir="." includes="variants.xml" />
|
|
||||||
<zipfileset dir="." includes="run.sh" />
|
<zipfileset dir="." includes="run.sh" />
|
||||||
<zipfileset dir="." includes="diylc.l4j.ini" />
|
<zipfileset dir="." includes="diylc.l4j.ini" />
|
||||||
<zipfileset dir="." includes="diylc.exe" />
|
<zipfileset dir="." includes="diylc.exe" />
|
||||||
<zipfileset dir="." includes="splash.png" />
|
|
||||||
</zip>
|
</zip>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -148,9 +148,9 @@ public class DIYLCStarter {
|
|||||||
properties = new Properties();
|
properties = new Properties();
|
||||||
try {
|
try {
|
||||||
LOG.info("Injecting default properties.");
|
LOG.info("Injecting default properties.");
|
||||||
File f = new File("config.properties");
|
URL resource = Presenter.class.getClassLoader().getResource("config.properties");
|
||||||
if (f.exists()) {
|
if (resource != null) {
|
||||||
properties.load(new FileInputStream(f));
|
properties.load(resource.openStream());
|
||||||
PropertyInjector.injectProperties(properties);
|
PropertyInjector.injectProperties(properties);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user