summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-04-06 05:22:40 (EDT)
committerpelder2006-04-06 05:22:40 (EDT)
commit9584bbce248b802cf560de7412ede1ccbc4d541f (patch)
tree53cd74198ac29d8b163384a6a4e96cff49a1fa15
parentbceb2cf67ef43bb296008442b42f26ad5aee6c51 (diff)
downloadorg.eclipse.jet-9584bbce248b802cf560de7412ede1ccbc4d541f.zip
org.eclipse.jet-9584bbce248b802cf560de7412ede1ccbc4d541f.tar.gz
org.eclipse.jet-9584bbce248b802cf560de7412ede1ccbc4d541f.tar.bz2
Remove dead code.
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/BundleBuildParameters.java67
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2BundleBuildTool.java138
2 files changed, 0 insertions, 205 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/BundleBuildParameters.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/BundleBuildParameters.java
deleted file mode 100644
index 8fbf0a0..0000000
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/BundleBuildParameters.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.internal.builder;
-
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jet.internal.InternalJET2Platform;
-
-
-/**
- * Parameters to the bundle Build
- *
- */
-public class BundleBuildParameters
-{
-
- private final IProject jet2Project;
-
- /**
- * Construct the parameters for a bundle build
- * @param jet2Project an Eclipse workspace project that is to be built into a JET2 bundle.
- *
- */
- public BundleBuildParameters(IProject jet2Project)
- {
- super();
- this.jet2Project = jet2Project;
-
- }
-
- /**
- * Get the location of the built bundle
- * @return a string representing the absoluate path of the bundle
- */
- public String getExportedBundleLocation()
- {
- IPath compiledBundleLocation = InternalJET2Platform.getDefault().getCompiledBundleLocation();
-
- return compiledBundleLocation.append(jet2Project.getName()).addFileExtension("jar").toString(); //$NON-NLS-1$
- }
-
- /**
- * Return the location (absolute path) of the project being built.
- * @return the project location (absolute path) as a string.
- */
- public String getJET2ProjectLocation()
- {
- return jet2Project.getLocation().toString();
- }
-
-}
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2BundleBuildTool.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2BundleBuildTool.java
deleted file mode 100644
index fcdddfd..0000000
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/builder/JET2BundleBuildTool.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/**
- * <copyright>
- *
- * Copyright (c) 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM - Initial API and implementation
- *
- * </copyright>
- *
- * $Id$
- */
-
-package org.eclipse.jet.internal.builder;
-
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.ant.core.AntRunner;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jet.JET2Platform;
-import org.eclipse.jet.internal.InternalJET2Platform;
-import org.eclipse.jet.internal.l10n.JET2Messages;
-
-
-/**
- * Utility class for creating JET2 Bundles from a JET2 Project
- *
- */
-public class JET2BundleBuildTool
-{
-
- private static final String BUNDLEBUILD_XML = "bundlebuild.xml"; //$NON-NLS-1$
-
- /**
- *
- */
- private JET2BundleBuildTool()
- {
- super();
- }
-
- /**
- *
- * @param jet2Project
- * @param monitor
- * @return the URL of the exported bundle
- * @throws CoreException
- */
- public static URL bundleProject(IProject jet2Project, IProgressMonitor monitor) throws CoreException
- {
- try
- {
- // This builder always does a "full" build
- monitor.beginTask(JET2Messages.JET2BundleBuildTool_CreatingBundle, 1);
- BundleBuildParameters parms = new BundleBuildParameters(jet2Project);
-
- String fileLocation = getAntBuildFile();
-
- AntRunner runner = new AntRunner();
- runner.setBuildFileLocation(fileLocation);
- runner.setArguments(new String []{ "-DbundleJarFile=" + parms.getExportedBundleLocation(), //$NON-NLS-1$
- "-Djet2Project=" + parms.getJET2ProjectLocation(), //$NON-NLS-1$
- "-Dbasedir=" + parms.getJET2ProjectLocation(), //$NON-NLS-1$
- });
- monitor.subTask(JET2Messages.JET2BundleBuildTool_CreatingJar);
- runner.run(new SubProgressMonitor(monitor, 1));
- return new URL("file:/" + parms.getExportedBundleLocation()); //$NON-NLS-1$
- }
- catch (IOException e)
- {
- throw new CoreException(InternalJET2Platform.newStatus(IStatus.ERROR, "Error accessing bundle build file", e)); //$NON-NLS-1$
- }
- finally
- {
- monitor.done();
- }
- }
-
- /**
- * @return
- * @throws MalformedURLException
- * @throws IOException
- * @throws FileNotFoundException
- */
- private static String getAntBuildFile() throws MalformedURLException, IOException, FileNotFoundException
- {
- // don't count on platform URLs resolving into file:// urls, they may
- // not, especially when the plugin is packaged as a single JAR
-
- InputStream contents = null;
- FileOutputStream outputContents = null;
- try
- {
- URL buildFileURL = new URL("platform:/plugin/" + JET2Platform.PLUGIN_ID + '/' + BUNDLEBUILD_XML); //$NON-NLS-1$
- // instead, copy the contents to a temporary file.
- contents = buildFileURL.openStream();
-
- String fileLocation = InternalJET2Platform.getDefault().getStateLocation().append(BUNDLEBUILD_XML).toString();
- outputContents = new FileOutputStream(new File(fileLocation));
- byte[] buffer = new byte [1024];
- int bytesRead = 0;
- while ((bytesRead = contents.read(buffer)) >= 0)
- {
- outputContents.write(buffer, 0, bytesRead);
- }
- return fileLocation;
-
- }
- finally
- {
- if (contents != null)
- {
- contents.close();
- }
- if (outputContents != null)
- {
- outputContents.close();
- }
-
- }
- }
-
-}