protected void generateDefaultConfigIU(IPublisherResult result) { // TODO this is a bit of a hack. We need to have the default IU fragment generated with code that configures // and unconfigures. The Generator should be decoupled from any particular provider but it is not clear // that we should add the create* methods to IGeneratorInfo... // MockBundleDescription bd1 = new MockBundleDescription("defaultConfigure"); // MockBundleDescription bd2 = new MockBundleDescription("defaultUnconfigure"); result.addIU(BundlesAction.createDefaultBundleConfigurationUnit(createDefaultConfigurationBundleInfo(), createDefaultUnconfigurationBundleInfo(), flavor), IPublisherResult.ROOT); result.addIU(PublisherHelper.createDefaultFeatureConfigurationUnit(flavor), IPublisherResult.ROOT); result.addIU(PublisherHelper.createDefaultConfigurationUnitForSourceBundles(flavor), IPublisherResult.ROOT); }
protected void generateDefaultConfigIU(IPublisherResult result) { // TODO this is a bit of a hack. We need to have the default IU fragment generated with code that configures // and unconfigures. The Generator should be decoupled from any particular provider but it is not clear // that we should add the create* methods to IGeneratorInfo... // MockBundleDescription bd1 = new MockBundleDescription("defaultConfigure"); // MockBundleDescription bd2 = new MockBundleDescription("defaultUnconfigure"); result.addIU(BundlesAction.createDefaultBundleConfigurationUnit(createDefaultConfigurationBundleInfo(), createDefaultUnconfigurationBundleInfo(), flavor), IPublisherResult.ROOT); result.addIU(PublisherHelper.createDefaultFeatureConfigurationUnit(flavor), IPublisherResult.ROOT); result.addIU(PublisherHelper.createDefaultConfigurationUnitForSourceBundles(flavor), IPublisherResult.ROOT); }
protected void generateDefaultConfigIU(IPublisherResult result) { // TODO this is a bit of a hack. We need to have the default IU fragment generated with code that configures // and unconfigures. The Generator should be decoupled from any particular provider but it is not clear // that we should add the create* methods to IGeneratorInfo... // MockBundleDescription bd1 = new MockBundleDescription("defaultConfigure"); // MockBundleDescription bd2 = new MockBundleDescription("defaultUnconfigure"); result.addIU(BundlesAction.createDefaultBundleConfigurationUnit(createDefaultConfigurationBundleInfo(), createDefaultUnconfigurationBundleInfo(), flavor), IPublisherResult.ROOT); result.addIU(PublisherHelper.createDefaultFeatureConfigurationUnit(flavor), IPublisherResult.ROOT); result.addIU(PublisherHelper.createDefaultConfigurationUnitForSourceBundles(flavor), IPublisherResult.ROOT); }
/** * Publish the IUs that capture the config.ini information such as properties etc */ private void publishConfigIUs(Collection<IConfigAdvice> configAdvice, IPublisherResult results, String configSpec) { if (configAdvice.isEmpty()) return; String configureData = ""; //$NON-NLS-1$ String unconfigureData = ""; //$NON-NLS-1$ if (!configAdvice.isEmpty()) { String[] dataStrings = getConfigurationStrings(configAdvice); configureData += dataStrings[0]; unconfigureData += dataStrings[1]; } // if there is nothing to configure or unconfigure, then don't even bother generating this IU if (configureData.length() == 0 && unconfigureData.length() == 0) return; Map<String, String> touchpointData = new HashMap<>(); touchpointData.put("configure", configureData); //$NON-NLS-1$ touchpointData.put("unconfigure", unconfigureData); //$NON-NLS-1$ IInstallableUnit cu = createCU(id, version, "config", flavor, configSpec, touchpointData); //$NON-NLS-1$ results.addIU(cu, IPublisherResult.ROOT); }
private void publishTopLevelRootFilesIU(Collection<? extends IVersionedId> children, IPublisherResult result) { InstallableUnitDescription descriptor = createParentIU(children, computeIUId(idBase, flavor), version); descriptor.setSingleton(true); IInstallableUnit rootIU = MetadataFactory.createInstallableUnit(descriptor); if (rootIU == null) return; result.addIU(rootIU, IPublisherResult.ROOT); }
private void publishTopLevelConfigurationIU(Collection<? extends IVersionedId> children, IPublisherResult result) { InstallableUnitDescription descriptor = createParentIU(children, computeIUId(id, flavor), version); descriptor.setSingleton(true); IInstallableUnit rootIU = MetadataFactory.createInstallableUnit(descriptor); if (rootIU == null) return; result.addIU(rootIU, IPublisherResult.ROOT); }
private void publishApplicationLauncherIU(Collection<? extends IVersionedId> children, IPublisherResult result) { InstallableUnitDescription descriptor = createParentIU(children, computeIUId(id, flavor), version); descriptor.setSingleton(true); IInstallableUnit rootIU = MetadataFactory.createInstallableUnit(descriptor); if (rootIU == null) return; result.addIU(rootIU, IPublisherResult.ROOT); }
private void publishTopLevelRootFilesIU(Collection<? extends IVersionedId> children, IPublisherResult result) { InstallableUnitDescription descriptor = createParentIU(children, computeIUId(idBase, flavor), version); descriptor.setSingleton(true); IInstallableUnit rootIU = MetadataFactory.createInstallableUnit(descriptor); if (rootIU == null) return; result.addIU(rootIU, IPublisherResult.ROOT); }
private void publishTopLevelRootFilesIU(Collection<? extends IVersionedId> children, IPublisherResult result) { InstallableUnitDescription descriptor = createParentIU(children, computeIUId(idBase, flavor), version); descriptor.setSingleton(true); IInstallableUnit rootIU = MetadataFactory.createInstallableUnit(descriptor); if (rootIU == null) return; result.addIU(rootIU, IPublisherResult.ROOT); }
private void publishTopLevelConfigurationIU(Collection<? extends IVersionedId> children, IPublisherResult result) { InstallableUnitDescription descriptor = createParentIU(children, computeIUId(id, flavor), version); descriptor.setSingleton(true); IInstallableUnit rootIU = MetadataFactory.createInstallableUnit(descriptor); if (rootIU == null) return; result.addIU(rootIU, IPublisherResult.ROOT); }
private void publishTopLevelConfigurationIU(Collection<? extends IVersionedId> children, IPublisherResult result) { InstallableUnitDescription descriptor = createParentIU(children, computeIUId(id, flavor), version); descriptor.setSingleton(true); IInstallableUnit rootIU = MetadataFactory.createInstallableUnit(descriptor); if (rootIU == null) return; result.addIU(rootIU, IPublisherResult.ROOT); }
private void publishTopLevelRootFilesIU(Collection<? extends IVersionedId> children, IPublisherResult result) { InstallableUnitDescription descriptor = createParentIU(children, computeIUId(idBase, flavor), version); descriptor.setSingleton(true); IInstallableUnit rootIU = MetadataFactory.createInstallableUnit(descriptor); if (rootIU == null) return; result.addIU(rootIU, IPublisherResult.ROOT); }
private void publishApplicationLauncherIU(Collection<? extends IVersionedId> children, IPublisherResult result) { InstallableUnitDescription descriptor = createParentIU(children, computeIUId(id, flavor), version); descriptor.setSingleton(true); IInstallableUnit rootIU = MetadataFactory.createInstallableUnit(descriptor); if (rootIU == null) return; result.addIU(rootIU, IPublisherResult.ROOT); }
private void publishApplicationLauncherIU(Collection<? extends IVersionedId> children, IPublisherResult result) { InstallableUnitDescription descriptor = createParentIU(children, computeIUId(id, flavor), version); descriptor.setSingleton(true); IInstallableUnit rootIU = MetadataFactory.createInstallableUnit(descriptor); if (rootIU == null) return; result.addIU(rootIU, IPublisherResult.ROOT); }
protected IStatus generateRootIU(IPublisherResult result) { Collection<? extends IVersionedId> children = getChildren(result); InstallableUnitDescription descriptor = createTopLevelIUDescription(children, null, false); processUpdateDescriptorAdvice(descriptor, info); processCapabilityAdvice(descriptor, info); processTouchpointAdvice(descriptor, null, info); processInstallableUnitPropertiesAdvice(descriptor, info); processLicense(descriptor, info); IInstallableUnit rootIU = MetadataFactory.createInstallableUnit(descriptor); if (rootIU == null) return new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.error_rootIU_generation, new Object[] {name, id, version})); result.addIU(rootIU, IPublisherResult.NON_ROOT); InstallableUnitDescription[] others = processAdditionalInstallableUnitsAdvice(rootIU, info); for (int iuIndex = 0; others != null && iuIndex < others.length; iuIndex++) { result.addIU(MetadataFactory.createInstallableUnit(others[iuIndex]), IPublisherResult.ROOT); } return Status.OK_STATUS; // TODO why do we create a category here? // result.addIU(generateDefaultCategory(rootIU, rootCategory), IPublisherResult.NON_ROOT); }
private void publishExecutableCU(ExecutablesDescriptor execDescriptor, IPublisherResult result) { InstallableUnitFragmentDescription cu = createSkeletonExecutableCU(execDescriptor); 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); }
private void publishExecutableCU(ExecutablesDescriptor execDescriptor, IPublisherResult result) { InstallableUnitFragmentDescription cu = createSkeletonExecutableCU(execDescriptor); 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); }
/** * Publishes the IUs that cause the executable to be actually set as the launcher for * the profile */ private void publishExecutableSetter(ExecutablesDescriptor brandedExecutables, IPublisherResult result) { InstallableUnitDescription iud = new MetadataFactory.InstallableUnitDescription(); String executableName = brandedExecutables.getExecutableName(); String id = getExecutableId() + '.' + executableName; iud.setId(id); iud.setVersion(version); iud.setTouchpointType(PublisherHelper.TOUCHPOINT_OSGI); iud.setCapabilities(new IProvidedCapability[] {createSelfCapability(id, version)}); iud.setFilter(createFilterSpec(configSpec)); Map<String, String> touchpointData = new HashMap<String, String>(); touchpointData.put("configure", "setLauncherName(name:" + executableName + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ touchpointData.put("unconfigure", "setLauncherName()"); //$NON-NLS-1$ //$NON-NLS-2$ iud.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); result.addIU(MetadataFactory.createInstallableUnit(iud), IPublisherResult.ROOT); }
/** * Publishes the IUs that cause the executable to be actually set as the launcher for * the profile */ private void publishExecutableSetter(ExecutablesDescriptor brandedExecutables, IPublisherResult result) { InstallableUnitDescription iud = new MetadataFactory.InstallableUnitDescription(); String executableName = brandedExecutables.getExecutableName(); String id = getExecutableId() + '.' + executableName; iud.setId(id); iud.setVersion(version); iud.setTouchpointType(PublisherHelper.TOUCHPOINT_OSGI); iud.setCapabilities(new IProvidedCapability[] {createSelfCapability(id, version)}); iud.setFilter(createFilterSpec(configSpec)); Map<String, String> touchpointData = new HashMap<>(); touchpointData.put("configure", "setLauncherName(name:" + executableName + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ touchpointData.put("unconfigure", "setLauncherName()"); //$NON-NLS-1$ //$NON-NLS-2$ iud.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData)); result.addIU(MetadataFactory.createInstallableUnit(iud), IPublisherResult.ROOT); }
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); }