public InstallableUnitFragmentDescription() { super(); setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); }
private static IInstallableUnitFragment createLocalizationFragmentOfHost(BundleDescription bd, String hostId, String[] hostManifestValues, Map<Locale, Map<String, String>> hostLocalizations) { InstallableUnitFragmentDescription fragment = new MetadataFactory.InstallableUnitFragmentDescription(); String fragmentId = makeHostLocalizationFragmentId(bd.getSymbolicName()); fragment.setId(fragmentId); fragment.setVersion(PublisherHelper.fromOSGiVersion(bd.getVersion())); // TODO: is this a meaningful version? HostSpecification hostSpec = bd.getHost(); IRequirement[] hostReqs = new IRequirement[] {MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, hostSpec.getName(), PublisherHelper.fromOSGiVersionRange(hostSpec.getVersionRange()), null, false, false, false)}; fragment.setHost(hostReqs); fragment.setSingleton(true); fragment.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); // Create a provided capability for each locale and add the translated properties. ArrayList<IProvidedCapability> providedCapabilities = new ArrayList<IProvidedCapability>(hostLocalizations.keySet().size()); providedCapabilities.add(PublisherHelper.createSelfCapability(fragmentId, fragment.getVersion())); for (Entry<Locale, Map<String, String>> localeEntry : hostLocalizations.entrySet()) { Locale locale = localeEntry.getKey(); Map<String, String> translatedStrings = localeEntry.getValue(); for (Entry<String, String> entry : translatedStrings.entrySet()) { fragment.setProperty(locale.toString() + '.' + entry.getKey(), entry.getValue()); } providedCapabilities.add(PublisherHelper.makeTranslationCapability(hostId, locale)); } fragment.setCapabilities(providedCapabilities.toArray(new IProvidedCapability[providedCapabilities.size()])); return MetadataFactory.createInstallableUnitFragment(fragment); }
private static IInstallableUnitFragment createLocalizationFragmentOfHost(BundleDescription bd, String hostId, String[] hostManifestValues, Map<Locale, Map<String, String>> hostLocalizations) { InstallableUnitFragmentDescription fragment = new MetadataFactory.InstallableUnitFragmentDescription(); String fragmentId = makeHostLocalizationFragmentId(bd.getSymbolicName()); fragment.setId(fragmentId); fragment.setVersion(PublisherHelper.fromOSGiVersion(bd.getVersion())); // TODO: is this a meaningful version? HostSpecification hostSpec = bd.getHost(); IRequirement[] hostReqs = new IRequirement[] {MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, hostSpec.getName(), PublisherHelper.fromOSGiVersionRange(hostSpec.getVersionRange()), null, false, false, false)}; fragment.setHost(hostReqs); fragment.setSingleton(true); fragment.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); // Create a provided capability for each locale and add the translated properties. ArrayList<IProvidedCapability> providedCapabilities = new ArrayList<IProvidedCapability>(hostLocalizations.keySet().size()); providedCapabilities.add(PublisherHelper.createSelfCapability(fragmentId, fragment.getVersion())); for (Entry<Locale, Map<String, String>> localeEntry : hostLocalizations.entrySet()) { Locale locale = localeEntry.getKey(); Map<String, String> translatedStrings = localeEntry.getValue(); for (Entry<String, String> entry : translatedStrings.entrySet()) { fragment.setProperty(locale.toString() + '.' + entry.getKey(), entry.getValue()); } providedCapabilities.add(PublisherHelper.makeTranslationCapability(hostId, locale)); } fragment.setCapabilities(providedCapabilities.toArray(new IProvidedCapability[providedCapabilities.size()])); return MetadataFactory.createInstallableUnitFragment(fragment); }
public static IInstallableUnit createBundleConfigurationUnit(String hostId, Version cuVersion, boolean isBundleFragment, GeneratorBundleInfo configInfo, String configurationFlavor, IMatchExpression<IInstallableUnit> filter) { if (configInfo == null) return null; InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = configurationFlavor + hostId; cu.setId(configUnitId); cu.setVersion(cuVersion); //Indicate the IU to which this CU apply Version hostVersion = Version.parseVersion(configInfo.getVersion()); VersionRange range = hostVersion == Version.emptyVersion ? VersionRange.emptyRange : new VersionRange(hostVersion, true, Version.MAX_VERSION, true); cu.setHost(new IRequirement[] { // MetadataFactory.createRequirement(CAPABILITY_NS_OSGI_BUNDLE, hostId, range, null, false, false, true), // MetadataFactory.createRequirement(PublisherHelper.NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_BUNDLE, new VersionRange(Version.createOSGi(1, 0, 0), true, Version.createOSGi(2, 0, 0), false), null, false, false, false)}); //Adds capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {PublisherHelper.createSelfCapability(configUnitId, cuVersion), MetadataFactory.createProvidedCapability(PublisherHelper.NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); Map<String, String> touchpointData = new HashMap<>(); touchpointData.put("install", "installBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("uninstall", "uninstallBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("configure", createConfigScript(configInfo, isBundleFragment)); //$NON-NLS-1$ touchpointData.put("unconfigure", createUnconfigScript(configInfo, isBundleFragment)); //$NON-NLS-1$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); cu.setFilter(filter); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createBundleConfigurationUnit(String hostId, Version cuVersion, boolean isBundleFragment, GeneratorBundleInfo configInfo, String configurationFlavor, IMatchExpression<IInstallableUnit> filter) { if (configInfo == null) return null; InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = configurationFlavor + hostId; cu.setId(configUnitId); cu.setVersion(cuVersion); //Indicate the IU to which this CU apply Version hostVersion = Version.parseVersion(configInfo.getVersion()); VersionRange range = hostVersion == Version.emptyVersion ? VersionRange.emptyRange : new VersionRange(hostVersion, true, Version.MAX_VERSION, true); cu.setHost(new IRequirement[] { // MetadataFactory.createRequirement(CAPABILITY_NS_OSGI_BUNDLE, hostId, range, null, false, false, true), // MetadataFactory.createRequirement(PublisherHelper.NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_BUNDLE, new VersionRange(Version.createOSGi(1, 0, 0), true, Version.createOSGi(2, 0, 0), false), null, false, false, false)}); //Adds capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {PublisherHelper.createSelfCapability(configUnitId, cuVersion), MetadataFactory.createProvidedCapability(PublisherHelper.NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); Map<String, String> touchpointData = new HashMap<String, String>(); touchpointData.put("install", "installBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("uninstall", "uninstallBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("configure", createConfigScript(configInfo, isBundleFragment)); //$NON-NLS-1$ touchpointData.put("unconfigure", createUnconfigScript(configInfo, isBundleFragment)); //$NON-NLS-1$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); cu.setFilter(filter); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createBundleConfigurationUnit(String hostId, Version cuVersion, boolean isBundleFragment, GeneratorBundleInfo configInfo, String configurationFlavor, IMatchExpression<IInstallableUnit> filter) { if (configInfo == null) return null; InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = configurationFlavor + hostId; cu.setId(configUnitId); cu.setVersion(cuVersion); //Indicate the IU to which this CU apply Version hostVersion = Version.parseVersion(configInfo.getVersion()); VersionRange range = hostVersion == Version.emptyVersion ? VersionRange.emptyRange : new VersionRange(hostVersion, true, Version.MAX_VERSION, true); cu.setHost(new IRequirement[] { // MetadataFactory.createRequirement(CAPABILITY_NS_OSGI_BUNDLE, hostId, range, null, false, false, true), // MetadataFactory.createRequirement(PublisherHelper.NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_BUNDLE, new VersionRange(Version.createOSGi(1, 0, 0), true, Version.createOSGi(2, 0, 0), false), null, false, false, false)}); //Adds capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {PublisherHelper.createSelfCapability(configUnitId, cuVersion), MetadataFactory.createProvidedCapability(PublisherHelper.NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); Map<String, String> touchpointData = new HashMap<String, String>(); touchpointData.put("install", "installBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("uninstall", "uninstallBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("configure", createConfigScript(configInfo, isBundleFragment)); //$NON-NLS-1$ touchpointData.put("unconfigure", createUnconfigScript(configInfo, isBundleFragment)); //$NON-NLS-1$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); cu.setFilter(filter); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createDefaultBundleConfigurationUnit(GeneratorBundleInfo configInfo, GeneratorBundleInfo unconfigInfo, String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = PublisherHelper.createDefaultConfigUnitId(OSGI_BUNDLE_CLASSIFIER, configurationFlavor); cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {PublisherHelper.createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(PublisherHelper.NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on bundles IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(PublisherHelper.NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_BUNDLE, VersionRange.emptyRange, null, false, true, false)}; cu.setHost(reqs); Map<String, String> touchpointData = new HashMap<>(); touchpointData.put("install", "installBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("uninstall", "uninstallBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("configure", createDefaultBundleConfigScript(configInfo)); //$NON-NLS-1$ touchpointData.put("unconfigure", createDefaultBundleUnconfigScript(unconfigInfo)); //$NON-NLS-1$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createDefaultBundleConfigurationUnit(GeneratorBundleInfo configInfo, GeneratorBundleInfo unconfigInfo, String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = PublisherHelper.createDefaultConfigUnitId(OSGI_BUNDLE_CLASSIFIER, configurationFlavor); cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {PublisherHelper.createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(PublisherHelper.NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on bundles IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(PublisherHelper.NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_BUNDLE, VersionRange.emptyRange, null, false, true, false)}; cu.setHost(reqs); Map<String, String> touchpointData = new HashMap<String, String>(); touchpointData.put("install", "installBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("uninstall", "uninstallBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("configure", createDefaultBundleConfigScript(configInfo)); //$NON-NLS-1$ touchpointData.put("unconfigure", createDefaultBundleUnconfigScript(unconfigInfo)); //$NON-NLS-1$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createDefaultFeatureConfigurationUnit(String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = createDefaultConfigUnitId(ECLIPSE_FEATURE_CLASSIFIER, configurationFlavor); cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on features IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_FEATURE, VersionRange.emptyRange, null, true, true, false)}; cu.setHost(reqs); cu.setFilter(INSTALL_FEATURES_FILTER); Map<String, String> touchpointData = new HashMap<String, String>(); touchpointData.put("install", "installFeature(feature:${artifact},featureId:default,featureVersion:default)"); //$NON-NLS-1$//$NON-NLS-2$ touchpointData.put("uninstall", "uninstallFeature(feature:${artifact},featureId:default,featureVersion:default)"); //$NON-NLS-1$//$NON-NLS-2$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createDefaultFeatureConfigurationUnit(String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = createDefaultConfigUnitId(ECLIPSE_FEATURE_CLASSIFIER, configurationFlavor); cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on features IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_FEATURE, VersionRange.emptyRange, null, true, true, false)}; cu.setHost(reqs); cu.setFilter(INSTALL_FEATURES_FILTER); Map<String, String> touchpointData = new HashMap<String, String>(); touchpointData.put("install", "installFeature(feature:${artifact},featureId:default,featureVersion:default)"); //$NON-NLS-1$//$NON-NLS-2$ touchpointData.put("uninstall", "uninstallFeature(feature:${artifact},featureId:default,featureVersion:default)"); //$NON-NLS-1$//$NON-NLS-2$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createDefaultFeatureConfigurationUnit(String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = createDefaultConfigUnitId(ECLIPSE_FEATURE_CLASSIFIER, configurationFlavor); cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on features IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_FEATURE, VersionRange.emptyRange, null, true, true, false)}; cu.setHost(reqs); cu.setFilter(INSTALL_FEATURES_FILTER); Map<String, String> touchpointData = new HashMap<String, String>(); touchpointData.put("install", "installFeature(feature:${artifact},featureId:default,featureVersion:default)"); //$NON-NLS-1$//$NON-NLS-2$ touchpointData.put("uninstall", "uninstallFeature(feature:${artifact},featureId:default,featureVersion:default)"); //$NON-NLS-1$//$NON-NLS-2$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createDefaultConfigurationUnitForSourceBundles(String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = createDefaultConfigUnitId("source", configurationFlavor); //$NON-NLS-1$ cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on source providers IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_SOURCE, VersionRange.emptyRange, null, true, true, false)}; cu.setHost(reqs); Map<String, String> touchpointData = new HashMap<String, String>(); touchpointData.put("install", "addSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("uninstall", "removeSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createDefaultConfigurationUnitForSourceBundles(String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = createDefaultConfigUnitId("source", configurationFlavor); //$NON-NLS-1$ cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on source providers IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_SOURCE, VersionRange.emptyRange, null, true, true, false)}; cu.setHost(reqs); Map<String, String> touchpointData = new HashMap<String, String>(); touchpointData.put("install", "addSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("uninstall", "removeSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createDefaultBundleConfigurationUnit(GeneratorBundleInfo configInfo, GeneratorBundleInfo unconfigInfo, String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = PublisherHelper.createDefaultConfigUnitId(OSGI_BUNDLE_CLASSIFIER, configurationFlavor); cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {PublisherHelper.createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(PublisherHelper.NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on bundles IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(PublisherHelper.NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_BUNDLE, VersionRange.emptyRange, null, false, true, false)}; cu.setHost(reqs); Map<String, String> touchpointData = new HashMap<String, String>(); touchpointData.put("install", "installBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("uninstall", "uninstallBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("configure", createDefaultBundleConfigScript(configInfo)); //$NON-NLS-1$ touchpointData.put("unconfigure", createDefaultBundleUnconfigScript(unconfigInfo)); //$NON-NLS-1$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createDefaultConfigurationUnitForSourceBundles(String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = createDefaultConfigUnitId("source", configurationFlavor); //$NON-NLS-1$ cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on source providers IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_SOURCE, VersionRange.emptyRange, null, true, true, false)}; cu.setHost(reqs); Map<String, String> touchpointData = new HashMap<>(); touchpointData.put("install", "addSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("uninstall", "removeSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
private void publishExecutableCU(ExecutablesDescriptor execDescriptor, IPublisherResult result) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String id = createCUIdString(idBase, TYPE, flavor, configSpec); cu.setId(id); cu.setVersion(version); cu.setFilter(createFilterSpec(configSpec)); String executableId = getExecutableId(); cu.setHost(new IRequirement[] {MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, executableId, new VersionRange(version, true, version, true), null, false, false)}); cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); //TODO bug 218890, would like the fragment to provide the launcher capability as well, but can't right now. cu.setCapabilities(new IProvidedCapability[] {PublisherHelper.createSelfCapability(id, version)}); cu.setTouchpointType(PublisherHelper.TOUCHPOINT_NATIVE); String[] config = parseConfigSpec(configSpec); String os = config[1]; Map<String, String> touchpointData = computeInstallActions(execDescriptor, os); cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); IInstallableUnit unit = MetadataFactory.createInstallableUnit(cu); result.addIU(unit, IPublisherResult.ROOT); }
public static IInstallableUnit createDefaultFeatureConfigurationUnit(String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = createDefaultConfigUnitId(ECLIPSE_FEATURE_CLASSIFIER, configurationFlavor); cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on features IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_FEATURE, VersionRange.emptyRange, null, true, true, false)}; cu.setHost(reqs); cu.setFilter(INSTALL_FEATURES_FILTER); Map<String, String> touchpointData = new HashMap<>(); touchpointData.put("install", "installFeature(feature:${artifact},featureId:default,featureVersion:default)"); //$NON-NLS-1$//$NON-NLS-2$ touchpointData.put("uninstall", "uninstallFeature(feature:${artifact},featureId:default,featureVersion:default)"); //$NON-NLS-1$//$NON-NLS-2$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
public static IInstallableUnit createDefaultConfigurationUnitForSourceBundles(String configurationFlavor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String configUnitId = createDefaultConfigUnitId("source", configurationFlavor); //$NON-NLS-1$ cu.setId(configUnitId); Version configUnitVersion = Version.createOSGi(1, 0, 0); cu.setVersion(configUnitVersion); // Add capabilities for fragment, self, and describing the flavor supported cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); cu.setCapabilities(new IProvidedCapability[] {createSelfCapability(configUnitId, configUnitVersion), MetadataFactory.createProvidedCapability(NAMESPACE_FLAVOR, configurationFlavor, Version.createOSGi(1, 0, 0))}); // Create a required capability on source providers IRequirement[] reqs = new IRequirement[] {MetadataFactory.createRequirement(NAMESPACE_ECLIPSE_TYPE, TYPE_ECLIPSE_SOURCE, VersionRange.emptyRange, null, true, true, false)}; cu.setHost(reqs); Map<String, String> touchpointData = new HashMap<String, String>(); touchpointData.put("install", "addSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ touchpointData.put("uninstall", "removeSourceBundle(bundle:${artifact})"); //$NON-NLS-1$ //$NON-NLS-2$ cu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); return MetadataFactory.createInstallableUnit(cu); }
private InstallableUnitFragmentDescription createSkeletonExecutableCU(ExecutablesDescriptor execDescriptor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String id = createCUIdString(idBase, TYPE, flavor, configSpec); cu.setId(id); cu.setVersion(version); cu.setFilter(createFilterSpec(configSpec)); String executableId = getExecutableId(); cu.setHost(new IRequirement[] {MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, executableId, new VersionRange(version, true, version, true), null, false, false)}); cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); //TODO bug 218890, would like the fragment to provide the launcher capability as well, but can't right now. cu.setCapabilities(new IProvidedCapability[] {PublisherHelper.createSelfCapability(id, version)}); cu.setTouchpointType(PublisherHelper.TOUCHPOINT_NATIVE); return cu; }
private InstallableUnitFragmentDescription createSkeletonExecutableCU(ExecutablesDescriptor execDescriptor) { InstallableUnitFragmentDescription cu = new InstallableUnitFragmentDescription(); String id = createCUIdString(idBase, TYPE, flavor, configSpec); cu.setId(id); cu.setVersion(version); cu.setFilter(createFilterSpec(configSpec)); String executableId = getExecutableId(); cu.setHost(new IRequirement[] {MetadataFactory.createRequirement(IInstallableUnit.NAMESPACE_IU_ID, executableId, new VersionRange(version, true, version, true), null, false, false)}); cu.setProperty(InstallableUnitDescription.PROP_TYPE_FRAGMENT, Boolean.TRUE.toString()); //TODO bug 218890, would like the fragment to provide the launcher capability as well, but can't right now. cu.setCapabilities(new IProvidedCapability[] {PublisherHelper.createSelfCapability(id, version)}); cu.setTouchpointType(PublisherHelper.TOUCHPOINT_NATIVE); return cu; }