diff --git a/releng/org.eclipse.cdt.releng/.classpath b/releng/org.eclipse.cdt.releng/.classpath new file mode 100644 index 00000000000..14133132696 --- /dev/null +++ b/releng/org.eclipse.cdt.releng/.classpath @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/releng/org.eclipse.cdt.releng/.cvsignore b/releng/org.eclipse.cdt.releng/.cvsignore new file mode 100644 index 00000000000..ba077a4031a --- /dev/null +++ b/releng/org.eclipse.cdt.releng/.cvsignore @@ -0,0 +1 @@ +bin diff --git a/releng/org.eclipse.cdt.releng/.project b/releng/org.eclipse.cdt.releng/.project new file mode 100644 index 00000000000..d8f81b89189 --- /dev/null +++ b/releng/org.eclipse.cdt.releng/.project @@ -0,0 +1,36 @@ + + + org.eclipse.cdt.releng + + + org.eclipse.core.boot + org.eclipse.core.resources + org.eclipse.core.runtime + org.eclipse.pde.core + org.eclipse.pde.ui + org.eclipse.team.core + org.eclipse.team.cvs.core + org.eclipse.ui + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/releng/org.eclipse.cdt.releng/JUNIT.XSL b/releng/org.eclipse.cdt.releng/JUNIT.XSL new file mode 100644 index 00000000000..a7dd9abed93 --- /dev/null +++ b/releng/org.eclipse.cdt.releng/JUNIT.XSL @@ -0,0 +1,455 @@ + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + + + + +
+ + + + + + + + +

Packages

+ Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers. + + + + + + + + + + + + + + + + + Failure + Error + + + + + + + + + +
+ + + +
+
+ + + + + + + + + + + + +

Package

+ + + + + + +
+ Back to top +

+

+ + + + + + + + +

TestCase

+ + + + + + + + + + +
+ +

+ + Back to top + + + + +

Summary

+ + + + + + + + + + + + + + + + + Failure + Error + + + + + + + + + +
TestsFailuresErrorsSuccess rateTime
+ + + + + + + +
+ + + + +
+ Note: failures are anticipated and checked for with assertions while errors are unanticipated. +
+
+ + + + cur = TestCases['.'] = new Array(); + + + cur[''] = ''; + + + + + +

Unit Test Results

+ + + + + +
Designed for use with JUnit and Ant.
+
+
+ + + + Name + Tests + Errors + Failures + Time(s) + + + + + + + Name + Tests + Errors + Failures + Time(s) + + + + + + + Name + Status + Type + Time(s) + + + + + + + + + + + Failure + Error + + + + + + + + + + + + + + + + + + + + + Error + + + + + + Failure + + + + Error + + + + Success + + + + + + + + + + + + + + + + + + + + + + + + N/A + + + + + + +

