|
Lines 10-21
Link Here
|
| 10 |
**********************************************************************/ |
10 |
**********************************************************************/ |
| 11 |
package org.eclipse.pde.internal.build; |
11 |
package org.eclipse.pde.internal.build; |
| 12 |
|
12 |
|
| 13 |
import java.io.*; |
13 |
import java.io.BufferedInputStream; |
| 14 |
import java.util.*; |
14 |
import java.io.BufferedOutputStream; |
|
|
15 |
import java.io.File; |
| 16 |
import java.io.FileInputStream; |
| 17 |
import java.io.FileOutputStream; |
| 18 |
import java.io.IOException; |
| 19 |
import java.io.InputStream; |
| 20 |
import java.io.OutputStream; |
| 21 |
import java.util.ArrayList; |
| 22 |
import java.util.HashMap; |
| 23 |
import java.util.List; |
| 24 |
import java.util.Map; |
| 25 |
import java.util.Properties; |
| 26 |
|
| 15 |
import org.eclipse.ant.core.AntRunner; |
27 |
import org.eclipse.ant.core.AntRunner; |
| 16 |
import org.eclipse.core.runtime.*; |
28 |
import org.eclipse.core.runtime.CoreException; |
|
|
29 |
import org.eclipse.core.runtime.IPath; |
| 30 |
import org.eclipse.core.runtime.IStatus; |
| 31 |
import org.eclipse.core.runtime.Path; |
| 32 |
import org.eclipse.core.runtime.Status; |
| 17 |
import org.eclipse.pde.internal.build.ant.AntScript; |
33 |
import org.eclipse.pde.internal.build.ant.AntScript; |
| 18 |
import org.eclipse.update.core.*; |
34 |
import org.eclipse.pde.internal.build.ant.ITask; |
|
|
35 |
import org.eclipse.update.core.Feature; |
| 36 |
import org.eclipse.update.core.IFeature; |
| 37 |
import org.eclipse.update.core.IIncludedFeatureReference; |
| 38 |
import org.eclipse.update.core.IPluginEntry; |
| 19 |
import org.eclipse.update.internal.core.FeatureExecutableFactory; |
39 |
import org.eclipse.update.internal.core.FeatureExecutableFactory; |
| 20 |
|
40 |
|
| 21 |
/** |
41 |
/** |
|
Lines 25-34
Link Here
|
| 25 |
public class FetchScriptGenerator extends AbstractScriptGenerator { |
45 |
public class FetchScriptGenerator extends AbstractScriptGenerator { |
| 26 |
private static final String ELEMENT = "element"; //$NON-NLS-1$ |
46 |
private static final String ELEMENT = "element"; //$NON-NLS-1$ |
| 27 |
private static final String TYPE = "type"; //$NON-NLS-1$ |
47 |
private static final String TYPE = "type"; //$NON-NLS-1$ |
| 28 |
private static final String PATH = "path"; //$NON-NLS-1$ |
48 |
private static final String BUILDER = "builder"; //$NON-NLS-1$ |
| 29 |
private static final String PASSWORD = "password"; //$NON-NLS-1$ |
|
|
| 30 |
private static final String CVSROOT = "cvsRoot"; //$NON-NLS-1$ |
| 31 |
private static final String TAG = "tag"; //$NON-NLS-1$ |
| 32 |
|
49 |
|
| 33 |
// flag saying if we want to recursively generate the scripts |
50 |
// flag saying if we want to recursively generate the scripts |
| 34 |
protected boolean recursiveGeneration = true; |
51 |
protected boolean recursiveGeneration = true; |
|
Lines 37-45
Link Here
|
| 37 |
protected String directoryLocation; |
54 |
protected String directoryLocation; |
| 38 |
protected static Properties directory; //TODO Should be passed around |
55 |
protected static Properties directory; //TODO Should be passed around |
| 39 |
|
56 |
|
| 40 |
// The location of the CVS password file. |
|
|
| 41 |
protected String cvsPassFileLocation; |
| 42 |
|
| 43 |
protected boolean fetchChildren = true; |
57 |
protected boolean fetchChildren = true; |
| 44 |
|
58 |
|
| 45 |
protected String fetchTag = ""; //$NON-NLS-1$ |
59 |
protected String fetchTag = ""; //$NON-NLS-1$ |
|
Lines 145-151
Link Here
|
| 145 |
FetchScriptGenerator generator = new FetchScriptGenerator("feature@" + featureId); //$NON-NLS-1$ |
159 |
FetchScriptGenerator generator = new FetchScriptGenerator("feature@" + featureId); //$NON-NLS-1$ |
| 146 |
generator.setDirectoryLocation(directoryLocation); |
160 |
generator.setDirectoryLocation(directoryLocation); |
| 147 |
generator.setFetchChildren(fetchChildren); |
161 |
generator.setFetchChildren(fetchChildren); |
| 148 |
generator.setCvsPassFileLocation(cvsPassFileLocation); |
|
|
| 149 |
generator.setRecursiveGeneration(recursiveGeneration); |
162 |
generator.setRecursiveGeneration(recursiveGeneration); |
| 150 |
generator.setFetchTag(fetchTag); |
163 |
generator.setFetchTag(fetchTag); |
| 151 |
generator.repositoryPluginVersions = repositoryPluginVersions; |
164 |
generator.repositoryPluginVersions = repositoryPluginVersions; |
|
Lines 197-203
Link Here
|
| 197 |
|
210 |
|
| 198 |
protected void generateFetchPluginsTarget() throws CoreException { |
211 |
protected void generateFetchPluginsTarget() throws CoreException { |
| 199 |
script.printTargetDeclaration(TARGET_FETCH_PLUGINS, null, FEATURE_AND_PLUGINS, null, null); |
212 |
script.printTargetDeclaration(TARGET_FETCH_PLUGINS, null, FEATURE_AND_PLUGINS, null, null); |
| 200 |
retrieveFeature((String) mapInfos.get(ELEMENT), (String) mapInfos.get(CVSROOT), (String) mapInfos.get(TAG), (String) mapInfos.get(PASSWORD), (String) mapInfos.get(PATH)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-1$ //$NON-NLS-5$ |
213 |
retrieveFeature((String) mapInfos.get(ELEMENT), (String) mapInfos.get(TYPE), mapInfos); |
| 201 |
generateChildrenFetchScript(); |
214 |
generateChildrenFetchScript(); |
| 202 |
script.printTargetEnd(); |
215 |
script.printTargetEnd(); |
| 203 |
} |
216 |
} |
|
Lines 212-243
Link Here
|
| 212 |
private Map processMapFileEntry(String entry) throws CoreException { |
225 |
private Map processMapFileEntry(String entry) throws CoreException { |
| 213 |
Map entryInfos = new HashMap(5); |
226 |
Map entryInfos = new HashMap(5); |
| 214 |
|
227 |
|
| 215 |
String cvsInfo = getCVSInfo(entry); |
228 |
// extract type and element from entry |
| 216 |
if (cvsInfo == null) { |
229 |
int index = entry.indexOf('@'); //$NON-NLS-1$ |
|
|
230 |
String type = entry.substring(0, index); |
| 231 |
String element = entry.substring(index + 1); |
| 232 |
|
| 233 |
// read and validate the repository info |
| 234 |
String repositoryInfo = getRepositoryInfo(entry); |
| 235 |
if (repositoryInfo == null) { |
| 217 |
String message = Policy.bind("error.missingDirectoryEntry", entry); //$NON-NLS-1$ |
236 |
String message = Policy.bind("error.missingDirectoryEntry", entry); //$NON-NLS-1$ |
| 218 |
BundleHelper.getDefault().getLog().log(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_ENTRY_MISSING, message, null)); |
237 |
BundleHelper.getDefault().getLog().log(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_ENTRY_MISSING, message, null)); |
| 219 |
return null; |
238 |
return null; |
| 220 |
} |
239 |
} |
| 221 |
|
240 |
|
| 222 |
String[] cvsFields = Utils.getArrayFromStringWithBlank(cvsInfo, ","); //$NON-NLS-1$ |
241 |
// collect and validate the repository info |
| 223 |
if (cvsFields.length < 2) { |
242 |
String[] repositoryFields = Utils.getArrayFromStringWithBlank(repositoryInfo, ","); //$NON-NLS-1$ |
|
|
243 |
if (repositoryFields.length < 2) { |
| 224 |
String message = Policy.bind("error.incorrectDirectoryEntry", element); //$NON-NLS-1$ |
244 |
String message = Policy.bind("error.incorrectDirectoryEntry", element); //$NON-NLS-1$ |
| 225 |
throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_ENTRY_MISSING, message, null)); |
245 |
throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_ENTRY_MISSING, message, null)); |
| 226 |
} |
246 |
} |
| 227 |
|
247 |
|
| 228 |
entryInfos.put(TAG, fetchTag.length() == 0 ? cvsFields[0] : fetchTag); //$NON-NLS-1$ |
248 |
// determine fetch script builder |
| 229 |
entryInfos.put(CVSROOT, cvsFields[1]); //$NON-NLS-1$ |
249 |
IFetchScriptBuilder fetchScriptBuilder = null; |
| 230 |
entryInfos.put(PASSWORD, (cvsFields.length > 2 && !cvsFields[2].equals("")) ? cvsFields[2] : null); //$NON-NLS-1$ //$NON-NLS-2$ |
250 |
String[] arguments = null; |
| 231 |
|
251 |
|
| 232 |
entryInfos.put(PATH, (cvsFields.length > 3 && !cvsFields[3].equals("")) ? cvsFields[3] : null); //$NON-NLS-1$ //$NON-NLS-2$ |
252 |
// check if first repository field matches a builder id |
| 233 |
|
253 |
if(FetchScriptBuilderRegistry.getRegistry().getBuilderIds().contains(repositoryFields[0])) |
| 234 |
int index = entry.indexOf('@'); //$NON-NLS-1$ |
254 |
{ |
| 235 |
entryInfos.put(TYPE, entry.substring(0, index)); //$NON-NLS-1$ |
255 |
fetchScriptBuilder = FetchScriptBuilderRegistry.getRegistry().getBuilder(repositoryFields[0]); |
| 236 |
entryInfos.put(ELEMENT, entry.substring(index + 1)); //$NON-NLS-1$ |
256 |
|
|
|
257 |
// construct arguments array for registered builder |
| 258 |
arguments = new String[repositoryFields.length-1]; |
| 259 |
System.arraycopy(repositoryFields, 1, arguments, 0, repositoryFields.length-1); |
| 260 |
} |
| 261 |
|
| 262 |
// check builder not nuöl |
| 263 |
if( null == fetchScriptBuilder) |
| 264 |
{ |
| 265 |
// fall back to CVS |
| 266 |
fetchScriptBuilder = new CVSFetchScriptBuilder(); |
| 267 |
|
| 268 |
// construct arguments array for CVS builder |
| 269 |
arguments = repositoryFields; |
| 270 |
} |
| 271 |
|
| 272 |
// add infos from registered builder |
| 273 |
fetchScriptBuilder.processMapFileEntry(element, type, arguments, fetchTag, entryInfos); |
| 274 |
|
| 275 |
// store builde |
| 276 |
entryInfos.put(BUILDER, fetchScriptBuilder); |
| 277 |
|
| 278 |
// add general infos (will override builder specific infos) |
| 279 |
entryInfos.put(TYPE, type); |
| 280 |
entryInfos.put(ELEMENT, element); |
| 237 |
return entryInfos; |
281 |
return entryInfos; |
| 238 |
} |
282 |
} |
| 239 |
|
283 |
|
| 240 |
protected void generateFetchRecusivelyTarget() throws CoreException { |
284 |
protected void generateFetchRecusivelyTarget() throws CoreException { |
| 241 |
script.printTargetDeclaration(TARGET_FETCH_RECURSIVELY, null, FEATURES_RECURSIVELY, null, null); |
285 |
script.printTargetDeclaration(TARGET_FETCH_RECURSIVELY, null, FEATURES_RECURSIVELY, null, null); |
| 242 |
|
286 |
|
| 243 |
IIncludedFeatureReference[] compiledFeatures = ((Feature) feature).getFeatureIncluded(); |
287 |
IIncludedFeatureReference[] compiledFeatures = ((Feature) feature).getFeatureIncluded(); |
|
Lines 264-312
Link Here
|
| 264 |
return; |
308 |
return; |
| 265 |
} |
309 |
} |
| 266 |
|
310 |
|
| 267 |
String password = (String) mapFileEntry.get(PASSWORD); |
311 |
IFetchScriptBuilder builder = (IFetchScriptBuilder) mapFileEntry.get(BUILDER); |
| 268 |
if (password != null) |
312 |
String element = (String) mapFileEntry.get(ELEMENT); |
| 269 |
script.printCVSPassTask((String) mapFileEntry.get(CVSROOT), password, cvsPassFileLocation); //$NON-NLS-1$ |
313 |
String type = (String) mapFileEntry.get(TYPE); |
| 270 |
|
314 |
|
| 271 |
String type = (String) mapFileEntry.get(TYPE); |
315 |
// print authentification task if one is provided |
|
|
316 |
ITask authTask = builder.generateAuthentificationTask(element,type,mapFileEntry); |
| 317 |
if(null != authTask) script.print(authTask); |
| 318 |
|
| 319 |
// the location |
| 272 |
String location = getElementLocation(type); |
320 |
String location = getElementLocation(type); |
| 273 |
Map params = new HashMap(5); |
321 |
|
| 274 |
|
322 |
// the destination |
| 275 |
//We directly export the CVS content into the correct directory |
323 |
// we directly export the content into the correct directory |
| 276 |
params.put("destination", mapFileEntry.get(ELEMENT)); //$NON-NLS-1$ //$NON-NLS-2$ |
324 |
String destination = element; |
| 277 |
params.put(TAG, mapFileEntry.get(TAG)); //$NON-NLS-1$ //$NON-NLS-2$ |
325 |
|
| 278 |
params.put(CVSROOT, mapFileEntry.get(CVSROOT)); //$NON-NLS-1$ //$NON-NLS-2$ |
326 |
// get params from builder |
| 279 |
params.put("quiet", "${quiet}"); //$NON-NLS-1$ //$NON-NLS-2$ |
327 |
Map params = new HashMap(builder.generatePropertiesForFetchTask(element, type, mapFileEntry, destination, xmlFileOnly)); |
| 280 |
|
328 |
|
| 281 |
String cvsPackage = ((String) mapFileEntry.get(PATH) == null ? (String) mapFileEntry.get(ELEMENT) : (String) mapFileEntry.get(PATH)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
|
|
| 282 |
String fullLocation = null; |
329 |
String fullLocation = null; |
| 283 |
if (type.equals("feature")) { //$NON-NLS-1$ |
330 |
if (type.equals("feature")) { //$NON-NLS-1$ |
| 284 |
fullLocation = location + '/' + (String) mapFileEntry.get(ELEMENT) + '/' + DEFAULT_FEATURE_FILENAME_DESCRIPTOR; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
331 |
fullLocation = location + '/' + element + '/' + DEFAULT_FEATURE_FILENAME_DESCRIPTOR; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| 285 |
params.put("fileToCheck", fullLocation); //$NON-NLS-1$ |
332 |
params.put("fileToCheck", fullLocation); //$NON-NLS-1$ |
| 286 |
cvsPackage += xmlFileOnly ? '/' + DEFAULT_FEATURE_FILENAME_DESCRIPTOR : ""; //$NON-NLS-1$ //$NON-NLS-2$ |
333 |
repositoryFeatureVersions.put(element, builder.getVersionToFetch(element,type,mapFileEntry)); |
| 287 |
repositoryFeatureVersions.put(mapFileEntry.get(ELEMENT), mapFileEntry.get(TAG)); |
|
|
| 288 |
} else if (type.equals("plugin")) { //$NON-NLS-1$ |
334 |
} else if (type.equals("plugin")) { //$NON-NLS-1$ |
| 289 |
fullLocation = location + '/' + (String) mapFileEntry.get(ELEMENT) + '/' + DEFAULT_PLUGIN_FILENAME_DESCRIPTOR; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
335 |
fullLocation = location + '/' + element + '/' + DEFAULT_PLUGIN_FILENAME_DESCRIPTOR; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| 290 |
params.put("fileToCheck", fullLocation); //$NON-NLS-1$ |
336 |
params.put("fileToCheck", fullLocation); //$NON-NLS-1$ |
| 291 |
cvsPackage += xmlFileOnly ? '/' + DEFAULT_PLUGIN_FILENAME_DESCRIPTOR : ""; //$NON-NLS-1$ //$NON-NLS-2$ |
337 |
repositoryPluginVersions.put(element, builder.getVersionToFetch(element,type,mapFileEntry)); |
| 292 |
repositoryPluginVersions.put(mapFileEntry.get(ELEMENT), mapFileEntry.get(TAG)); |
|
|
| 293 |
} else if (type.equals("fragment")) { //$NON-NLS-1$ |
338 |
} else if (type.equals("fragment")) { //$NON-NLS-1$ |
| 294 |
fullLocation = location + '/' + (String) mapFileEntry.get(ELEMENT) + '/' + DEFAULT_FRAGMENT_FILENAME_DESCRIPTOR; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
339 |
fullLocation = location + '/' + element + '/' + DEFAULT_FRAGMENT_FILENAME_DESCRIPTOR; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| 295 |
params.put("fileToCheck", fullLocation); //$NON-NLS-1$ |
340 |
params.put("fileToCheck", fullLocation); //$NON-NLS-1$ |
| 296 |
cvsPackage += xmlFileOnly ? '/' + DEFAULT_FRAGMENT_FILENAME_DESCRIPTOR : ""; //$NON-NLS-1$ //$NON-NLS-2$ |
341 |
repositoryPluginVersions.put(element, builder.getVersionToFetch(element,type,mapFileEntry)); |
| 297 |
repositoryPluginVersions.put(mapFileEntry.get(ELEMENT), mapFileEntry.get(TAG)); |
|
|
| 298 |
} |
342 |
} |
| 299 |
params.put("package", cvsPackage); //$NON-NLS-1$ |
|
|
| 300 |
|
343 |
|
| 301 |
// This call create a new property for every feature, plugins or fragments that we must check the existence of |
344 |
// This call create a new property for every feature, plugins or fragments that we must check the existence of |
| 302 |
script.printAvailableTask(fullLocation, fullLocation); |
345 |
script.printAvailableTask(fullLocation, fullLocation); |
| 303 |
script.printAntTask("../" + scriptName, getPropertyFormat(PROPERTY_BUILD_DIRECTORY) + '/' + (type.equals("feature") ? DEFAULT_FEATURE_LOCATION : DEFAULT_PLUGIN_LOCATION), TARGET_GET_FROM_CVS, null, null, params); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
346 |
script.printAntTask("../" + scriptName, getPropertyFormat(PROPERTY_BUILD_DIRECTORY) + '/' + (type.equals("feature") ? DEFAULT_FEATURE_LOCATION : DEFAULT_PLUGIN_LOCATION), TARGET_FETCH_FROM_REPOSITORY, null, null, params); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| 304 |
|
347 |
|
| 305 |
} |
348 |
} |
| 306 |
|
349 |
|
| 307 |
protected void generateGetFromCVSTarget() { |
350 |
protected void generateGetFromCVSTarget() { |
| 308 |
script.printTargetDeclaration(TARGET_GET_FROM_CVS, null, null, "${fileToCheck}", null); //$NON-NLS-1$ |
351 |
script.printTargetDeclaration(TARGET_FETCH_FROM_REPOSITORY, null, null, "${fileToCheck}", null); //$NON-NLS-1$ |
| 309 |
script.printCVSTask("export -d ${destination} -r ${tag} ${package}", "${cvsRoot}", null, null, null, "${quiet}", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
352 |
if(null != mapInfos) { |
|
|
353 |
IFetchScriptBuilder builder = (IFetchScriptBuilder) mapInfos.get(BUILDER); |
| 354 |
if(null != builder) { |
| 355 |
ITask getTask = builder.getFetchTask(); |
| 356 |
if(null != getTask) { |
| 357 |
script.print(getTask); |
| 358 |
} |
| 359 |
} |
| 360 |
} |
| 310 |
script.printTargetEnd(); |
361 |
script.printTargetEnd(); |
| 311 |
} |
362 |
} |
| 312 |
|
363 |
|
|
Lines 360-366
Link Here
|
| 360 |
* @param password the CVS password |
411 |
* @param password the CVS password |
| 361 |
* @throws CoreException |
412 |
* @throws CoreException |
| 362 |
*/ |
413 |
*/ |
| 363 |
protected void retrieveFeature(String elementName, String cvsRoot, String tag, String password, String path) throws CoreException { |
414 |
protected void retrieveFeature(String elementName, String elementType, Map elementInfos) throws CoreException { |
| 364 |
// Generate a temporary Ant script which retrieves the feature.xml for this |
415 |
// Generate a temporary Ant script which retrieves the feature.xml for this |
| 365 |
// feature from CVS |
416 |
// feature from CVS |
| 366 |
File root = new File(workingDirectory); |
417 |
File root = new File(workingDirectory); |
|
Lines 371-392
Link Here
|
| 371 |
retrieve.printProjectDeclaration("RetrieveFeature", "main", "."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
422 |
retrieve.printProjectDeclaration("RetrieveFeature", "main", "."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| 372 |
retrieve.printTargetDeclaration(TARGET_MAIN, null, null, null, null); //$NON-NLS-1$ |
423 |
retrieve.printTargetDeclaration(TARGET_MAIN, null, null, null, null); //$NON-NLS-1$ |
| 373 |
|
424 |
|
| 374 |
IPath moduleFeatureFile; |
425 |
String destination = elementName; |
| 375 |
IPath moduleFeatureProperties; |
426 |
String[] files = new String[] {DEFAULT_FEATURE_FILENAME_DESCRIPTOR, PROPERTIES_FILE}; |
| 376 |
if (path != null) { |
427 |
IFetchScriptBuilder builder = (IFetchScriptBuilder) elementInfos.get(BUILDER); |
| 377 |
moduleFeatureFile = new Path(path).append(DEFAULT_FEATURE_FILENAME_DESCRIPTOR); |
428 |
ITask retrieveFeatureTask = builder.generateRetrieveFilesTask(elementName, elementType, elementInfos, destination, files); |
| 378 |
moduleFeatureProperties = new Path(path).append(PROPERTIES_FILE); |
429 |
if(null == retrieveFeatureTask) { |
| 379 |
} else { |
430 |
String message = Policy.bind("error.noRetrieveFeatureTask", elementName); //$NON-NLS-1$ |
| 380 |
moduleFeatureFile = new Path(elementName).append(DEFAULT_FEATURE_FILENAME_DESCRIPTOR); |
431 |
throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_ENTRY_MISSING, message, null)); |
| 381 |
moduleFeatureProperties = new Path(elementName).append(PROPERTIES_FILE); |
432 |
} |
| 382 |
} |
433 |
retrieve.print(retrieveFeatureTask); |
| 383 |
|
434 |
|
| 384 |
if (password != null) |
|
|
| 385 |
retrieve.printCVSPassTask(cvsRoot, password, cvsPassFileLocation); |
| 386 |
|
| 387 |
retrieve.printCVSTask("export -r " + tag + " " + moduleFeatureFile.toString(), cvsRoot, null, null, null, "true", null); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ |
| 388 |
retrieve.printCVSTask("export -r " + tag + " " + moduleFeatureProperties.toString(), cvsRoot, null, null, null, "true", null); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ |
| 389 |
|
| 390 |
retrieve.printTargetEnd(); |
435 |
retrieve.printTargetEnd(); |
| 391 |
retrieve.printProjectEnd(); |
436 |
retrieve.printProjectEnd(); |
| 392 |
} finally { |
437 |
} finally { |
|
Lines 403-416
Link Here
|
| 403 |
AntRunner runner = new AntRunner(); |
448 |
AntRunner runner = new AntRunner(); |
| 404 |
runner.setBuildFileLocation(target.getAbsolutePath()); |
449 |
runner.setBuildFileLocation(target.getAbsolutePath()); |
| 405 |
runner.run(); |
450 |
runner.run(); |
|
|
451 |
String destination = elementName; |
| 406 |
FeatureExecutableFactory factory = new FeatureExecutableFactory(); |
452 |
FeatureExecutableFactory factory = new FeatureExecutableFactory(); |
| 407 |
File featureFolder = new File(root, (path == null ? elementName : path)); |
453 |
File featureFolder = new File(root, destination); |
| 408 |
feature = (Feature) factory.createFeature(featureFolder.toURL(), null, null); |
454 |
feature = (Feature) factory.createFeature(featureFolder.toURL(), null, null); |
| 409 |
|
455 |
|
| 410 |
//We only delete here, so if an exception is thrown the user can still see the retrieve.xml |
456 |
//We only delete here, so if an exception is thrown the user can still see the retrieve.xml |
| 411 |
target.delete(); |
457 |
target.delete(); |
| 412 |
featureProperties = new Properties(); |
458 |
featureProperties = new Properties(); |
| 413 |
InputStream featureStream = new FileInputStream(new File(root, (path == null ? elementName : path) + '/' + PROPERTIES_FILE)); |
459 |
InputStream featureStream = new FileInputStream(new File(root, destination + '/' + PROPERTIES_FILE)); |
| 414 |
featureProperties.load(featureStream); |
460 |
featureProperties.load(featureStream); |
| 415 |
featureStream.close(); |
461 |
featureStream.close(); |
| 416 |
clear(featureFolder); |
462 |
clear(featureFolder); |
|
Lines 474-480
Link Here
|
| 474 |
* @return String |
520 |
* @return String |
| 475 |
* @throws CoreException |
521 |
* @throws CoreException |
| 476 |
*/ |
522 |
*/ |
| 477 |
protected String getCVSInfo(String elementName) throws CoreException { |
523 |
protected String getRepositoryInfo(String elementName) throws CoreException { |
| 478 |
if (directory == null) |
524 |
if (directory == null) |
| 479 |
directory = readProperties(directoryLocation, "", IStatus.ERROR); //$NON-NLS-1$ |
525 |
directory = readProperties(directoryLocation, "", IStatus.ERROR); //$NON-NLS-1$ |
| 480 |
return directory.getProperty(elementName); |
526 |
return directory.getProperty(elementName); |
|
Lines 526-540
Link Here
|
| 526 |
*/ |
572 |
*/ |
| 527 |
public void setFetchTag(String value) { |
573 |
public void setFetchTag(String value) { |
| 528 |
fetchTag = value; |
574 |
fetchTag = value; |
| 529 |
} |
|
|
| 530 |
|
| 531 |
/** |
| 532 |
* Sets the CVS password file location to be the given value. |
| 533 |
* |
| 534 |
* @param cvsPassFileLocation the CVS password file location |
| 535 |
*/ |
| 536 |
public void setCvsPassFileLocation(String cvsPassFileLocation) { |
| 537 |
this.cvsPassFileLocation = cvsPassFileLocation; |
| 538 |
} |
575 |
} |
| 539 |
|
576 |
|
| 540 |
public void setRecursiveGeneration(boolean recursiveGeneration) { |
577 |
public void setRecursiveGeneration(boolean recursiveGeneration) { |