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 160008 Details for
Bug 243582
Support embedding repository information in released bundles
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]
updated patch
243582.txt (text/plain), 23.06 KB, created by
Andrew Niefer
on 2010-02-23 17:45:47 EST
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Andrew Niefer
Created:
2010-02-23 17:45:47 EST
Size:
23.06 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.build >Index: src/org/eclipse/pde/build/Constants.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/build/Constants.java,v >retrieving revision 1.4 >diff -u -r1.4 Constants.java >--- src/org/eclipse/pde/build/Constants.java 4 Jun 2008 17:24:32 -0000 1.4 >+++ src/org/eclipse/pde/build/Constants.java 23 Feb 2010 22:39:57 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2006 Eclipse Foundation and others. >+ * Copyright (c) 2006, 2010 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 >@@ -9,7 +9,7 @@ > * Gunnar Wagenknecht - Initial API and implementation > * IBM Corporation - Initial API and implementation > **********************************************************************/ >- package org.eclipse.pde.build; >+package org.eclipse.pde.build; > > /** > * Constants for the files usually manipulated by the fetch factory. >@@ -19,13 +19,50 @@ > public interface Constants { > /** Constant for the string <code>feature.xml</code> */ > public final static String FEATURE_FILENAME_DESCRIPTOR = "feature.xml"; //$NON-NLS-1$ >- >+ > /** Constant for the string <code>fragment.xml</code> */ > public final static String FRAGMENT_FILENAME_DESCRIPTOR = "fragment.xml"; //$NON-NLS-1$ >- >+ > /** Constant for the string <code>plugin.xml</code> */ > public final static String PLUGIN_FILENAME_DESCRIPTOR = "plugin.xml"; //$NON-NLS-1$ >- >+ > /** Constant for the string <code>META-INF/MANIFEST.MF</code> */ > public final static String BUNDLE_FILENAME_DESCRIPTOR = "META-INF/MANIFEST.MF"; //$NON-NLS-1$ >+ >+ /** >+ * Key used to specify directives for the {@link #KEY_SOURCE_REFERENCE}. >+ * >+ * For {@link #KEY_SOURCE_REFERENCE_TYPE} == "psf", a "provider" directive is required specifying the value of >+ * an <code>org.eclipse.team.core.repository</code> extension identifier that provides a project set >+ * capability that can interpret the project reference. >+ * <p> >+ * Example: KEY_SOURCE_DIRECTIVES = "provider:=\"org.eclipse.team.cvs.core.cvsnature\"" >+ * </p> >+ * >+ * @since 3.6 >+ * @see IFetchFactory >+ */ >+ public static final String KEY_SOURCE_DIRECTIVES = "sourceDirectives"; //$NON-NLS-1$ >+ >+ /** >+ * Key used to store the value of a project reference in the Eclipse-SourceReferences manifest >+ * header. >+ * >+ * @since 3.6 >+ * @see IFetchFactory >+ */ >+ public static final String KEY_SOURCE_REFERENCE = "sourceReference"; //$NON-NLS-1$ >+ >+ /** >+ * Key used to store the type of the project reference {@link #KEY_SOURCE_REFERENCE} >+ * >+ * A type of "psf" is interpreted as repository provider's project set capability to recreate a project >+ * in a workspace. The "psf" reference type requires a {@link #KEY_SOURCE_DIRECTIVES} specifying a "provider" >+ * directive indicating the provider of the project set capability. >+ * >+ * @since 3.6 >+ * @see IFetchFactory >+ * @see #KEY_SOURCE_DIRECTIVES >+ */ >+ public static final String KEY_SOURCE_REFERENCE_TYPE = "sourceReferenceType"; //$NON-NLS-1$ > } >Index: src/org/eclipse/pde/build/IFetchFactory.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/build/IFetchFactory.java,v >retrieving revision 1.5 >diff -u -r1.5 IFetchFactory.java >--- src/org/eclipse/pde/build/IFetchFactory.java 4 Dec 2009 20:55:45 -0000 1.5 >+++ src/org/eclipse/pde/build/IFetchFactory.java 23 Feb 2010 22:39:57 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2004, 2006 Eclipse Foundation and others. >+ * Copyright (c) 2004, 2010 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 >@@ -82,7 +82,15 @@ > * infos should be filled with provider specific information that is > * required in later processing to sucessfully generate the fetch script. > * </p> >- * >+ * <p> >+ * Since 3.6, factories may optionally set {@link Constants#KEY_SOURCE_REFERENCE}, {@link Constants#KEY_SOURCE_REFERENCE_TYPE}, and >+ * {@link Constants#KEY_SOURCE_DIRECTIVES} properties in the entry infos map to support the inclusion of source references in the bundle >+ * manifest using the Eclipse-SourceRefernces header.<br> >+ * Example:<br> >+ * KEY_SOURCE_REFERENCE_TYPE = "psf"<br> >+ * KEY_SOURCE_DIRECTIVES = "provider:=\"org.eclipse.team.cvs.core.cvsnature\""<br> >+ * KEY_SOURCE_REFERENCE = "1.0,:extssh:dev.eclipse.org:/cvsroot/eclipse,pde/build/org.eclipse.pde.build,org.eclipse.pde.build,v20100222"<br> >+ * </p> > * @param rawEntry the arguments as specified in the map file (may not be <code>null</code>). > * @param overrideTags a key / value containing all the override tags specified for all the repository (maybe <code>null</code> or empty). > * The values of this map of this are read from the fetchTag property (see file scripts/templates/headless-build/build.properties). >Index: src/org/eclipse/pde/internal/build/FetchScriptGenerator.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/FetchScriptGenerator.java,v >retrieving revision 1.72 >diff -u -r1.72 FetchScriptGenerator.java >--- src/org/eclipse/pde/internal/build/FetchScriptGenerator.java 16 Feb 2010 21:40:07 -0000 1.72 >+++ src/org/eclipse/pde/internal/build/FetchScriptGenerator.java 23 Feb 2010 22:39:57 -0000 >@@ -62,6 +62,7 @@ > // A property table containing the association between the plugins and the version from the map > protected Properties repositoryPluginTags = new Properties(); > protected Properties repositoryFeatureTags = new Properties(); >+ protected Properties sourceReferences = new Properties(); > > //The registry of the task factories > private FetchTaskFactoriesRegistry fetchTaskFactories; >@@ -156,6 +157,7 @@ > private void saveRepositoryTags() throws CoreException { > saveRepositoryTags(repositoryPluginTags, DEFAULT_PLUGIN_REPOTAG_FILENAME_DESCRIPTOR); > saveRepositoryTags(repositoryFeatureTags, DEFAULT_FEATURE_REPOTAG_FILENAME_DESCRIPTOR); >+ saveRepositoryTags(sourceReferences, DEFAULT_SOURCE_REFERENCES_FILENAME_DESCRIPTOR); > } > > /** >@@ -362,6 +364,12 @@ > factory.generateRetrieveFilesCall(mapFileEntry, computeFinalLocation(type, elementToFetch, (Version) mapFileEntry.get(MATCHED_VERSION)), files, script); > } > >+ //key to use for version and source references properties files >+ String key = null; >+ if (version.getQualifier().endsWith(PROPERTY_QUALIFIER)) >+ key = QualifierReplacer.getQualifierKey(elementToFetch, version.toString()); >+ else >+ key = elementToFetch + ',' + new Version(version.getMajor(), version.getMinor(), version.getMicro()).toString(); > //Keep track of the element that are being fetched. To simplify the lookup in the qualifier replacer, the versioned that was initially looked up is used as key in the file > Properties tags = null; > if (type.equals(IFetchFactory.ELEMENT_TYPE_FEATURE)) >@@ -369,12 +377,21 @@ > else > tags = repositoryPluginTags; > if (mapFileEntry.get(IFetchFactory.KEY_ELEMENT_TAG) != null) { >- if (version.getQualifier().endsWith(PROPERTY_QUALIFIER)) { >- String key = QualifierReplacer.getQualifierKey(elementToFetch, version.toString()); >- tags.put(key, mapFileEntry.get(IFetchFactory.KEY_ELEMENT_TAG)); >- } else { >- tags.put(elementToFetch + ',' + new Version(version.getMajor(), version.getMinor(), version.getMicro()), mapFileEntry.get(IFetchFactory.KEY_ELEMENT_TAG)); >+ tags.put(key, mapFileEntry.get(IFetchFactory.KEY_ELEMENT_TAG)); >+ } >+ >+ if (mapFileEntry.get(Constants.KEY_SOURCE_REFERENCE) != null) { >+ StringBuffer buffer = new StringBuffer((String) mapFileEntry.get(Constants.KEY_SOURCE_REFERENCE)); >+ if (mapFileEntry.get(Constants.KEY_SOURCE_REFERENCE_TYPE) != null) { >+ buffer.append(";type:="); //$NON-NLS-1$ >+ buffer.append(mapFileEntry.get(Constants.KEY_SOURCE_REFERENCE_TYPE)); >+ } >+ if (mapFileEntry.get(Constants.KEY_SOURCE_DIRECTIVES) != null) { >+ buffer.append(';'); >+ buffer.append(mapFileEntry.get(Constants.KEY_SOURCE_DIRECTIVES)); > } >+ >+ sourceReferences.put(key, buffer.toString()); > } > > return true; >Index: src/org/eclipse/pde/internal/build/IBuildPropertiesConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/IBuildPropertiesConstants.java,v >retrieving revision 1.53 >diff -u -r1.53 IBuildPropertiesConstants.java >--- src/org/eclipse/pde/internal/build/IBuildPropertiesConstants.java 21 Jan 2010 16:41:31 -0000 1.53 >+++ src/org/eclipse/pde/internal/build/IBuildPropertiesConstants.java 23 Feb 2010 22:39:57 -0000 >@@ -34,6 +34,7 @@ > public static final String PROPERTY_MANIFEST_PREFIX = "manifest."; //$NON-NLS-1$ > > public static final String PROPERTY_CONVERTED_MANIFEST = "convertedManifest"; //$NON-NLS-1$ >+ public static final String PROPERTY_SOURCE_REFERENCE = "sourceReference"; //$NON-NLS-1$ > public static final String PROPERTY_QUALIFIER = "qualifier"; //$NON-NLS-1$ > public static final String PROPERTY_VERSION_REPLACEMENT = "versionReplacement"; //$NON-NLS-1$ > public static final String PROPERTY_REQUIRED_BUNDLE_IDS = "requiredBundleIds"; //$NON-NLS-1$ >Index: src/org/eclipse/pde/internal/build/IPDEBuildConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/IPDEBuildConstants.java,v >retrieving revision 1.51 >diff -u -r1.51 IPDEBuildConstants.java >--- src/org/eclipse/pde/internal/build/IPDEBuildConstants.java 19 Aug 2009 19:43:01 -0000 1.51 >+++ src/org/eclipse/pde/internal/build/IPDEBuildConstants.java 23 Feb 2010 22:39:57 -0000 >@@ -58,6 +58,7 @@ > public final static String DEFAULT_UNZIPPER_FILENAME_DESCRIPTOR = "unzipper.xml"; //$NON-NLS-1$ > public final static String DEFAULT_PLUGIN_REPOTAG_FILENAME_DESCRIPTOR = "pluginVersions.properties"; //$NON-NLS-1$ > public final static String DEFAULT_FEATURE_REPOTAG_FILENAME_DESCRIPTOR = "featureVersions.properties"; //$NON-NLS-1$ >+ public final static String DEFAULT_SOURCE_REFERENCES_FILENAME_DESCRIPTOR = "sourceReferences.properties"; //$NON-NLS-1$ > public final static String DEFAULT_PLUGINS_POSTPROCESSINGSTEPS_FILENAME_DESCRIPTOR = "plugins.postProcessingSteps.properties"; //$NON-NLS-1$ > public final static String DEFAULT_FEATURES_POSTPROCESSINGSTEPS_FILENAME_DESCRIPTOR = "features.postProcessingSteps.properties"; //$NON-NLS-1$ > public final static String DEFAULT_CUSTOM_BUILD_CALLBACKS_FILE = "customBuildCallbacks.xml"; //$NON-NLS-1$ >@@ -120,6 +121,7 @@ > public final static String ECLIPSE_SOURCE_BUNDLE = "Eclipse-SourceBundle"; //$NON-NLS-1$ > public final static String ECLIPSE_PLATFORM_FILTER = "Eclipse-PlatformFilter"; //$NON-NLS-1$ > public final static String ECLIPSE_BUNDLE_SHAPE = "Eclipse-BundleShape"; //$NON-NLS-1$ >+ public final static String ECLIPSE_SOURCE_REFERENCES = "Eclipse-SourceReferences"; //$NON-NLS-1$ > > //Some Bundle IDs we care about > public final static String BUNDLE_OSGI = "org.eclipse.osgi"; //$NON-NLS-1$ >Index: src/org/eclipse/pde/internal/build/builder/ModelBuildScriptGenerator.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/builder/ModelBuildScriptGenerator.java,v >retrieving revision 1.138 >diff -u -r1.138 ModelBuildScriptGenerator.java >--- src/org/eclipse/pde/internal/build/builder/ModelBuildScriptGenerator.java 17 Feb 2010 20:14:30 -0000 1.138 >+++ src/org/eclipse/pde/internal/build/builder/ModelBuildScriptGenerator.java 23 Feb 2010 22:39:57 -0000 >@@ -791,9 +791,17 @@ > return; > > String qualifier = bundleProperties.getProperty(PROPERTY_QUALIFIER); >- if (qualifier == null) >+ String sourceReference = bundleProperties.getProperty(PROPERTY_SOURCE_REFERENCE); >+ if (qualifier == null && sourceReference == null) > return; >- script.println("<eclipse.versionReplacer path=\"" + AntScript.getEscaped(location) + "\" version=\"" + model.getVersion() + "\"/>"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ >+ >+ Map arguments = new HashMap(); >+ arguments.put("path", AntScript.getEscaped(location)); //$NON-NLS-1$ >+ if (qualifier != null) >+ arguments.put("version", model.getVersion().toString()); //$NON-NLS-1$ >+ if (sourceReference != null) >+ arguments.put("attributes", ECLIPSE_SOURCE_REFERENCES + '|' + sourceReference); //$NON-NLS-1$ >+ script.printElement("eclipse.versionReplacer", arguments); //$NON-NLS-1$ > } > > private void generatePermissionProperties(String directory) throws CoreException { >Index: src/org/eclipse/pde/internal/build/fetch/CVSFetchTaskFactory.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/fetch/CVSFetchTaskFactory.java,v >retrieving revision 1.14 >diff -u -r1.14 CVSFetchTaskFactory.java >--- src/org/eclipse/pde/internal/build/fetch/CVSFetchTaskFactory.java 25 May 2009 15:45:36 -0000 1.14 >+++ src/org/eclipse/pde/internal/build/fetch/CVSFetchTaskFactory.java 23 Feb 2010 22:39:57 -0000 >@@ -59,6 +59,10 @@ > private static final String PROP_FILETOCHECK = "fileToCheck"; //$NON-NLS-1$ > private static final String PROP_ELEMENTNAME = "elementName"; //$NON-NLS-1$ > >+ //Associated repository provider >+ private static final String PSF = "psf"; //$NON-NLS-1$ >+ private static final String CVS_DIRECTIVE = "provider:=\"org.eclipse.team.cvs.core.cvsnature\""; //$NON-NLS-1$ >+ > private void generateAuthentificationAntTask(Map entryInfos, IAntScript script) { > String password = (String) entryInfos.get(KEY_PASSWORD); > String cvsPassFileLocation = (String) entryInfos.get(KEY_CVSPASSFILE); >@@ -139,7 +143,7 @@ > String tag = (String) entryInfos.get(IFetchFactory.KEY_ELEMENT_TAG); > String cvsRoot = (String) entryInfos.get(KEY_CVSROOT); > String dest = "true".equalsIgnoreCase((String) entryInfos.get(KEY_PREBUILT)) ? destination.removeLastSegments(1).toString() : destination.toString(); //$NON-NLS-1$ >- printCVSTask("export -r " + tag + ' ' + filePath.toString(), cvsRoot, dest, null, null, "true", Utils.getPropertyFormat(PROP_REALLYQUIET), null, null, "${fetch.failonerror}", script); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-5$ >+ printCVSTask("export -r " + tag + ' ' + filePath.toString(), cvsRoot, dest, null, null, "true", Utils.getPropertyFormat(PROP_REALLYQUIET), null, null, "${fetch.failonerror}", script); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ > script.println("<move file=\"" + destination + '/' + filePath + "\"" + " tofile=\"" + destination.append(file) + "\" failonerror=\"false\" />"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ > } > } >@@ -180,6 +184,7 @@ > int index = arg.indexOf('='); > if (index == -1) { > legacyParseMapFileEntry(arguments, overrideTags, entryInfos); >+ addProjectReference(entryInfos); > return; > } > String key = arg.substring(0, index); >@@ -197,6 +202,45 @@ > entryInfos.put(KEY_PASSWORD, table.get(KEY_PASSWORD)); > entryInfos.put(KEY_PATH, table.get(KEY_PATH)); > entryInfos.put(KEY_PREBUILT, table.get(KEY_PREBUILT)); >+ addProjectReference(entryInfos); >+ } >+ >+ private void addProjectReference(Map entryInfos) { >+ String repoLocation = (String) entryInfos.get(KEY_CVSROOT); >+ String module = (String) entryInfos.get(KEY_PATH); >+ String projectName = (String) entryInfos.get(KEY_ELEMENT_NAME); >+ String tag = (String) entryInfos.get(IFetchFactory.KEY_ELEMENT_TAG); >+ if (repoLocation != null && module != null && projectName != null) { >+ entryInfos.put(Constants.KEY_SOURCE_REFERENCE_TYPE, PSF); >+ entryInfos.put(Constants.KEY_SOURCE_DIRECTIVES, CVS_DIRECTIVE); >+ entryInfos.put(Constants.KEY_SOURCE_REFERENCE, asReference(repoLocation, module, projectName, tag)); >+ } >+ } >+ >+ /** >+ * Creates a project reference memento. >+ * >+ * @param repoLocation >+ * @param module >+ * @param projectName >+ * @return project reference string >+ */ >+ private String asReference(String repoLocation, String module, String projectName, String tagName) { >+ StringBuffer buffer = new StringBuffer(); >+ buffer.append("1.0,"); //$NON-NLS-1$ >+ >+ buffer.append(repoLocation); >+ buffer.append(","); //$NON-NLS-1$ >+ >+ buffer.append(module); >+ buffer.append(","); //$NON-NLS-1$ >+ >+ buffer.append(projectName); >+ if (tagName != null) { >+ buffer.append(","); //$NON-NLS-1$ >+ buffer.append(tagName); >+ } >+ return buffer.toString(); > } > > /** >Index: src/org/eclipse/pde/internal/build/site/PDEState.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/site/PDEState.java,v >retrieving revision 1.85 >diff -u -r1.85 PDEState.java >--- src/org/eclipse/pde/internal/build/site/PDEState.java 23 Sep 2009 19:52:26 -0000 1.85 >+++ src/org/eclipse/pde/internal/build/site/PDEState.java 23 Feb 2010 22:39:57 -0000 >@@ -26,12 +26,13 @@ > > // This class provides a higher level API on the state > public class PDEState implements IPDEBuildConstants, IBuildPropertiesConstants { >- private static final String[] MANIFEST_ENTRIES = {Constants.BUNDLE_LOCALIZATION, Constants.BUNDLE_NAME, Constants.BUNDLE_VENDOR, ECLIPSE_BUNDLE_SHAPE, ECLIPSE_SOURCE_BUNDLE}; >+ private static final String[] MANIFEST_ENTRIES = {Constants.BUNDLE_LOCALIZATION, Constants.BUNDLE_NAME, Constants.BUNDLE_VENDOR, ECLIPSE_BUNDLE_SHAPE, ECLIPSE_SOURCE_BUNDLE, ECLIPSE_SOURCE_REFERENCES}; > > private StateObjectFactory factory; > protected State state; > private long id; > private Properties repositoryVersions; >+ private Properties sourceReferences; > private HashMap bundleClasspaths; > private ProfileManager profileManager; > private Map patchBundles; >@@ -68,6 +69,7 @@ > patchBundles = new HashMap(); > convertedManifests = new HashSet(2); > loadPluginTagFile(); >+ loadSourceReferences(); > } > > public StateObjectFactory getFactory() { >@@ -84,7 +86,7 @@ > > //Add a bundle to the state, updating the version number > public boolean addBundle(Dictionary enhancedManifest, File bundleLocation) { >- updateVersionNumber(enhancedManifest); >+ String oldVersion = updateVersionNumber(enhancedManifest); > try { > BundleDescription descriptor; > descriptor = factory.createBundleDescription(state, enhancedManifest, bundleLocation.getAbsolutePath(), getNextId()); >@@ -95,6 +97,7 @@ > rememberQualifierTagPresence(descriptor); > rememberManifestConversion(descriptor, enhancedManifest); > rememberManifestEntries(descriptor, enhancedManifest, MANIFEST_ENTRIES); >+ rememberSourceReference(descriptor, oldVersion); > if (addBundleDescription(descriptor) == true && addedBundle != null) > addedBundle.add(descriptor); > } catch (BundleException e) { >@@ -115,6 +118,18 @@ > bundleProperties.setProperty(PROPERTY_QUALIFIER, "marker"); //$NON-NLS-1$ > } > >+ private void rememberSourceReference(BundleDescription descriptor, String oldVersion) { >+ String key = QualifierReplacer.getQualifierKey(descriptor.getSymbolicName(), oldVersion); >+ if (key != null && sourceReferences != null && sourceReferences.containsKey(key)) { >+ Properties bundleProperties = (Properties) descriptor.getUserObject(); >+ if (bundleProperties == null) { >+ bundleProperties = new Properties(); >+ descriptor.setUserObject(bundleProperties); >+ } >+ bundleProperties.setProperty(PROPERTY_SOURCE_REFERENCE, sourceReferences.getProperty(key)); >+ } >+ } >+ > private void rememberManifestEntries(BundleDescription descriptor, Dictionary manifest, String[] entries) { > if (entries == null || entries.length == 0) > return; >@@ -181,6 +196,20 @@ > } > } > >+ private void loadSourceReferences() { >+ sourceReferences = new Properties(); >+ try { >+ InputStream input = new BufferedInputStream(new FileInputStream(AbstractScriptGenerator.getWorkingDirectory() + '/' + DEFAULT_SOURCE_REFERENCES_FILENAME_DESCRIPTOR)); >+ try { >+ sourceReferences.load(input); >+ } finally { >+ input.close(); >+ } >+ } catch (IOException e) { >+ //Ignore >+ } >+ } >+ > public boolean addBundle(File bundleLocation) { > Dictionary manifest; > manifest = loadManifest(bundleLocation); >@@ -194,20 +223,23 @@ > return addBundle(manifest, bundleLocation); > } > >- private void updateVersionNumber(Dictionary manifest) { >+ private String updateVersionNumber(Dictionary manifest) { > String newVersion = null; >+ String oldVersion = null; > try { > String symbolicName = (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME); > if (symbolicName == null) >- return; >+ return null; > > symbolicName = ManifestElement.parseHeader(Constants.BUNDLE_SYMBOLICNAME, symbolicName)[0].getValue(); >- newVersion = QualifierReplacer.replaceQualifierInVersion((String) manifest.get(Constants.BUNDLE_VERSION), symbolicName, (String) manifest.get(PROPERTY_QUALIFIER), repositoryVersions); >+ oldVersion = (String) manifest.get(Constants.BUNDLE_VERSION); >+ newVersion = QualifierReplacer.replaceQualifierInVersion(oldVersion, symbolicName, (String) manifest.get(PROPERTY_QUALIFIER), repositoryVersions); > } catch (BundleException e) { > //ignore > } > if (newVersion != null) > manifest.put(Constants.BUNDLE_VERSION, newVersion); >+ return oldVersion; > } > > /** >Index: src_ant/org/eclipse/pde/internal/build/tasks/GenericVersionReplacer.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/build/org.eclipse.pde.build/src_ant/org/eclipse/pde/internal/build/tasks/GenericVersionReplacer.java,v >retrieving revision 1.11 >diff -u -r1.11 GenericVersionReplacer.java >--- src_ant/org/eclipse/pde/internal/build/tasks/GenericVersionReplacer.java 25 May 2009 15:45:36 -0000 1.11 >+++ src_ant/org/eclipse/pde/internal/build/tasks/GenericVersionReplacer.java 23 Feb 2010 22:39:57 -0000 >@@ -24,6 +24,7 @@ > private static final String MANIFEST = "META-INF/MANIFEST.MF"; //$NON-NLS-1$ > private String rootPath; > private String version; >+ private String attributes; > > public void execute() { > File root = new File(rootPath); >@@ -58,6 +59,8 @@ > modifier.setProject(getProject()); > modifier.setManifestLocation(path); > modifier.setKeyValue("Bundle-Version|" + version); //$NON-NLS-1$ >+ if (attributes != null) >+ modifier.setKeyValue(attributes); > modifier.execute(); > } > >@@ -76,4 +79,8 @@ > public void setVersion(String version) { > this.version = version; > } >+ >+ public void setAttributes(String attributes) { >+ this.attributes = attributes; >+ } > }
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 243582
:
158774
| 160008 |
160150
|
160528
|
160673
|
160676
|
160857