Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 118687 Details for
Bug 101241
[workspace] Plugin exporter should support exporting plugins from their output folder
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch for UI side
clipboard.txt (text/plain), 7.11 KB, created by
Curtis Windatt
on 2008-11-25 14:43:46 EST
(
hide
)
Description:
Patch for UI side
Filename:
MIME Type:
Creator:
Curtis Windatt
Created:
2008-11-25 14:43:46 EST
Size:
7.11 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.build >Index: src/org/eclipse/pde/internal/build/PDEUIStateWrapper.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/PDEUIStateWrapper.java,v >retrieving revision 1.4 >diff -u -r1.4 PDEUIStateWrapper.java >--- src/org/eclipse/pde/internal/build/PDEUIStateWrapper.java 8 May 2006 15:18:35 -0000 1.4 >+++ src/org/eclipse/pde/internal/build/PDEUIStateWrapper.java 25 Nov 2008 19:37:42 -0000 >@@ -18,34 +18,41 @@ > public class PDEUIStateWrapper { > private State state; > private HashMap classpath; >+ // Map of source entries to their output folders >+ private Map outputFolders; > private Map patchData; > private long nextId; >- >+ > public void setState(State s) { > state = s; > } >- >- public void setExtraData(HashMap classpath, Map patch) { >+ >+ public void setExtraData(HashMap classpath, Map patch, Map outputFolders) { > this.classpath = classpath; > this.patchData = patch; >+ this.outputFolders = outputFolders; > } >- >+ > public State getState() { > return state; > } >- >+ > public HashMap getClasspaths() { > return classpath; > } > >+ public Map getOutputFolders() { >+ return outputFolders; >+ } >+ > public Map getPatchData() { > return patchData; > } >- >+ > public void setNextId(long nextId) { > this.nextId = nextId; > } >- >+ > public long getNextId() { > return nextId; > } >Index: src/org/eclipse/pde/internal/build/AbstractScriptGenerator.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/AbstractScriptGenerator.java,v >retrieving revision 1.64 >diff -u -r1.64 AbstractScriptGenerator.java >--- src/org/eclipse/pde/internal/build/AbstractScriptGenerator.java 31 Oct 2008 20:30:54 -0000 1.64 >+++ src/org/eclipse/pde/internal/build/AbstractScriptGenerator.java 25 Nov 2008 19:37:42 -0000 >@@ -346,9 +346,9 @@ > pdeUIState.setState(state); > } > >- public void setStateExtraData(HashMap classpath, Map patchData) { >+ public void setStateExtraData(HashMap classpath, Map patchData, Map outputFolders) { > ensurePDEUIStateNotNull(); >- pdeUIState.setExtraData(classpath, patchData); >+ pdeUIState.setExtraData(classpath, patchData, outputFolders); > } > > public void setNextId(long nextId) { >#P org.eclipse.pde.core >Index: src/org/eclipse/pde/internal/core/exports/FeatureExportOperation.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.core/src/org/eclipse/pde/internal/core/exports/FeatureExportOperation.java,v >retrieving revision 1.19 >diff -u -r1.19 FeatureExportOperation.java >--- src/org/eclipse/pde/internal/core/exports/FeatureExportOperation.java 24 Nov 2008 16:52:09 -0000 1.19 >+++ src/org/eclipse/pde/internal/core/exports/FeatureExportOperation.java 25 Nov 2008 19:37:44 -0000 >@@ -18,9 +18,10 @@ > import javax.xml.parsers.*; > import org.eclipse.ant.core.*; > import org.eclipse.core.resources.IFile; >+import org.eclipse.core.resources.IProject; > import org.eclipse.core.runtime.*; > import org.eclipse.core.runtime.jobs.Job; >-import org.eclipse.jdt.core.JavaCore; >+import org.eclipse.jdt.core.*; > import org.eclipse.jdt.launching.JavaRuntime; > import org.eclipse.jdt.launching.environments.IExecutionEnvironment; > import org.eclipse.jdt.launching.environments.IExecutionEnvironmentsManager; >@@ -505,7 +506,7 @@ > generator.setArchivesFormat(format); > generator.setPDEState(getState(os, ws, arch)); > generator.setNextId(TargetPlatformHelper.getPDEState().getNextId()); >- generator.setStateExtraData(TargetPlatformHelper.getBundleClasspaths(TargetPlatformHelper.getPDEState()), TargetPlatformHelper.getPatchMap(TargetPlatformHelper.getPDEState())); >+ generator.setStateExtraData(TargetPlatformHelper.getBundleClasspaths(TargetPlatformHelper.getPDEState()), TargetPlatformHelper.getPatchMap(TargetPlatformHelper.getPDEState()), getWorkspacePluginOutputFolders()); > AbstractScriptGenerator.setForceUpdateJar(false); > AbstractScriptGenerator.setEmbeddedSource(fInfo.exportSource); > >@@ -732,4 +733,71 @@ > } > return false; > } >+ >+ /** >+ * Returns a map containing information associating libraries to the output locations the >+ * workspace compiles them to. Uses information in the build.properties and the classpath. >+ * The map will be of the following form: >+ * String symbolic name > lib output map >+ * The lib output map will be of the following form: >+ * String lib name > Set of IPath output folders >+ * >+ * @return a map of library output folders for each plugin in the workspace >+ */ >+ protected Map getWorkspacePluginOutputFolders() throws CoreException { >+ IPluginModelBase[] models = PDECore.getDefault().getModelManager().getWorkspaceModels(); >+ Map result = new HashMap(models.length); >+ for (int i = 0; i < models.length; i++) { >+ IPath installLocation = new Path(models[i].getInstallLocation()); >+ IProject project = PDECore.getWorkspace().getRoot().getProject(installLocation.lastSegment()); >+ IFile buildFile = project.getFile("build.properties"); //$NON-NLS-1$ >+ if (buildFile.exists()) { >+ IBuildModel buildModel = new WorkspaceBuildModel(buildFile); >+ buildModel.load(); >+ IJavaProject javaProject = JavaCore.create(project); >+ if (javaProject.exists()) { >+ Map modelOutput = getPluginOutputFolders(buildModel, javaProject); >+ if (!modelOutput.isEmpty()) { >+ result.put(models[i].getBundleDescription().getSymbolicName(), modelOutput); >+ } >+ } >+ } >+ } >+ return result; >+ } >+ >+ private Map getPluginOutputFolders(IBuildModel buildModel, IJavaProject javaProject) throws JavaModelException { >+ Map outputEntries = new HashMap(); >+ >+ IBuildEntry[] buildEntries = buildModel.getBuild().getBuildEntries(); >+ for (int i = 0; i < buildEntries.length; i++) { >+ String name = buildEntries[i].getName(); >+ if (name.startsWith(IBuildPropertiesConstants.PROPERTY_SOURCE_PREFIX)) { >+ Set outputPaths = new HashSet(); >+ >+ String[] sourceFolders = buildEntries[i].getTokens(); >+ for (int j = 0; j < sourceFolders.length; j++) { >+ >+ IClasspathEntry[] classpathEntries = javaProject.getRawClasspath(); >+ for (int k = 0; k < classpathEntries.length; k++) { >+ if (classpathEntries[k].getEntryKind() == IClasspathEntry.CPE_SOURCE) { >+ IPath sourcePath = classpathEntries[k].getPath().removeFirstSegments(1); // Entries include project as first segment >+ if (sourcePath.equals(new Path(sourceFolders[i]))) { >+ IPath outputPath = classpathEntries[k].getOutputLocation(); >+ if (outputPath == null) { >+ outputPath = javaProject.getOutputLocation(); >+ } >+ outputPaths.add(outputPath.removeFirstSegments(1)); // Entries include project as first segment >+ } >+ } >+ } >+ } >+ if (!outputPaths.isEmpty()) { >+ outputEntries.put(name.substring(IBuildPropertiesConstants.PROPERTY_SOURCE_PREFIX.length()), outputPaths); >+ } >+ } >+ } >+ return outputEntries; >+ } >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 101241
:
118687
|
118688
|
118729
|
119441
|
119442
|
119551