mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 02:45:36 +01:00
Pushing v1.2.2 to the update site. Dependency cleanup and unused code removal.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<feature
|
||||
id="processing.plugin"
|
||||
label="Processing Plug-In for Eclipse"
|
||||
version="1.2.0.qualifier"
|
||||
version="1.2.2.qualifier"
|
||||
provider-name="Processing.org">
|
||||
|
||||
<description url="http://www.processing.org/">
|
||||
@@ -22,35 +22,30 @@ Portions of the code were written by other contributors and are attributed in th
|
||||
There are many contributions to the Exhibition and Examples on the Processing.org website and these are attributed in context. The Reference for the Language and Environment are under a Creative Commons license which makes it possible to re-use this content for non-commercial purposes if it is credited.
|
||||
</copyright>
|
||||
|
||||
<license url="http://www.example.com/license">
|
||||
This program and the accompanying materials, unless otherwise noted, are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.opensource.org/licenses/eclipse-1.0.php
|
||||
|
||||
Several libraries are included from the Processing language and Processing development environment. These are included under the GNU LGPL (http://www.gnu.org/licenses/lgpl.html).
|
||||
|
||||
All images are included under a creative commons license (http://creativecommons.org/) that allows re-use for non-commercial work if it is credited.
|
||||
<license url="http://www.opensource.org/licenses/eclipse-1.0.php ">
|
||||
This program and the accompanying materials, unless otherwise
|
||||
noted, are made available under the terms of the Eclipse Public
|
||||
License v1.0 which accompanies this distribution, and is available
|
||||
at http://www.opensource.org/licenses/eclipse-1.0.php
|
||||
Several libraries are included from the Processing language and
|
||||
Processing development environment. These are included under
|
||||
the GNU LGPL (http://www.gnu.org/licenses/lgpl.html).
|
||||
All images are included under a creative commons license (http://creativecommons.org/)
|
||||
that allows re-use for non-commercial work if it is credited.
|
||||
</license>
|
||||
|
||||
<requires>
|
||||
<import plugin="org.eclipse.core.runtime"/>
|
||||
<import plugin="org.eclipse.core.resources"/>
|
||||
<import plugin="org.eclipse.debug.core"/>
|
||||
<import plugin="org.eclipse.jdt.core"/>
|
||||
<import plugin="org.eclipse.jdt.launching"/>
|
||||
<import plugin="org.eclipse.core.commands"/>
|
||||
<import plugin="org.eclipse.ui"/>
|
||||
<import plugin="org.eclipse.core.filebuffers"/>
|
||||
<import plugin="org.eclipse.jdt.debug.ui"/>
|
||||
<import plugin="org.eclipse.jface.text" version="3.6.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.ui.editors" version="3.6.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.core.resources" version="3.6.0" match="greaterOrEqual"/>
|
||||
<import plugin="processing.plugin.core" version="0.1.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.debug.ui"/>
|
||||
<import plugin="org.eclipse.jdt.launching" version="3.5.100" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.ui.ide" version="3.6.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.jdt.core" version="3.6.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.ui.navigator"/>
|
||||
<import plugin="org.eclipse.ui.navigator.resources"/>
|
||||
<import plugin="org.eclipse.jdt.ui" version="3.6.0" match="greaterOrEqual"/>
|
||||
<import plugin="org.eclipse.ui.navigator" version="3.5.0" match="greaterOrEqual"/>
|
||||
</requires>
|
||||
|
||||
<plugin
|
||||
|
||||
@@ -2,11 +2,10 @@ Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Processing Plugin Core
|
||||
Bundle-SymbolicName: processing.plugin.core;singleton:=true
|
||||
Bundle-Version: 0.2.1.0
|
||||
Bundle-Version: 0.2.2.0
|
||||
Bundle-Activator: processing.plugin.core.ProcessingCore
|
||||
Bundle-Vendor: Processing.org
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
org.eclipse.core.resources,
|
||||
processing.plugin.appBundle;visibility:=reexport,
|
||||
org.eclipse.debug.core,
|
||||
org.eclipse.jdt.core,
|
||||
@@ -15,4 +14,3 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: processing.plugin.core,
|
||||
processing.plugin.core.builder
|
||||
Import-Package: org.eclipse.core.commands
|
||||
|
||||
@@ -39,16 +39,4 @@
|
||||
<persistent value="true" />
|
||||
<super type="org.eclipse.core.resources.problemmarker" />
|
||||
</extension>
|
||||
<extension point="org.eclipse.debug.core.launchConfigurationTypes">
|
||||
<launchConfigurationType
|
||||
category="Processing"
|
||||
delegate="processing.plugin.core.launching.ProcessingSketchLaunchConfigurationDelegate"
|
||||
id="processing.plugin.core.launching.processingSketch"
|
||||
modes="run"
|
||||
name="Processing Sketch Applet">
|
||||
<!--sourcePathComputerId="org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer"
|
||||
sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector" -->
|
||||
</launchConfigurationType>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.eclipse.core.runtime.IPath;
|
||||
import org.eclipse.core.runtime.Plugin;
|
||||
|
||||
import processing.plugin.core.builder.Utilities;
|
||||
|
||||
|
||||
/**
|
||||
* The plug-in activator enabling the core (UI-free) support for Processing sketches.
|
||||
* <p>
|
||||
|
||||
@@ -1,199 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2010 Chris Lonnen. 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.opensource.org/licenses/eclipse-1.0.php
|
||||
*
|
||||
* Contributors:
|
||||
* Chris Lonnen - initial API and implementation
|
||||
*/
|
||||
package processing.plugin.core.launching;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.resources.IResource;
|
||||
import org.eclipse.core.resources.ResourcesPlugin;
|
||||
import org.eclipse.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.debug.core.IDebugEventSetListener;
|
||||
import org.eclipse.debug.core.ILaunch;
|
||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||
import org.eclipse.debug.core.ILaunchManager;
|
||||
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
|
||||
import org.eclipse.jdt.launching.JavaLaunchDelegate;
|
||||
import org.eclipse.jdt.launching.JavaRuntime;
|
||||
|
||||
import processing.plugin.core.ProcessingLog;
|
||||
|
||||
/**
|
||||
* The default launch configuration delegate for Processing Sketches.
|
||||
* <p>
|
||||
* Checks to make sure the last build was successful and that the sketch is not being run in debug mode.
|
||||
* Then it computes some sensible defaults, builds a simple html wrapper and launches the sketch as an
|
||||
* applet. This is not the same process as an export, and will not populate the applet folder.
|
||||
*/
|
||||
public class ProcessingSketchLaunchConfigurationDelegate extends JavaLaunchDelegate implements IDebugEventSetListener {
|
||||
|
||||
/**
|
||||
* Maps ILaunch objects to File objects that represent the .html file initiating the
|
||||
* applet launch. This is used to delete the .html file when the launch terminates.
|
||||
*/
|
||||
private static Map fgLaunchToFileMap = new HashMap();
|
||||
|
||||
/** Used to map temp file to launch object. */
|
||||
private ILaunch fLaunch;
|
||||
|
||||
/* (non-Javadoc) Makes sure to cleanup the leftovers if things break. */
|
||||
public synchronized void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
|
||||
try{
|
||||
fLaunch = launch;
|
||||
super.launch(configuration, mode, launch, monitor);
|
||||
} catch (CoreException e){
|
||||
cleanup(launch);
|
||||
throw e;
|
||||
}
|
||||
fLaunch = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called first in the launch sequence. Checks to make sure this launcher is being executed
|
||||
* in run mode, and returns true to indicate that things can proceed. If it is being executed
|
||||
* in debug mode or some other unsupported mode, return false to abort the launch.
|
||||
*/
|
||||
public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
|
||||
if(mode.equals(ILaunchManager.RUN_MODE)){
|
||||
if(configuration.getAttribute("wasLastBuildSuccessful", false))
|
||||
return true;
|
||||
ProcessingLog.logInfo("Aborting launch -- Sketch has unresolved build problems.");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// public String getJavaPolicyFile() ??
|
||||
|
||||
/** Clean up the temp files and listeners after a launch */
|
||||
public void cleanup(ILaunch launch){
|
||||
File temp = (File) fgLaunchToFileMap.get(launch);
|
||||
if (temp != null){
|
||||
try {
|
||||
fgLaunchToFileMap.remove(launch);
|
||||
temp.delete();
|
||||
} finally {
|
||||
// unregister any debug listeners? there shouldn't be any
|
||||
// because we don't support debugging
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public File buildHTMLFile(ILaunchConfiguration configuration, File dir) {
|
||||
FileWriter writer = null;
|
||||
File tempFile = null;
|
||||
try {
|
||||
String name = getAppletMainTypeName(configuration);
|
||||
tempFile = new File(dir, name + System.currentTimeMillis() + ".html"); //$NON-NLS-1$
|
||||
writer = new FileWriter(tempFile);
|
||||
writer.write("<html>\n");
|
||||
writer.write("<body>\n");
|
||||
writer.write("<applet code=");
|
||||
writer.write(name);
|
||||
writer.write(".class ");
|
||||
String appletName = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_NAME, "");
|
||||
if (appletName.length() != 0) {
|
||||
writer.write("NAME =\"" + appletName + "\" ");
|
||||
}
|
||||
writer.write("width=\"");
|
||||
writer.write(Integer.toString(configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_WIDTH, 200)));
|
||||
writer.write("\" height=\"");
|
||||
writer.write(Integer.toString(configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_HEIGHT, 200)));
|
||||
writer.write("\" >\n");
|
||||
Map parameters = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_PARAMETERS, new HashMap());
|
||||
if (parameters.size() != 0) {
|
||||
Iterator iterator= parameters.entrySet().iterator();
|
||||
while(iterator.hasNext()) {
|
||||
Map.Entry next = (Map.Entry) iterator.next();
|
||||
writer.write("<param name=");
|
||||
writer.write(getQuotedString((String)next.getKey()));
|
||||
writer.write(" value=");
|
||||
writer.write(getQuotedString((String)next.getValue()));
|
||||
writer.write(">\n");
|
||||
}
|
||||
}
|
||||
writer.write("</applet>\n");
|
||||
writer.write("</body>\n");
|
||||
writer.write("</html>\n");
|
||||
} catch(IOException e) {
|
||||
} catch(CoreException e) {
|
||||
} finally {
|
||||
if (writer != null) {
|
||||
try {
|
||||
writer.close();
|
||||
} catch(IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tempFile;
|
||||
}
|
||||
|
||||
public String getQuotedString(String string) {
|
||||
if (string.indexOf('"') == -1) {
|
||||
return '"' + string + '"';
|
||||
}
|
||||
return '\'' + string + '\'';
|
||||
}
|
||||
|
||||
|
||||
/* @see org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getProgramArguments(org.eclipse.debug.core.ILaunchConfiguration) */
|
||||
public String getProgramArguments(ILaunchConfiguration configuration) throws CoreException{
|
||||
File workingDir = verifyWorkingDirectory(configuration);
|
||||
File htmlFile = buildHTMLFile(configuration, workingDir);
|
||||
if(htmlFile == null){
|
||||
abort("Could not build HTML for applet launch.", null, IJavaLaunchConfigurationConstants.ERR_COULD_NOT_BUILD_HTML);
|
||||
}
|
||||
// add a mapping of the launch to the html file
|
||||
fgLaunchToFileMap.put(fLaunch, htmlFile);
|
||||
return htmlFile.getName();
|
||||
}
|
||||
|
||||
// Uncomment if we end up using javaPolicyFile
|
||||
// public String getVMArguments(ILaunchConfiguration configuration) throws CoreException {
|
||||
// StringBuffer arguments = new StringBuffer(super.getVMArguments(configuration));
|
||||
// File workingDir = verifyWorkingDirectory(configuration);
|
||||
// String javaPolicyFile = getJavaPolicyFile(workingDir);
|
||||
// arguments.append(javaPolicyFile);
|
||||
// return arguments.toString();
|
||||
// }
|
||||
|
||||
public String getMainTypeName(ILaunchConfiguration configuration) throws CoreException{
|
||||
return configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_APPLET_APPLETVIEWER_CLASS, IJavaLaunchConfigurationConstants.DEFAULT_APPLETVIEWER_CLASS);
|
||||
}
|
||||
|
||||
/** Returns the applet's main type name. */
|
||||
public String getAppletMainTypeName(ILaunchConfiguration configuration) throws CoreException{
|
||||
return super.getMainTypeName(configuration);
|
||||
}
|
||||
|
||||
/* @see org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate#getDefaultWorkingDirectory(org.eclipse.debug.core.ILaunchConfiguration) */
|
||||
public File getDefaultWorkingDirectory(ILaunchConfiguration configuration) throws CoreException{
|
||||
// default working dir for applets is the project's output directory
|
||||
String outputDir = JavaRuntime.getProjectOutputDirectory(configuration);
|
||||
if (outputDir == null) {
|
||||
// if no project attribute, default to eclipse directory
|
||||
return new File(System.getProperty("user.dir"));
|
||||
}
|
||||
IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(outputDir);
|
||||
if (resource == null || !resource.exists()) {
|
||||
//default to eclipse directory
|
||||
return new File(System.getProperty("user.dir"));
|
||||
}
|
||||
return resource.getLocation().toFile();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,24 +2,20 @@ Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Processing Plugin User Interface Elements
|
||||
Bundle-SymbolicName: processing.plugin.ui;singleton:=true
|
||||
Bundle-Version: 0.2.1.0
|
||||
Bundle-Version: 0.2.2.0
|
||||
Bundle-Activator: processing.plugin.ui.ProcessingPlugin
|
||||
Bundle-Vendor: Processing.org
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
org.eclipse.core.filebuffers,
|
||||
org.eclipse.jdt.debug.ui,
|
||||
org.eclipse.jface.text;bundle-version="3.6.0",
|
||||
org.eclipse.ui.editors;bundle-version="3.6.0",
|
||||
org.eclipse.core.resources;bundle-version="3.6.0",
|
||||
processing.plugin.core;bundle-version="0.1.0",
|
||||
processing.plugin.core,
|
||||
org.eclipse.debug.ui,
|
||||
org.eclipse.jdt.launching;bundle-version="3.5.100",
|
||||
org.eclipse.jdt.launching,
|
||||
org.eclipse.ui.ide;bundle-version="3.6.0",
|
||||
org.eclipse.jdt.core;bundle-version="3.6.0",
|
||||
org.eclipse.ui.navigator,
|
||||
org.eclipse.ui.navigator.resources,
|
||||
org.eclipse.jdt.ui;bundle-version="3.6.0"
|
||||
org.eclipse.jdt.ui;bundle-version="3.6.0",
|
||||
org.eclipse.jdt.core,
|
||||
org.eclipse.ui.navigator;bundle-version="3.5.0"
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Import-Package: org.eclipse.ui.actions
|
||||
|
||||
@@ -164,9 +164,8 @@ public class ExportAsAppletWizard extends Wizard implements IExportWizard {
|
||||
} catch (CoreException e) {
|
||||
// This will happen when the copy fails, which we expect if there is no
|
||||
// image file. It isn't worth reporting.
|
||||
File resourceFolder = ProcessingCore.getProcessingCore().getPluginResourceFolder();
|
||||
try {
|
||||
File exportResourcesFolder = new File(resourceFolder, "export");
|
||||
File exportResourcesFolder = new File(ProcessingCore.getProcessingCore().getPluginResourceFolder().getCanonicalPath(), "export");
|
||||
File loadingImageCoreResource = new File(exportResourcesFolder, LOADING_IMAGE);
|
||||
Utilities.copyFile(loadingImageCoreResource, new File(exportFolder.getFullPath().toString(), LOADING_IMAGE));
|
||||
} catch (Exception ex) {
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<site>
|
||||
<feature url="features/processing.plugin_1.0.2.201009081624.jar" id="processing.plugin" version="1.0.2.201009081624">
|
||||
<category name="processing_plug_in"/>
|
||||
</feature>
|
||||
<feature url="features/processing.plugin_1.2.0.201009282130.jar" id="processing.plugin" version="1.2.0.201009282130">
|
||||
<feature url="features/processing.plugin_1.2.2.201010041152.jar" id="processing.plugin" version="1.2.2.201010041152">
|
||||
<category name="processing_plug_in"/>
|
||||
</feature>
|
||||
<category-def name="processing_plug_in" label="Processing Plug-in for Eclipse">
|
||||
|
||||
Reference in New Issue
Block a user