|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2006 IBM Corporation and others. |
2 |
* Copyright (c) 2006, 2007 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 74-80
Link Here
|
| 74 |
import org.eclipse.pde.internal.core.ifeature.IFeatureModel; |
74 |
import org.eclipse.pde.internal.core.ifeature.IFeatureModel; |
| 75 |
import org.eclipse.pde.internal.core.ifeature.IFeaturePlugin; |
75 |
import org.eclipse.pde.internal.core.ifeature.IFeaturePlugin; |
| 76 |
import org.eclipse.pde.internal.core.util.CoreUtility; |
76 |
import org.eclipse.pde.internal.core.util.CoreUtility; |
| 77 |
import org.osgi.framework.BundleContext; |
|
|
| 78 |
import org.osgi.framework.InvalidSyntaxException; |
77 |
import org.osgi.framework.InvalidSyntaxException; |
| 79 |
import org.w3c.dom.DOMException; |
78 |
import org.w3c.dom.DOMException; |
| 80 |
import org.w3c.dom.Document; |
79 |
import org.w3c.dom.Document; |
|
Lines 93-99
Link Here
|
| 93 |
|
92 |
|
| 94 |
protected HashMap fAntBuildProperties; |
93 |
protected HashMap fAntBuildProperties; |
| 95 |
|
94 |
|
| 96 |
private State fStateCopy; |
95 |
protected State fStateCopy; |
| 97 |
|
96 |
|
| 98 |
protected static String FEATURE_POST_PROCESSING = "features.postProcessingSteps.properties"; //$NON-NLS-1$ |
97 |
protected static String FEATURE_POST_PROCESSING = "features.postProcessingSteps.properties"; //$NON-NLS-1$ |
| 99 |
protected static String PLUGIN_POST_PROCESSING = "plugins.postProcessingSteps.properties"; //$NON-NLS-1$ |
98 |
protected static String PLUGIN_POST_PROCESSING = "plugins.postProcessingSteps.properties"; //$NON-NLS-1$ |
|
Lines 480-488
Link Here
|
| 480 |
return main; |
479 |
return main; |
| 481 |
} |
480 |
} |
| 482 |
if (fStateCopy == null) { |
481 |
if (fStateCopy == null) { |
| 483 |
fStateCopy = main.getFactory().createState(main); |
482 |
copyState(main); |
| 484 |
fStateCopy.setResolver(Platform.getPlatformAdmin().getResolver()); |
|
|
| 485 |
fStateCopy.setPlatformProperties(main.getPlatformProperties()); |
| 486 |
} |
483 |
} |
| 487 |
|
484 |
|
| 488 |
Dictionary[] dictionaries = fStateCopy.getPlatformProperties(); |
485 |
Dictionary[] dictionaries = fStateCopy.getPlatformProperties(); |
|
Lines 496-501
Link Here
|
| 496 |
return fStateCopy; |
493 |
return fStateCopy; |
| 497 |
} |
494 |
} |
| 498 |
|
495 |
|
|
|
496 |
protected void copyState(State state) { |
| 497 |
fStateCopy = state.getFactory().createState(state); |
| 498 |
fStateCopy.setResolver(Platform.getPlatformAdmin().getResolver()); |
| 499 |
fStateCopy.setPlatformProperties(state.getPlatformProperties()); |
| 500 |
} |
| 501 |
|
| 499 |
private String getDevProperties() { |
502 |
private String getDevProperties() { |
| 500 |
if (fDevProperties == null) { |
503 |
if (fDevProperties == null) { |
| 501 |
fDevProperties = ClasspathHelper.getDevEntriesProperties(fBuildTempLocation + "/dev.properties", false); //$NON-NLS-1$ |
504 |
fDevProperties = ClasspathHelper.getDevEntriesProperties(fBuildTempLocation + "/dev.properties", false); //$NON-NLS-1$ |
|
Lines 629-636
Link Here
|
| 629 |
environment.put("osgi.ws", config[1]); //$NON-NLS-1$ |
632 |
environment.put("osgi.ws", config[1]); //$NON-NLS-1$ |
| 630 |
environment.put("osgi.arch", config[2]); //$NON-NLS-1$ |
633 |
environment.put("osgi.arch", config[2]); //$NON-NLS-1$ |
| 631 |
environment.put("osgi.nl", config[3]); //$NON-NLS-1$ |
634 |
environment.put("osgi.nl", config[3]); //$NON-NLS-1$ |
| 632 |
|
635 |
|
| 633 |
BundleContext context = PDECore.getDefault().getBundleContext(); |
|
|
| 634 |
for (int i = 0; i < fInfo.items.length; i++) { |
636 |
for (int i = 0; i < fInfo.items.length; i++) { |
| 635 |
if (fInfo.items[i] instanceof IFeatureModel) { |
637 |
if (fInfo.items[i] instanceof IFeatureModel) { |
| 636 |
IFeature feature = ((IFeatureModel) fInfo.items[i]).getFeature(); |
638 |
IFeature feature = ((IFeatureModel) fInfo.items[i]).getFeature(); |
|
Lines 649-665
Link Here
|
| 649 |
} |
651 |
} |
| 650 |
if (bundle == null) |
652 |
if (bundle == null) |
| 651 |
continue; |
653 |
continue; |
| 652 |
try { |
654 |
if (shouldAddPlugin(bundle, environment)) { |
| 653 |
String filterSpec = bundle.getPlatformFilter(); |
655 |
Element plugin = doc.createElement("plugin"); //$NON-NLS-1$ |
| 654 |
if (filterSpec == null|| context.createFilter(filterSpec).match(environment)) { |
656 |
plugin.setAttribute("id", bundle.getSymbolicName()); //$NON-NLS-1$ |
| 655 |
Element plugin = doc.createElement("plugin"); //$NON-NLS-1$ |
657 |
plugin.setAttribute("version", bundle.getVersion().toString()); //$NON-NLS-1$ |
| 656 |
plugin.setAttribute("id", bundle.getSymbolicName()); //$NON-NLS-1$ |
658 |
setAdditionalAttributes(plugin, bundle); |
| 657 |
plugin.setAttribute("version", bundle.getVersion().toString()); //$NON-NLS-1$ |
659 |
root.appendChild(plugin); |
| 658 |
setAdditionalAttributes(plugin, bundle); |
660 |
} |
| 659 |
root.appendChild(plugin); |
|
|
| 660 |
} |
| 661 |
} catch (InvalidSyntaxException e) { |
| 662 |
} |
| 663 |
} |
661 |
} |
| 664 |
} |
662 |
} |
| 665 |
XMLPrintHandler.writeFile(doc, new File(file, "feature.xml")); //$NON-NLS-1$ |
663 |
XMLPrintHandler.writeFile(doc, new File(file, "feature.xml")); //$NON-NLS-1$ |
|
Lines 680-684
Link Here
|
| 680 |
fHasErrors = true; |
678 |
fHasErrors = true; |
| 681 |
} |
679 |
} |
| 682 |
|
680 |
|
| 683 |
|
681 |
protected boolean shouldAddPlugin(BundleDescription bundle, Dictionary environment) { |
|
|
682 |
String filterSpec = bundle.getPlatformFilter(); |
| 683 |
try { |
| 684 |
return (filterSpec == null|| PDECore.getDefault().getBundleContext().createFilter(filterSpec).match(environment)); |
| 685 |
} catch (InvalidSyntaxException e) { |
| 686 |
} |
| 687 |
return false; |
| 688 |
} |
| 684 |
} |
689 |
} |