Fixed problems in update site build.

Update site is now build including Eclipse p2 metadata (content.jar and artifact.jar). These files are required by some tools, such as Tycho (a maven plugin making p2 update sites available as maven repositories, see http://eclipse.org/tycho).
This commit is contained in:
Jens von Pilgrim 2011-12-15 19:00:59 +00:00
parent 5c5a7b962a
commit 54ddcf2133
4 changed files with 20 additions and 25 deletions

View File

@ -1,5 +1,6 @@
How to build the Eclipse update site
------------------------------------
Author: Jens von Pilgrim <developer@jevopi.de>
Building the Eclipse update site is fully integrated into the main LWJGL build script.
Here is how to build the update site:
@ -92,4 +93,6 @@ Some additional remarks:
a plugin does not remove the plugins from the Eclipse installation. When
the very same version is re-installed, instead of loading new files from the
update site these pre-installed versions are reused! Since the date and time
is added to the plugin version number, this should cause no problems.
is added to the plugin version number, this should cause no problems.
- default values for keystore, alias and passphrase are the same as in
lwjgl-applet

View File

@ -14,9 +14,9 @@ Author: Jens von Pilgrim, developer@jevopi.de
<dirname property="eclipse.antscript.basedir" file="${ant.file.eclipse.antscript}" />
<property name="keystore" value="teststore" />
<property name="alias" value="tester" />
<property name="password" value="tester" />
<property name="keystore" value="applet/lwjglkeystore" />
<property name="alias" value="lwjgl" />
<property name="password" value="123456" />
<property name="eclipse.updatesite" value="http://www.lwjgl.org/update/" />
<property name="eclipse.bundle.vendor" value="lwjgl.org" />
@ -505,6 +505,7 @@ Bundle-RequiredExecutionEnvironment: J2SE-1.5
<echo>This plugin is to be called from main LWJGL build.xml file.</echo>
<echo>It creates the update site, the result will be found in</echo>
<echo>${eclipse.build.plugins}/org.lwjgl.updatesite</echo>
<echo>For more information, read READ.ME</echo>
</target>
</project>

View File

@ -19,6 +19,7 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.StringWriter;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.Arrays;
@ -308,7 +309,6 @@ public class StandalonePublisher extends Task {
Document doc = readXMLinJar(docBuilder, jis, jarEntry);
info.doc = doc;
jis.closeEntry();
break;
}
}
@ -346,7 +346,6 @@ public class StandalonePublisher extends Task {
Document doc = readXMLinJar(docBuilder, jis, jarEntry);
info.doc = doc;
jis.closeEntry();
break;
}
@ -378,17 +377,13 @@ public class StandalonePublisher extends Task {
protected Document readXMLinJar(DocumentBuilder docBuilder,
JarInputStream jis, JarEntry jarEntry) throws IOException,
SAXException {
byte[] buffer = new byte[(int) jarEntry.getSize()];
int count;
int pos = 0;
byte data[] = new byte[BUFFERSIZE];
while ((count = jis.read(data, 0, BUFFERSIZE)) != -1) {
System.arraycopy(data, 0, buffer, pos, count);
pos += count;
try {
Document doc = docBuilder.parse(jis);
return doc;
} catch (IOException ex) {
System.err.println("Error reading jar entry " + jarEntry + ": ex");
throw ex;
}
ByteArrayInputStream bis = new ByteArrayInputStream(buffer);
Document doc = docBuilder.parse(bis);
return doc;
}
protected static void dump(Node doc) {
@ -1105,8 +1100,6 @@ public class StandalonePublisher extends Task {
}
return element;
}
/**
* @return the updateSiteFolder
@ -1176,20 +1169,20 @@ public class StandalonePublisher extends Task {
publisher.repositoryURI = "http://lwjgl.org/update";
publisher.execute();
}
/**
* {@inheritDoc}
* @see org.apache.tools.ant.Task#execute()
*/
@Override
public void execute() throws BuildException {
if (updateSiteFolder==null) {
if (updateSiteFolder == null) {
throw new BuildException("attribute updateSiteFolder missing");
}
if (repositoryName==null) {
if (repositoryName == null) {
throw new BuildException("attribute repositoryName missing");
}
if (repositoryURI==null) {
if (repositoryURI == null) {
throw new BuildException("attribute repositoryURI missing");
}
try {
@ -1197,9 +1190,7 @@ public class StandalonePublisher extends Task {
} catch (Exception ex) {
throw new BuildException(ex);
}
}
}