+ + + + + + + + + + + + + \\ + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+ + + + + + + + + + + + + diff --git a/releng/org.eclipse.cdt.releng/build.properties b/releng/org.eclipse.cdt.releng/build.properties new file mode 100644 index 00000000000..08e19c0dc85 --- /dev/null +++ b/releng/org.eclipse.cdt.releng/build.properties @@ -0,0 +1,4 @@ +source.releng.jar = src/ +bin.includes = plugin.xml,\ + *.jar,\ + releng.jar diff --git a/releng/org.eclipse.cdt.releng/doall b/releng/org.eclipse.cdt.releng/doall new file mode 100644 index 00000000000..5e8fc349ef1 --- /dev/null +++ b/releng/org.eclipse.cdt.releng/doall @@ -0,0 +1,16 @@ +# +# The main build script +# - The assumption is that the scripts start off in the root directory +# of the eclipse install doing the build +# + +if [ -n "$CDT_ROOT" ]; then cd $CDT_ROOT; fi + +for i in dobuild doinstall dotest +do + if ! $i + then + echo $i failed + exit 1 + fi +done diff --git a/releng/org.eclipse.cdt.releng/dobuild b/releng/org.eclipse.cdt.releng/dobuild new file mode 100644 index 00000000000..e30ec4a7fdf --- /dev/null +++ b/releng/org.eclipse.cdt.releng/dobuild @@ -0,0 +1,19 @@ +# +# Main build script +# - the following environment variables need to be set +# - $CDT_USER - the username to use on the eclipse download machine +# - $CDT_PASSWD - the password for that account +# + +# +# Run Build +# + +if [ -z "$CDT_USER" ] +then + echo CDT_USER environment variable not set + exit 1 +fi + +./eclipse -nosplash -application org.eclipse.cdt.releng.build \ + -vmargs -Dcdt.build.user=$CDT_USER -Dcdt.build.passwd=$CDT_PASSWD diff --git a/releng/org.eclipse.cdt.releng/doinstall b/releng/org.eclipse.cdt.releng/doinstall new file mode 100644 index 00000000000..461bcf590dd --- /dev/null +++ b/releng/org.eclipse.cdt.releng/doinstall @@ -0,0 +1,32 @@ +# +# Set up test environment +# - the assumption is that the necessary zip files are in a zip file +# in the eclipse install +# + +rm -fr testspace +mkdir testspace +cd testspace +unzip -qq ../zip/eclipse-SDK-2.1.1-linux-gtk.zip + +cd eclipse/plugins +unzip -qq ../../../zip/org.eclipse.test_2.1.0.zip +unzip -qq ../../../zip/org.eclipse.ant.optional.junit_2.1.0.zip +cd .. + +export BUILD_SITE=../../workspace/build.site + +for d in plugins features +do + for i in $BUILD_SITE/$d/* + do + export DEST=$d/`echo $i | sed -e s:$BUILD_SITE/$d/:: -e s/.jar//` + mkdir $DEST + cd $DEST + jar xf $i + cd ../.. + done +done + +# Back up to the top dir +cd ../.. diff --git a/releng/org.eclipse.cdt.releng/dotests b/releng/org.eclipse.cdt.releng/dotests new file mode 100644 index 00000000000..d854272f2e3 --- /dev/null +++ b/releng/org.eclipse.cdt.releng/dotests @@ -0,0 +1,28 @@ +# +# Run Tests +# + +export RESULTS=`pwd`/results +rm -fr $RESULTS +mkdir $RESULTS + +cd testspace/eclipse + +# TODO - add in the rest of the test plugins +export PLUGINS='org.eclipse.cdt.core.tests' +for i in $PLUGINS +do + ./eclipse -nosplash -application org.eclipse.ant.core.antRunner \ + -f plugins/$i*/test.xml -Declipse-home=`pwd` \ + -Dorg.eclipse.test=org.eclipse.test_2.1.0\ + -Dos=linux -Dws=gtk -Darch=x86 + mv $i*.xml $RESULTS +done + +cd $RESULTS +for i in $PLUGINS +do + xsltproc ../workspace/org.eclipse.cdt.releng/JUNIT.XSL $i.xml > $i.html +done + +cd .. diff --git a/releng/org.eclipse.cdt.releng/ftp.jar b/releng/org.eclipse.cdt.releng/ftp.jar new file mode 100644 index 00000000000..4c19ff79f83 Binary files /dev/null and b/releng/org.eclipse.cdt.releng/ftp.jar differ diff --git a/releng/org.eclipse.cdt.releng/index.html b/releng/org.eclipse.cdt.releng/index.html new file mode 100644 index 00000000000..e8e0ea1a479 --- /dev/null +++ b/releng/org.eclipse.cdt.releng/index.html @@ -0,0 +1,7 @@ + + + +Hi there. + + + diff --git a/releng/org.eclipse.cdt.releng/plugin.xml b/releng/org.eclipse.cdt.releng/plugin.xml new file mode 100644 index 00000000000..c7be26fca19 --- /dev/null +++ b/releng/org.eclipse.cdt.releng/plugin.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/releng/org.eclipse.cdt.releng/src/org/eclipse/cdt/releng/DoBuild.java b/releng/org.eclipse.cdt.releng/src/org/eclipse/cdt/releng/DoBuild.java new file mode 100644 index 00000000000..f7d4b3500cc --- /dev/null +++ b/releng/org.eclipse.cdt.releng/src/org/eclipse/cdt/releng/DoBuild.java @@ -0,0 +1,427 @@ +package org.eclipse.cdt.releng; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayList; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.eclipse.core.boot.IPlatformRunnable; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.pde.core.plugin.IFragment; +import org.eclipse.pde.core.plugin.IPlugin; +import org.eclipse.pde.internal.core.feature.WorkspaceFeatureModel; +import org.eclipse.pde.internal.core.ifeature.IFeature; +import org.eclipse.pde.internal.core.ifeature.IFeatureChild; +import org.eclipse.pde.internal.core.ifeature.IFeatureImport; +import org.eclipse.pde.internal.core.ifeature.IFeaturePlugin; +import org.eclipse.pde.internal.core.isite.ISite; +import org.eclipse.pde.internal.core.isite.ISiteBuild; +import org.eclipse.pde.internal.core.isite.ISiteBuildFeature; +import org.eclipse.pde.internal.core.isite.ISiteCategory; +import org.eclipse.pde.internal.core.isite.ISiteCategoryDefinition; +import org.eclipse.pde.internal.core.isite.ISiteFeature; +import org.eclipse.pde.internal.core.isite.ISiteModelFactory; +import org.eclipse.pde.internal.core.plugin.WorkspaceFragmentModel; +import org.eclipse.pde.internal.core.plugin.WorkspacePluginModel; +import org.eclipse.pde.internal.core.site.WorkspaceSiteBuildModel; +import org.eclipse.pde.internal.core.site.WorkspaceSiteModel; +import org.eclipse.pde.internal.ui.editor.site.FeatureBuildOperation; +import org.eclipse.team.core.TeamException; +import org.eclipse.team.internal.ccvs.core.CVSException; +import org.eclipse.team.internal.ccvs.core.CVSTag; +import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation; +import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation; +import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import com.enterprisedt.net.ftp.FTPClient; +import com.enterprisedt.net.ftp.FTPConnectMode; +import com.enterprisedt.net.ftp.FTPException; +import com.enterprisedt.net.ftp.FTPTransferType; + +/** + * @see IPlatformRunnable + */ +public class DoBuild implements IPlatformRunnable { + + private IWorkspace workspace; + private String version; + private IProgressMonitor monitor; + + private static String locstr = ":pserver:anonymous@dev.eclipse.org:/home/tools"; + + private static final String ftpHost = "download.eclipse.org"; + private static final String ftpPath = "cdt/updates/builds/1.2"; + private static final String ftpUser = System.getProperty("cdt.build.user"); + private static final String ftpPassword = System.getProperty("cdt.build.passwd"); + + private static final String[] plugins = { + // Code + "org.eclipse.cdt.core", + "org.eclipse.cdt.core.tests", + "org.eclipse.cdt.ui", + "org.eclipse.cdt.ui.tests", + "org.eclipse.cdt.debug.core", + "org.eclipse.cdt.debug.ui", + "org.eclipse.cdt.debug.ui.tests", + "org.eclipse.cdt.debug.mi.core", + "org.eclipse.cdt.debug.mi.ui", + "org.eclipse.cdt.launch", + // Docs + "org.eclipse.cdt.doc.user", + // Features + "org.eclipse.cdt", + "org.eclipse.cdt.linux.gtk", + "org.eclipse.cdt.linux.motif", + "org.eclipse.cdt.qnx.photon", + "org.eclipse.cdt.solaris.motif", + "org.eclipse.cdt.win32", + "org.eclipse.cdt.source", + "org.eclipse.cdt.testing" + }; + + private static final String[] fragments = { + "org.eclipse.cdt.core.linux", + "org.eclipse.cdt.core.qnx", + "org.eclipse.cdt.core.solaris", + "org.eclipse.cdt.core.win32", + }; + + private static final String[] featureProjects = { + "org.eclipse.cdt-feature", + "org.eclipse.cdt.linux.gtk-feature", + "org.eclipse.cdt.linux.motif-feature", + "org.eclipse.cdt.qnx.photon-feature", + "org.eclipse.cdt.solaris.motif-feature", + "org.eclipse.cdt.win32-feature", + "org.eclipse.cdt.source-feature", + "org.eclipse.cdt.testing-feature" + }; + + private static final String[] buildFeatures = { + "org.eclipse.cdt", + "org.eclipse.cdt.linux.gtk", + "org.eclipse.cdt.linux.motif", + "org.eclipse.cdt.qnx.photon", + "org.eclipse.cdt.solaris.motif", + "org.eclipse.cdt.win32", + "org.eclipse.cdt.source", + "org.eclipse.cdt.testing" + }; + + private static final boolean[] externalFeatures = { + false, //"org.eclipse.cdt" + true, //"org.eclipse.cdt.linux.gtk" + true, //"org.eclipse.cdt.linux.motif" + true, //"org.eclipse.cdt.qnx.photon" + true, //"org.eclipse.cdt.solaris.motif" + true, //"org.eclipse.cdt.win32" + true, //"org.eclipse.cdt.source" + true, //"org.eclipse.cdt.testing" + + }; + + private static String[] projects; + + static { + // Create the projects array + projects = new String[plugins.length + fragments.length + featureProjects.length]; + System.arraycopy(plugins, 0, projects, 0, plugins.length); + int i = plugins.length; + System.arraycopy(fragments, 0, projects, i, fragments.length); + i += fragments.length; + System.arraycopy(featureProjects, 0, projects, i, featureProjects.length); + } + + /** + * @see IPlatformRunnable#run + */ + public Object run(Object args) throws Exception { + long start = System.currentTimeMillis(); + workspace = ResourcesPlugin.getWorkspace(); + monitor = new NullProgressMonitor(); + + deleteOldProjects(); + downloadNewProjects(); + downloadUpdateSite(); + updateVersions(); + buildUpdateSite(); + uploadUpdateSite(); + + long time = System.currentTimeMillis() - start; + long minutes = time / 60000; + time -= minutes * 60000; + long seconds = time / 1000; + time -= seconds * 1000; + + System.out.println("Done: " + + minutes + ":" + (seconds < 10 ? "0" : "") + seconds + + "." + time); + return null; + } + + private void deleteOldProjects() throws CoreException { + System.out.println("Deleting old projects"); + for (int i = 0; i < projects.length; ++i) { + IProject project = workspace.getRoot().getProject(projects[i]); + if (project.exists()) { + project.delete(false, monitor); + } + } + } + + private void downloadNewProjects() throws CVSException, TeamException { + // Download the new projects + ICVSRepositoryLocation location = CVSRepositoryLocation.fromString(locstr); + for (int i = 0; i < projects.length; ++i) { + System.out.println("Downloading " + projects[i]); + CVSWorkspaceRoot.checkout( + location, + null, + projects[i], + CVSTag.DEFAULT, + monitor); + } + } + + private void downloadUpdateSite() throws IOException, CoreException, FTPException { + System.out.println("Downloading update site"); + + // Find and create the local location to download to + IProject buildSite = workspace.getRoot().getProject("build.site"); + + // Download from the FTP site + FTPClient ftp = new FTPClient(ftpHost); + ftp.setConnectMode(FTPConnectMode.ACTIVE); + ftp.login(ftpUser, ftpPassword); + ftp.chdir(ftpPath); + + IFile file = buildSite.getFile("version.xml"); + OutputStream stream = new FileOutputStream(file.getRawLocation().toOSString()); + ftp.get(stream, "version.xml"); + stream.close(); + + file = buildSite.getFile("site.xml"); + stream = new FileOutputStream(file.getRawLocation().toOSString()); + ftp.get(stream, "site.xml"); + stream.close(); + + IFolder folder = buildSite.getFolder(".sitebuild"); + file = folder.getFile("sitebuild.xml"); + stream = new FileOutputStream(file.getRawLocation().toOSString()); + ftp.chdir(".sitebuild"); + ftp.get(stream, "sitebuild.xml"); + stream.close(); + + ftp.quit(); + buildSite.refreshLocal(IResource.DEPTH_INFINITE, monitor); + } + + private void updateVersions() throws Exception { + System.out.println("Setting versions"); + + // Get and increment the version + IProject siteProject = workspace.getRoot().getProject("build.site"); + IFile versionFile = siteProject.getFile("version.xml"); + versionFile.refreshLocal(IResource.DEPTH_ONE, monitor); + DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = builderFactory.newDocumentBuilder(); + Document versionDoc = builder.parse(versionFile.getContents()); + Element versionElem = versionDoc.getDocumentElement(); + String versionId = versionElem.getAttribute("id"); + String buildNum = versionElem.getAttribute("build"); + buildNum = String.valueOf(Integer.decode(buildNum).intValue() + 1); + versionElem.setAttribute("build", buildNum); + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + File versionResult = new File(versionFile.getRawLocation().toOSString()); + transformer.transform(new DOMSource(versionDoc), new StreamResult(versionResult)); + versionFile.refreshLocal(IResource.DEPTH_ONE, monitor); + version = versionId + "." + buildNum; + System.out.println("Version: " + version); + + // Go through the projects and update the version info + for (int i = 0; i < plugins.length; ++i) { + IProject project = workspace.getRoot().getProject(plugins[i]); + IFile pluginxml = project.getFile("plugin.xml"); + pluginxml.refreshLocal(IResource.DEPTH_ONE, monitor); + WorkspacePluginModel pluginModel = new WorkspacePluginModel(pluginxml); + pluginModel.load(); + IPlugin plugin = pluginModel.getPlugin(); + plugin.setVersion(version); + pluginModel.save(); + pluginxml.refreshLocal(IResource.DEPTH_ONE, monitor); + } + + for (int i = 0; i < fragments.length; ++i) { + IProject project = workspace.getRoot().getProject(fragments[i]); + IFile fragmentxml = project.getFile("fragment.xml"); + fragmentxml.refreshLocal(IResource.DEPTH_ONE, monitor); + WorkspaceFragmentModel fragmentModel = new WorkspaceFragmentModel(fragmentxml); + fragmentModel.load(); + IFragment fragment = fragmentModel.getFragment(); + fragment.setVersion(version); + fragment.setPluginVersion(version); + fragmentModel.save(); + fragmentxml.refreshLocal(IResource.DEPTH_ONE, monitor); + } + + for (int i = 0; i < featureProjects.length; ++i) { + IProject project = workspace.getRoot().getProject(featureProjects[i]); + IFile featurexml = project.getFile("feature.xml"); + featurexml.refreshLocal(IResource.DEPTH_ONE, monitor); + WorkspaceFeatureModel featureModel = new WorkspaceFeatureModel(featurexml); + featureModel.load(); + IFeature feature = featureModel.getFeature(); + feature.setVersion(version); + IFeaturePlugin[] plugins = feature.getPlugins(); + for (int j = 0; j < plugins.length; ++j) + if (plugins[j].getId().startsWith("org.eclipse.cdt")) + plugins[j].setVersion(version); + IFeatureChild[] children = feature.getIncludedFeatures(); + for (int j = 0; j < children.length; ++j) + if (children[j].getId().startsWith("org.eclipse.cdt")) + children[j].setVersion(version); + IFeatureImport[] imports = feature.getImports(); + for (int j = 0; j < imports.length; ++j) + if (imports[j].getId().startsWith("org.eclipse.cdt")) + imports[j].setVersion(version); + featureModel.save(); + featurexml.refreshLocal(IResource.DEPTH_ONE, monitor); + } + } + + private void buildUpdateSite() throws Exception { + System.out.println("Seting up build site"); + + // Get the models set up. + IProject siteProject = workspace.getRoot().getProject("build.site"); + IFile siteFile = siteProject.getFile("site.xml"); + siteFile.refreshLocal(IResource.DEPTH_ONE, monitor); + WorkspaceSiteModel siteModel = new WorkspaceSiteModel(siteFile); + siteModel.load(); + ISiteModelFactory siteModelFactory = siteModel.getFactory(); + ISite site = siteModel.getSite(); + IFile siteBuildFile = siteProject.getFile(".sitebuild/sitebuild.xml"); + siteBuildFile.refreshLocal(IResource.DEPTH_ONE, monitor); + WorkspaceSiteBuildModel buildModel = new WorkspaceSiteBuildModel(siteBuildFile); + buildModel.load(); + ISiteBuild siteBuild = buildModel.getSiteBuild(); + + // Add in the features + ISiteCategoryDefinition categoryDef = siteModelFactory.createCategoryDefinition(); + String categoryName = "CDT Build " + version; + categoryDef.setLabel(categoryName); + categoryDef.setName(categoryName); + site.addCategoryDefinitions(new ISiteCategoryDefinition[] {categoryDef}); + + ArrayList buildList = new ArrayList(); + ArrayList externalList = new ArrayList(); + for (int i = 0; i < buildFeatures.length; ++i) { + ISiteBuildFeature buildFeature = buildModel.createFeature(); + buildFeature.setId(buildFeatures[i]); + buildFeature.setVersion(version); + buildList.add(buildFeature); + + if (externalFeatures[i]) { + ISiteFeature feature = siteModelFactory.createFeature(); + feature.setId(buildFeatures[i]); + feature.setVersion(version); + feature.setURL("features/" + buildFeatures[i] + "_" + version + ".jar"); + ISiteCategory category = siteModelFactory.createCategory(feature); + category.setName(categoryName); + feature.addCategories(new ISiteCategory[] {category}); + externalList.add(feature); + } + } + + siteBuild.addFeatures((ISiteBuildFeature[])buildList.toArray(new ISiteBuildFeature[buildList.size()])); + site.addFeatures((ISiteFeature[])externalList.toArray(new ISiteFeature[externalList.size()])); + + // Save the models + siteModel.save(); + siteFile.refreshLocal(IResource.DEPTH_ONE, monitor); + buildModel.save(); + siteBuildFile.refreshLocal(IResource.DEPTH_ONE, monitor); + + // Do the build + System.out.println("Building"); + FeatureBuildOperation op + = new FeatureBuildOperation( + buildList, null, true, true); + op.run(monitor); + } + + private void uploadUpdateSite() throws Exception { + System.out.println("Uploading to site"); + + IProject buildSite = workspace.getRoot().getProject("build.site"); + buildSite.refreshLocal(IResource.DEPTH_INFINITE, monitor); + + // Open the ftp site + FTPClient ftp = new FTPClient(ftpHost); + ftp.setConnectMode(FTPConnectMode.ACTIVE); + ftp.login(ftpUser, ftpPassword); + ftp.setType(FTPTransferType.BINARY); + ftp.chdir(ftpPath); + + IFile file = buildSite.getFile("version.xml"); + ftp.put(file.getContents(), "version.xml"); + + file = buildSite.getFile("site.xml"); + ftp.put(file.getContents(), "site.xml"); + + IFolder folder = buildSite.getFolder(".sitebuild"); + ftp.chdir(".sitebuild"); + + file = folder.getFile("sitebuild.xml"); + ftp.put(file.getContents(), "sitebuild.xml"); + + folder = buildSite.getFolder("plugins"); + ftp.chdir("../plugins"); + + for (int i = 0; i < plugins.length; ++i) { + String name = plugins[i] + "_" + version + ".jar"; + System.out.println("Uploading plugin: " + name); + file = folder.getFile(name); + ftp.put(file.getContents(), name); + } + + for (int i = 0; i < fragments.length; ++i) { + String name = fragments[i] + "_" + version + ".jar"; + System.out.println("Uploading fragment: " + name); + file = folder.getFile(name); + ftp.put(file.getContents(), name); + } + + folder = buildSite.getFolder("features"); + ftp.chdir("../features"); + + for (int i = 0; i < buildFeatures.length; ++i) { + String name = buildFeatures[i] + "_" + version + ".jar"; + System.out.println("Uploading feature: " + name); + file = folder.getFile(name); + ftp.put(file.getContents(), name); + } + + ftp.quit(); + } + +} diff --git a/releng/org.eclipse.cdt.releng/src/org/eclipse/cdt/releng/RelengPlugin.java b/releng/org.eclipse.cdt.releng/src/org/eclipse/cdt/releng/RelengPlugin.java new file mode 100644 index 00000000000..42569895088 --- /dev/null +++ b/releng/org.eclipse.cdt.releng/src/org/eclipse/cdt/releng/RelengPlugin.java @@ -0,0 +1,63 @@ +package org.eclipse.cdt.releng; + +import org.eclipse.ui.plugin.*; +import org.eclipse.core.runtime.*; +import org.eclipse.core.resources.*; +import java.util.*; + +/** + * The main plugin class to be used in the desktop. + */ +public class RelengPlugin extends AbstractUIPlugin { + //The shared instance. + private static RelengPlugin plugin; + //Resource bundle. + private ResourceBundle resourceBundle; + + /** + * The constructor. + */ + public RelengPlugin(IPluginDescriptor descriptor) { + super(descriptor); + plugin = this; + try { + resourceBundle= ResourceBundle.getBundle("org.eclipse.cdt.releng.RelengPluginResources"); + } catch (MissingResourceException x) { + resourceBundle = null; + } + } + + /** + * Returns the shared instance. + */ + public static RelengPlugin getDefault() { + return plugin; + } + + /** + * Returns the workspace instance. + */ + public static IWorkspace getWorkspace() { + return ResourcesPlugin.getWorkspace(); + } + + /** + * Returns the string from the plugin's resource bundle, + * or 'key' if not found. + */ + public static String getResourceString(String key) { + ResourceBundle bundle= RelengPlugin.getDefault().getResourceBundle(); + try { + return bundle.getString(key); + } catch (MissingResourceException e) { + return key; + } + } + + /** + * Returns the plugin's resource bundle, + */ + public ResourceBundle getResourceBundle() { + return resourceBundle; + } +}