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 34743 Details for
Bug 34757
Support for other repository
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
34757_copy_extension.patch.txt
34757_copy_extension.patch.txt (text/plain), 7.83 KB, created by
Gunnar Wagenknecht
on 2006-02-15 01:52:40 EST
(
hide
)
Description:
34757_copy_extension.patch.txt
Filename:
MIME Type:
Creator:
Gunnar Wagenknecht
Created:
2006-02-15 01:52:40 EST
Size:
7.83 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.build >Index: src/org/eclipse/pde/internal/build/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/messages.properties,v >retrieving revision 1.41 >diff -u -r1.41 messages.properties >--- src/org/eclipse/pde/internal/build/messages.properties 14 Feb 2006 16:18:39 -0000 1.41 >+++ src/org/eclipse/pde/internal/build/messages.properties 15 Feb 2006 06:38:09 -0000 >@@ -29,7 +29,7 @@ > error_configWrongFormat = {0} is not a valid configuration. > error_missingCustomBuildFile = No custom build file found in {0}. > error_missingSourceFolder = In plugin {0}, the value for property {1} is not set. >-error_noCorrespondingFactory = The element {0} ca not be fetched because the necessary factory ({1}) is not available. >+error_noCorrespondingFactory = The element {0} can not be fetched because the necessary factory ({1}) is not available. > > ### exception > exception_missingElement = Unable to find element: {0}. >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.build/plugin.xml,v >retrieving revision 1.58 >diff -u -r1.58 plugin.xml >--- plugin.xml 14 Feb 2006 20:15:01 -0000 1.58 >+++ plugin.xml 15 Feb 2006 06:38:09 -0000 >@@ -96,6 +96,9 @@ > <factory > class="org.eclipse.pde.internal.build.fetch.CVSFetchTaskFactory" > id="CVS"/> >+ <factory >+ class="org.eclipse.pde.internal.build.fetch.COPYFetchTasksFactory" >+ id="COPY"/> > </extension> > > <extension >Index: src/org/eclipse/pde/internal/build/fetch/COPYFetchTasksFactory.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/build/fetch/COPYFetchTasksFactory.java >diff -N src/org/eclipse/pde/internal/build/fetch/COPYFetchTasksFactory.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/build/fetch/COPYFetchTasksFactory.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,132 @@ >+/********************************************************************** >+ * Copyright (c) 2004, 2006 Eclipse Foundation 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: >+ * Gunnar Wagenknecht - Initial API and implementation >+ * IBM - Initial API and implementation >+ **********************************************************************/ >+package org.eclipse.pde.internal.build.fetch; >+ >+import java.util.Map; >+import java.util.Properties; >+import org.eclipse.core.runtime.*; >+import org.eclipse.osgi.util.NLS; >+import org.eclipse.pde.build.IAntScript; >+import org.eclipse.pde.build.IFetchFactory; >+import org.eclipse.pde.internal.build.*; >+ >+/** >+ * An <code>IFetchFactory</code> that fetches features and plugins by >+ * copying from a specific location (id: <code>COPY</code>). >+ * <p> >+ * Map file arguments: >+ * <code><ROOT_LOCATION>[,<ELEMENT_LOCATION>]</code> >+ * <dl> >+ * <dt>ROOT_LOCATION</dt> >+ * <dd>The ROOT_LOCATION (eg. <code>/source/eclipse</code>, or >+ * <code>D:/dev/myproduct</code>) is used as root path to determine the >+ * location to fetch. It can be overwritten via the >+ * <code>fetchTag</code> to fetch from another location (for example, on a different machine).</dd> >+ * </dl> >+ * <dt>ELEMENT_LOCATION</dt> >+ * <dd>A path withing the ROOT_LOCATION (eg. >+ * <code>org.eclipse.sdk-feature/features/org.eclipse.rcp</code>) to retrive >+ * the element from if it is not within the root. If this is not provided the >+ * default path will be used which simply maps to the element name.</dd> >+ * </dl> >+ * </p> >+ */ >+public class COPYFetchTasksFactory implements IFetchFactory, IPDEBuildConstants { >+ public static final String ID = "COPY"; //$NON-NLS-1$ >+ >+ private static final String SEPARATOR = ","; //$NON-NLS-1$ >+ private static final String OVERRIDE_TAG = ID; >+ >+ //COPY specific keys used in the map being passed around. >+ private static final String KEY_PATH = "path"; //$NON-NLS-1$ >+ private static final String KEY_ROOT = "root"; //$NON-NLS-1$ >+ >+ public void generateRetrieveElementCall(Map entryInfos, IPath destination, IAntScript script) { >+ String element = (String) entryInfos.get(KEY_ELEMENT_NAME); >+ >+ // we directly copy the disc content into the destination >+ String root = (String) entryInfos.get(KEY_ROOT); >+ String path = (String) entryInfos.get(KEY_PATH); >+ IPath sourcePath = new Path(root); >+ if (path != null) { >+ sourcePath = sourcePath.append(path); >+ } else { >+ sourcePath = sourcePath.append(element); >+ } >+ >+ printCopyTask(null, destination.toString(), new String[] {sourcePath.toString()}, false, true, script); >+ } >+ >+ public void generateRetrieveFilesCall(final Map entryInfos, IPath destination, final String[] files, IAntScript script) { >+ String root = (String) entryInfos.get(KEY_ROOT); >+ String path = (String) entryInfos.get(KEY_PATH); >+ >+ for (int i = 0; i < files.length; i++) { >+ String file = files[i]; >+ IPath filePath = new Path(root); >+ if (path != null) { >+ filePath = filePath.append(path).append(file); >+ } else { >+ filePath = filePath.append((String) entryInfos.get(KEY_ELEMENT_NAME)).append(file); >+ } >+ printCopyTask(filePath.toString(), destination.toString(), null, false, true, script); >+ } >+ } >+ >+ public void addTargets(IAntScript script) { >+ // no additional targets >+ } >+ >+ public void parseMapFileEntry(String repoSpecificentry, Properties overrideTags, Map entryInfos) throws CoreException { >+ String[] arguments = Utils.getArrayFromStringWithBlank(repoSpecificentry, SEPARATOR); >+ if (arguments.length < 1) { >+ String message = NLS.bind(Messages.error_incorrectDirectoryEntry, entryInfos.get(KEY_ELEMENT_NAME)); >+ throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_ENTRY_MISSING, message, null)); >+ } >+ >+ String overrideTag = overrideTags.getProperty(OVERRIDE_TAG); >+ entryInfos.put(KEY_ROOT, (null == overrideTag || overrideTag.trim().length() == 0) ? arguments[0] : overrideTag); >+ entryInfos.put(KEY_PATH, (arguments.length > 1 && arguments[1].trim().length() > 0) ? arguments[1] : null); >+ } >+ >+ /** >+ * Print a <code>copy</code> task to the script. The source file is specified >+ * by the <code>file</code> OR the <code>dirs</code> parameter. >+ * The destination directory is specified by the <code>todir</code> parameter. >+ * @param file the source file >+ * @param todir the destination directory >+ * @param dirs the directories to copy >+ * @param overwrite indicates if existing files should be overwritten >+ * @param script the script to print to >+ */ >+ private void printCopyTask(String file, String todir, String[] dirs, boolean failOnError, boolean overwrite, IAntScript script) { >+ script.printTabs(); >+ script.print("<copy"); //$NON-NLS-1$ >+ script.printAttribute("file", file, false); //$NON-NLS-1$ >+ script.printAttribute("todir", todir, false); //$NON-NLS-1$ >+ script.printAttribute("failonerror", failOnError ? "true" : "false", true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ script.printAttribute("overwrite", overwrite ? "true" : "false", true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ >+ >+ if (dirs == null) >+ script.println("/>"); //$NON-NLS-1$ >+ else { >+ script.println(">"); //$NON-NLS-1$ >+ for (int i = 0; i < dirs.length; i++) { >+ script.printTabs(); >+ script.print("\t<fileset"); //$NON-NLS-1$ >+ script.printAttribute("dir", dirs[i], true); //$NON-NLS-1$ >+ script.println("/>"); //$NON-NLS-1$ >+ } >+ script.println("</copy>"); //$NON-NLS-1$ >+ } >+ } >+}
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 34757
:
12626
|
22206
|
30757
|
33845
|
33847
|
34178
|
34179
|
34327
|
34649
|
34650
|
34651
| 34743