Commit c494c77d authored by Matt Tucker's avatar Matt Tucker Committed by matt

Additional Pack200 work.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3257 b35dd754-fafc-0310-a699-88a17e54d16e
parent 3fcf5dc5
......@@ -21,10 +21,6 @@
<setting name="RUN_JASPER_VALIDATION" value="false" />
</component>
<component name="WebModuleProperties">
<containerElement type="module" name="Messenger">
<attribute name="method" value="1" />
<attribute name="URI" value="/WEB-INF/classes" />
</containerElement>
<containerElement type="library" level="module">
<attribute name="method" value="1" />
<attribute name="URI" value="/WEB-INF/lib/ant-contrib.jar" />
......
......@@ -130,15 +130,6 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/build/lib/merge/jdic.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library" exported="">
<library>
<CLASSES>
......@@ -256,6 +247,15 @@
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
<root url="jar://$MODULE_DIR$/build/lib/dist/jdic.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntryProperties />
</component>
</module>
......
......@@ -63,7 +63,7 @@
<property name="version.major" value="2"/>
<property name="version.minor" value="4"/>
<property name="version.revision" value="0"/>
<property name="version.revision" value="1"/>
<property name="version.extra" value=""/> <!-- For 'beta' or 'alpha' -->
<property name="dist.prefix" value="wildfire"/>
......@@ -143,7 +143,7 @@
<path id="javadoc.dependencies">
<fileset dir="${lib.build.dir}" includes="*.jar" excludes="junit.jar"/>
<fileset dir="${lib.merge.dir}" includes="*.jar"/>
<fileset dir="${lib.dist.dir}" includes="servlet.jar, mail.jar, activation.jar"/>
<fileset dir="${lib.dist.dir}" includes="servlet.jar, mail.jar, activation.jar, jdic.jar"/>
</path>
<path id="compile.dependencies">
......@@ -307,15 +307,14 @@
<mkdir dir="${jar.dest.dir}"/>
<!-- Make main Wildfire jar -->
<jar jarfile="${jar.dest.dir}/${jar.name}" index="true" duplicate="preserve">
<fileset dir="${compile.dir}" includes="**/*.class" excludes="org/jivesoftware/wildfire/starter/ServerStarter*.class"/>
<fileset dir="${compile.dir}" includes="**/*.class"
excludes="org/jivesoftware/wildfire/starter/ServerStarter*.class,org/jivesoftware/wildfire/launcher/*.class"/>
<fileset dir="${jspc.classes.dest.dir}" includes="**/*.class"/>
<fileset dir="${src.i18n.dir}" includes="*.properties"/>
<fileset dir="${target.i18n.dir}" includes="*.properties"/>
<fileset dir="${src.dir}" includes="database/*.sql"/>
<fileset dir="${src.dir}" includes="database/upgrade/**/*.sql"/>
<fileset dir="${resources.dir}/jar" includes="**"/>
<fileset dir="${lib.build.installer.dir}/images" includes="**/*.gif"/>
<fileset dir="${lib.build.installer.dir}/images" includes="**/*.png"/>
<zipgroupfileset dir="${lib.merge.dir}" includes="*.jar"/>
<manifest>
<attribute name="Built-By" value="Jive Software (www.jivesoftware.org)"/>
......@@ -326,8 +325,11 @@
<jar jarfile="${jar.dest.dir}/${jar.starter.name}">
<fileset dir="${compile.dir}">
<include name="org/jivesoftware/wildfire/starter/ServerStarter*.class"/>
<include name="org/jivesoftware/wildfire/launcher/*.class"/>
<include name="org/jivesoftware/wildfire/starter/JiveClassLoader*.class"/>
</fileset>
<fileset dir="${lib.build.installer.dir}/images" includes="**/*.gif"/>
<fileset dir="${lib.build.installer.dir}/images" includes="**/*.png"/>
<manifest>
<attribute name="Main-Class" value="org.jivesoftware.wildfire.starter.ServerStarter"/>
<attribute name="Built-By" value="Jive Software (www.jivesoftware.org)"/>
......@@ -680,12 +682,14 @@
<for param="jar">
<path>
<fileset dir="${release.out.dir}/lib" includes="*.jar" excludes="startup.jar" />
<fileset dir="${release.out.dir}/lib" includes="*.jar" excludes="startup.jar,jdic.jar" />
</path>
<sequential>
<delete file="@{jar}.pack" />
<pack200 src="@{jar}"
destfile="@{jar}.pack"
gzipoutput="false"
segmentlimit="-1"
modificationtime="latest"
/>
<delete file="@{jar}" />
......
......@@ -105,7 +105,7 @@ public class EmailService {
* object returned and set desired message properties. When done, pass the
* object to the addMessage(Message) method.
*
* @return A new JavaMail message.
* @return a new JavaMail message.
*/
public MimeMessage createMimeMessage() {
if (session == null) {
......
......@@ -257,7 +257,7 @@ public class XMPPServer {
name = "127.0.0.1";
}
version = new Version(2, 4, 0, Version.ReleaseStatus.Release, -1);
version = new Version(2, 4, 1, Version.ReleaseStatus.Release, -1);
if ("true".equals(JiveGlobals.getXMLProperty("setup"))) {
setupMode = false;
}
......
......@@ -13,45 +13,19 @@ package org.jivesoftware.wildfire.launcher;
import org.jdesktop.jdic.tray.SystemTray;
import org.jdesktop.jdic.tray.TrayIcon;
import org.jivesoftware.util.WebManager;
import org.jivesoftware.util.XMLProperties;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.UIManager;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import javax.swing.*;
import javax.swing.text.BadLocationException;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.text.StyleConstants;
import javax.xml.parsers.DocumentBuilderFactory;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.URL;
/**
* Graphical launcher for Wildfire.
......@@ -89,7 +63,7 @@ public class Launcher {
// Log to System error instead of standard error log.
System.err.println("Error loading system tray library, system tray support disabled.");
}
// Use the native look and feel.
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
......@@ -494,9 +468,22 @@ public class Launcher {
private synchronized void launchBrowser() {
try {
XMLProperties props = new XMLProperties(configFile);
String port = props.getProperty("adminConsole.port");
String securePort = props.getProperty("adminConsole.securePort");
// Note, we use standard DOM to read in the XML. This is necessary so that
// Launcher has fewer dependencies.
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
Document document = factory.newDocumentBuilder().parse(configFile);
Element rootElement = document.getDocumentElement();
Element adminElement = (Element)rootElement.getElementsByTagName("adminConsole").item(0);
String port = "-1";
String securePort = "-1";
Element portElement = (Element)adminElement.getElementsByTagName("port").item(0);
if (portElement != null) {
port = portElement.getTextContent();
}
Element securePortElement = (Element)adminElement.getElementsByTagName("securePort").item(0);
if (securePortElement != null) {
securePort = securePortElement.getTextContent();
}
if ("-1".equals(port)) {
BrowserLauncher.openURL("https://127.0.0.1:" + securePort + "/index.html");
}
......@@ -533,7 +520,7 @@ public class Launcher {
// Just for fun. Show no matter what for two seconds.
Thread.sleep(2000);
WebManager.copy(plugin.toURL(), tempPluginsFile);
copy(plugin.toURL(), tempPluginsFile);
// If successfull, rename to real plugin name.
tempPluginsFile.renameTo(realPluginsFile);
......@@ -555,4 +542,49 @@ public class Launcher {
dialog.setLocationRelativeTo(frame);
dialog.setVisible(true);
}
private static void copy(URL src, File dst) throws IOException {
InputStream in = null;
OutputStream out = null;
try {
in = src.openStream();
out = new FileOutputStream(dst);
dst.mkdirs();
copy(in, out);
}
finally {
try {
if (in != null) {
in.close();
}
}
catch (IOException e) {
// Ignore.
}
try {
if (out != null) {
out.close();
}
}
catch (IOException e) {
// Ignore.
}
}
}
/**
* Common code for copy routines. By convention, the streams are
* closed in the same method in which they were opened. Thus,
* this method does not close the streams when the copying is done.
*/
private static void copy(InputStream in, OutputStream out) throws IOException {
byte[] buffer = new byte[4096];
while (true) {
int bytesRead = in.read(buffer);
if (bytesRead < 0) {
break;
}
out.write(buffer, 0, bytesRead);
}
}
}
\ No newline at end of file
......@@ -16,7 +16,6 @@ import org.jivesoftware.util.Log;
import java.io.*;
import java.util.jar.Pack200;
import java.util.jar.JarOutputStream;
import java.util.zip.GZIPInputStream;
/**
* Starts the core XMPP server. A bootstrap class that configures classloaders
......@@ -108,6 +107,13 @@ public class ServerStarter {
return parent;
}
/**
* Converts any pack files in a directory into standard JAR files. Each
* pack file will be deleted after being converted to a JAR. If no
* pack files are found, this method does nothing.
*
* @param libDir the directory containing pack files.
*/
private void unpackArchives(File libDir) {
// Get a list of all packed files in the lib directory.
File [] packedFiles = libDir.listFiles(new FilenameFilter() {
......@@ -131,6 +137,7 @@ public class ServerStarter {
in.close();
out.close();
packedFile.delete();
unpacked = true;
}
catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment