Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 243582 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/build/Constants.java (-4 / +24 lines)
Lines 9-15 Link Here
9
 *     Gunnar Wagenknecht - Initial API and implementation
9
 *     Gunnar Wagenknecht - Initial API and implementation
10
 *     IBM Corporation - Initial API and implementation
10
 *     IBM Corporation - Initial API and implementation
11
 **********************************************************************/
11
 **********************************************************************/
12
 package org.eclipse.pde.build;
12
package org.eclipse.pde.build;
13
13
14
/**
14
/**
15
 * Constants for the files usually manipulated by the fetch factory.
15
 * Constants for the files usually manipulated by the fetch factory.
Lines 19-31 Link Here
19
public interface Constants {
19
public interface Constants {
20
	/** Constant for the string <code>feature.xml</code> */
20
	/** Constant for the string <code>feature.xml</code> */
21
	public final static String FEATURE_FILENAME_DESCRIPTOR = "feature.xml"; //$NON-NLS-1$
21
	public final static String FEATURE_FILENAME_DESCRIPTOR = "feature.xml"; //$NON-NLS-1$
22
	
22
23
	/** Constant for the string <code>fragment.xml</code> */
23
	/** Constant for the string <code>fragment.xml</code> */
24
	public final static String FRAGMENT_FILENAME_DESCRIPTOR = "fragment.xml"; //$NON-NLS-1$
24
	public final static String FRAGMENT_FILENAME_DESCRIPTOR = "fragment.xml"; //$NON-NLS-1$
25
	
25
26
	/** Constant for the string <code>plugin.xml</code> */
26
	/** Constant for the string <code>plugin.xml</code> */
27
	public final static String PLUGIN_FILENAME_DESCRIPTOR = "plugin.xml"; //$NON-NLS-1$
27
	public final static String PLUGIN_FILENAME_DESCRIPTOR = "plugin.xml"; //$NON-NLS-1$
28
	
28
29
	/** Constant for the string <code>META-INF/MANIFEST.MF</code> */
29
	/** Constant for the string <code>META-INF/MANIFEST.MF</code> */
30
	public final static String BUNDLE_FILENAME_DESCRIPTOR = "META-INF/MANIFEST.MF"; //$NON-NLS-1$
30
	public final static String BUNDLE_FILENAME_DESCRIPTOR = "META-INF/MANIFEST.MF"; //$NON-NLS-1$
31
32
	/**
33
	 * Key used to store the value of an <code>org.eclipse.team.core.repository</code> extension
34
	 * identifier that provides a project set capability that can interpret project references 
35
	 * generated by a fetch factory.
36
	 * 
37
	 * @since 3.6
38
	 * @see IFetchFactory
39
	 */
40
	public static final String KEY_REPOSITORY_PROVIDER_ID = "repositoryId"; //$NON-NLS-1$
41
42
	/**
43
	 * Key used to store the value of a project reference that can be interpreted by an
44
	 * associated repository provider's project set capability to recreate a project
45
	 * in a workspace.
46
	 * 
47
	 * @since 3.6
48
	 * @see IFetchFactory
49
	 */
50
	public static final String KEY_PROJECT_REFERENCE = "projectReference"; //$NON-NLS-1$
31
}
51
}
(-)src/org/eclipse/pde/build/IFetchFactory.java (+2 lines)
Lines 91-96 Link Here
91
	 * to fetch the element. This value is for example used to generate the "qualifier" value of a version number. 
91
	 * to fetch the element. This value is for example used to generate the "qualifier" value of a version number. 
