mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
added version reader
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package org.diylc.utils;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.net.URL;
|
||||
import java.util.List;
|
||||
|
||||
import org.diylc.appframework.update.Change;
|
||||
import org.diylc.appframework.update.Version;
|
||||
import org.diylc.presenter.Presenter;
|
||||
|
||||
import com.thoughtworks.xstream.XStream;
|
||||
import com.thoughtworks.xstream.io.xml.DomDriver;
|
||||
|
||||
public class VersionReader {
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
URL resource = Presenter.class.getResource("update.xml");
|
||||
if (resource != null) {
|
||||
BufferedInputStream in = new BufferedInputStream(resource.openStream());
|
||||
XStream xStream = new XStream(new DomDriver());
|
||||
@SuppressWarnings("unchecked")
|
||||
List<Version> allVersions = (List<Version>) xStream.fromXML(in);
|
||||
Version latest = allVersions.get(allVersions.size() - 1);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (Change c : latest.getChanges())
|
||||
sb.append("**[" + c.getChangeType() + "]** " + c.getDescription()).append("\n");
|
||||
System.out.println(sb.toString());
|
||||
in.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("Error: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<project name="diylc-swing-ftp" basedir="."
|
||||
default="printVersion">
|
||||
<property environment="env" />
|
||||
<property name="FTP_USER" value="diylc_deploy@diy-fever.com" />
|
||||
<property name="URL" value="ftp.diy-fever.com" />
|
||||
|
||||
<target name="upload">
|
||||
<echo
|
||||
message="Logging to ${FTP_USER}:${env.DIYLC_DEPLOY_PWD}@${URL}" />
|
||||
<ftp server="${URL}" userid="${FTP_USER}"
|
||||
password="${env.DIYLC_DEPLOY_PWD}">
|
||||
<fileset dir="./../diylc-core/src/org/diylc/presenter">
|
||||
<include name="update.xml" />
|
||||
</fileset>
|
||||
</ftp>
|
||||
</target>
|
||||
|
||||
<path id="class.path">
|
||||
<fileset dir="${basedir}">
|
||||
<include name="lib/**/*.jar" />
|
||||
<include name="library/**/*.jar" />
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<target name="printVersion">
|
||||
<java classname="org.diylc.utils.VersionReader">
|
||||
<sysproperty key="DEBUG" value="true" />
|
||||
<arg value="${basedir}/" />
|
||||
<classpath>
|
||||
<path refid="class.path" />
|
||||
</classpath>
|
||||
</java>
|
||||
</target>
|
||||
</project>
|
||||
@@ -1,15 +0,0 @@
|
||||
<project name="diylc-swing-ftp" basedir="." default="upload">
|
||||
<property environment="env" />
|
||||
<property name="FTP_USER" value="diylc_deploy@diy-fever.com" />
|
||||
<property name="URL" value="ftp.diy-fever.com" />
|
||||
|
||||
<target name="upload">
|
||||
<echo message="Logging to ${FTP_USER}:${env.DIYLC_DEPLOY_PWD}@${URL}"/>
|
||||
<ftp server="${URL}" userid="${FTP_USER}"
|
||||
password="${env.DIYLC_DEPLOY_PWD}">
|
||||
<fileset dir="./../diylc-core/src/org/diylc/presenter">
|
||||
<include name="update.xml"/>
|
||||
</fileset>
|
||||
</ftp>
|
||||
</target>
|
||||
</project>
|
||||
Reference in New Issue
Block a user