92
	 * Note that {@link #KEY_ELEMENT_NAME} and {@link #KEY_ELEMENT_TYPE} are reserved entries whose values respectively 
92
	 * Note that {@link #KEY_ELEMENT_NAME} and {@link #KEY_ELEMENT_TYPE} are reserved entries whose values respectively 
93
	 * refer to the name of the element being fetched and its type.
93
	 * refer to the name of the element being fetched and its type.
94
	 * Since 3.6, factories may optionally set {@link Constants#KEY_REPOSITORY_PROVIDER_ID} and {@link Constants#KEY_PROJECT_REFERENCE}
95
	 * to support the inclusion of project references in a bundle manifest. 
94
	 * @throws CoreException if the rawEntry is incorrect.
96
	 * @throws CoreException if the rawEntry is incorrect.
95
	 */
97
	 */
96
	public void parseMapFileEntry(String rawEntry, Properties overrideTags, Map entryInfos) throws CoreException;
98
	public void parseMapFileEntry(String rawEntry, Properties overrideTags, Map entryInfos) throws CoreException;
(-)src/org/eclipse/pde/internal/build/fetch/CVSFetchTaskFactory.java (+42 lines)
Lines 59-64 Link Here
59
	private static final String PROP_FILETOCHECK = "fileToCheck"; //$NON-NLS-1$
59
	private static final String PROP_FILETOCHECK = "fileToCheck"; //$NON-NLS-1$
60
	private static final String PROP_ELEMENTNAME = "elementName"; //$NON-NLS-1$
60
	private static final String PROP_ELEMENTNAME = "elementName"; //$NON-NLS-1$
61
61
62
	//Associated repository provider
63
	private static final String CVS_ID = "org.eclipse.team.cvs.core.cvsnature"; //$NON-NLS-1$
64
62
	private void generateAuthentificationAntTask(Map entryInfos, IAntScript script) {
65
	private void generateAuthentificationAntTask(Map entryInfos, IAntScript script) {
63
		String password = (String) entryInfos.get(KEY_PASSWORD);
66
		String password = (String) entryInfos.get(KEY_PASSWORD);
64
		String cvsPassFileLocation = (String) entryInfos.get(KEY_CVSPASSFILE);
67
		String cvsPassFileLocation = (String) entryInfos.get(KEY_CVSPASSFILE);
Lines 180-185 Link Here
180
			int index = arg.indexOf('=');
183
			int index = arg.indexOf('=');
181
			if (index == -1) {
184
			if (index == -1) {
182
				legacyParseMapFileEntry(arguments, overrideTags, entryInfos);
185
				legacyParseMapFileEntry(arguments, overrideTags, entryInfos);
186
				addProjectReference(entryInfos);
183
				return;
187
				return;
184
			}
188
			}
185
			String key = arg.substring(0, index);
189
			String key = arg.substring(0, index);
Lines 197-202 Link Here
197
		entryInfos.put(KEY_PASSWORD, table.get(KEY_PASSWORD));
201
		entryInfos.put(KEY_PASSWORD, table.get(KEY_PASSWORD));
198
		entryInfos.put(KEY_PATH, table.get(KEY_PATH));
202
		entryInfos.put(KEY_PATH, table.get(KEY_PATH));
199
		entryInfos.put(KEY_PREBUILT, table.get(KEY_PREBUILT));
203
		entryInfos.put(KEY_PREBUILT, table.get(KEY_PREBUILT));
204
		addProjectReference(entryInfos);
205
	}
206
207
	private void addProjectReference(Map entryInfos) {
208
		String repoLocation = (String) entryInfos.get(KEY_CVSROOT);
209
		String module = (String) entryInfos.get(KEY_PATH);
210
		String projectName = (String) entryInfos.get(KEY_ELEMENT_NAME);
211
		String tag = (String) entryInfos.get(IFetchFactory.KEY_ELEMENT_TAG);
212
		if (repoLocation != null && module != null && projectName != null) {
213
			entryInfos.put(Constants.KEY_REPOSITORY_PROVIDER_ID, CVS_ID);
214
			entryInfos.put(Constants.KEY_PROJECT_REFERENCE, asReference(repoLocation, module, projectName, tag));
215
		}
216
	}
217
218
	/**
219
	 * Creates a project reference memento.
220
	 * 
221
	 * @param repoLocation
222
	 * @param module
223
	 * @param projectName
224
	 * @return project reference string
225
	 */
226
	private String asReference(String repoLocation, String module, String projectName, String tagName) {
227
		StringBuffer buffer = new StringBuffer();
228
		buffer.append("1.0,"); //$NON-NLS-1$
229
230
		buffer.append(repoLocation);
231
		buffer.append(","); //$NON-NLS-1$
232
233
		buffer.append(module);
234
		buffer.append(","); //$NON-NLS-1$
235
236
		buffer.append(projectName);
237
		if (tagName != null) {
238
			buffer.append(","); //$NON-NLS-1$
239
			buffer.append(tagName);
240
		}
241
		return buffer.toString();
200
	}
242
	}
201
243
202
	/**
244
	/**

Return to bug 243582