/** * Load the given namespace with version mappings from the properties file at * the given location. The properties file is expected to be in the normal format * produced and consumed by PDE Build. * @param namespace the namespace to populate. If "null" is passed * in, the version will be stored in the "null" namespace * @param location the location of the mapping file */ public void load(String namespace, String location) { load(namespace, location, null); }
public IPublisherAdvice merge(IPublisherAdvice advice) { if (!(advice instanceof VersionAdvice)) return this; VersionAdvice source = (VersionAdvice) advice; for (String namespace : source.versions.keySet()) { Map<String, Version> myValues = versions.get(namespace); Map<String, Version> sourceValues = source.versions.get(namespace); if (myValues == null) versions.put(namespace, sourceValues); else if (sourceValues != null) versions.put(namespace, merge(myValues, sourceValues)); } return this; }
/** * Create and register advice that will tell people what versions of the launcher bundle and * fragments are in use in this particular result. */ private void createLauncherAdvice(IPublisherInfo publisherInfo, IPublisherResult results) { Collection<IInstallableUnit> ius = getIUs(results.getIUs(null, null), EquinoxLauncherCUAction.ORG_ECLIPSE_EQUINOX_LAUNCHER); VersionAdvice advice = new VersionAdvice(); boolean found = false; for (IInstallableUnit iu : ius) { // skip over source bundles and fragments // TODO should we use the source property here rather than magic name matching? if (iu.getId().endsWith(".source") || QueryUtil.isFragment(iu)) //$NON-NLS-1$ continue; advice.setVersion(IInstallableUnit.NAMESPACE_IU_ID, iu.getId(), iu.getVersion()); found = true; } if (found) publisherInfo.addAdvice(advice); }
protected void processParameter(String arg, String parameter, PublisherInfo publisherInfo) throws URISyntaxException { super.processParameter(arg, parameter, publisherInfo); if (arg.equalsIgnoreCase("-productFile")) //$NON-NLS-1$ product = parameter; if (arg.equalsIgnoreCase("-executables")) //$NON-NLS-1$ executables = parameter; if (arg.equalsIgnoreCase("-flavor")) //$NON-NLS-1$ flavor = parameter; if (arg.equalsIgnoreCase("-pluginVersionsAdvice")) { //$NON-NLS-1$ VersionAdvice versionAdvice = new VersionAdvice(); versionAdvice.load(IInstallableUnit.NAMESPACE_IU_ID, parameter, null); info.addAdvice(versionAdvice); } if (arg.equalsIgnoreCase("-featureVersionsAdvice")) { //$NON-NLS-1$ VersionAdvice versionAdvice = new VersionAdvice(); versionAdvice.load(IInstallableUnit.NAMESPACE_IU_ID, parameter, ".feature.group"); //$NON-NLS-1$ info.addAdvice(versionAdvice); } } }
public void load(String namespace, String location, String idSuffix) { File file = new File(location); if (namespace == null) namespace = "null"; //$NON-NLS-1$ Map<String, String> properties; try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) { properties = CollectionUtils.loadProperties(stream); } catch (IOException e) { return; } for (Entry<String, String> entry : properties.entrySet()) { String key = entry.getKey(); if (idSuffix != null) key += idSuffix; setVersion(namespace, key, Version.parseVersion(entry.getValue())); } }
/** * Create and register advice that will tell people what versions of the launcher bundle and * fragments are in use in this particular result. */ private void createLauncherAdvice(IPublisherInfo publisherInfo, IPublisherResult results) { Collection<IInstallableUnit> ius = getIUs(results.getIUs(null, null), EquinoxLauncherCUAction.ORG_ECLIPSE_EQUINOX_LAUNCHER); if (publisherInfo.getContextMetadataRepository() != null) ius.addAll(getIUs(publisherInfo.getContextMetadataRepository().query(QueryUtil.ALL_UNITS, null).toUnmodifiableSet(), EquinoxLauncherCUAction.ORG_ECLIPSE_EQUINOX_LAUNCHER)); VersionAdvice advice = new VersionAdvice(); boolean found = false; for (IInstallableUnit iu : ius) { // skip over source bundles and fragments // TODO should we use the source property here rather than magic name matching? if (iu.getId().endsWith(".source") || QueryUtil.isFragment(iu)) //$NON-NLS-1$ continue; advice.setVersion(IInstallableUnit.NAMESPACE_IU_ID, iu.getId(), iu.getVersion()); found = true; } if (found) publisherInfo.addAdvice(advice); }
@Override protected void processParameter(String arg, String parameter, PublisherInfo publisherInfo) throws URISyntaxException { super.processParameter(arg, parameter, publisherInfo); if (arg.equalsIgnoreCase("-productFile")) //$NON-NLS-1$ product = parameter; if (arg.equalsIgnoreCase("-executables")) //$NON-NLS-1$ executables = parameter; if (arg.equalsIgnoreCase("-flavor")) //$NON-NLS-1$ flavor = parameter; if (arg.equalsIgnoreCase("-jreLocation")) //$NON-NLS-1$ jreLocation = parameter; if (arg.equalsIgnoreCase("-pluginVersionsAdvice")) { //$NON-NLS-1$ VersionAdvice versionAdvice = new VersionAdvice(); versionAdvice.load(IInstallableUnit.NAMESPACE_IU_ID, parameter, null); info.addAdvice(versionAdvice); } if (arg.equalsIgnoreCase("-featureVersionsAdvice")) { //$NON-NLS-1$ VersionAdvice versionAdvice = new VersionAdvice(); versionAdvice.load(IInstallableUnit.NAMESPACE_IU_ID, parameter, ".feature.group"); //$NON-NLS-1$ info.addAdvice(versionAdvice); } } }
public void load(String namespace, String location, String idSuffix) { File file = new File(location); if (namespace == null) namespace = "null"; //$NON-NLS-1$ Map<String, String> properties; InputStream stream = null; try { stream = new BufferedInputStream(new FileInputStream(file)); properties = CollectionUtils.loadProperties(stream); } catch (IOException e) { return; } finally { if (stream != null) try { stream.close(); } catch (IOException e) { //nothing } } for (Entry<String, String> entry : properties.entrySet()) { String key = entry.getKey(); if (idSuffix != null) key += idSuffix; setVersion(namespace, key, Version.parseVersion(entry.getValue())); } }
/** * Create and register advice that will tell people what versions of the launcher bundle and * fragments are in use in this particular result. */ private void createLauncherAdvice(IPublisherInfo publisherInfo, IPublisherResult results) { Collection<IInstallableUnit> ius = getIUs(results.getIUs(null, null), EquinoxLauncherCUAction.ORG_ECLIPSE_EQUINOX_LAUNCHER); if (publisherInfo.getContextMetadataRepository() != null) ius.addAll(getIUs(publisherInfo.getContextMetadataRepository().query(QueryUtil.ALL_UNITS, null).toUnmodifiableSet(), EquinoxLauncherCUAction.ORG_ECLIPSE_EQUINOX_LAUNCHER)); VersionAdvice advice = new VersionAdvice(); boolean found = false; for (IInstallableUnit iu : ius) { // skip over source bundles and fragments // TODO should we use the source property here rather than magic name matching? if (iu.getId().endsWith(".source") || QueryUtil.isFragment(iu)) //$NON-NLS-1$ continue; advice.setVersion(IInstallableUnit.NAMESPACE_IU_ID, iu.getId(), iu.getVersion()); found = true; } if (found) publisherInfo.addAdvice(advice); }
protected void processParameter(String arg, String parameter, PublisherInfo publisherInfo) throws URISyntaxException { super.processParameter(arg, parameter, publisherInfo); if (arg.equalsIgnoreCase("-productFile")) //$NON-NLS-1$ product = parameter; if (arg.equalsIgnoreCase("-executables")) //$NON-NLS-1$ executables = parameter; if (arg.equalsIgnoreCase("-flavor")) //$NON-NLS-1$ flavor = parameter; if (arg.equalsIgnoreCase("-jreLocation")) //$NON-NLS-1$ jreLocation = parameter; if (arg.equalsIgnoreCase("-pluginVersionsAdvice")) { //$NON-NLS-1$ VersionAdvice versionAdvice = new VersionAdvice(); versionAdvice.load(IInstallableUnit.NAMESPACE_IU_ID, parameter, null); info.addAdvice(versionAdvice); } if (arg.equalsIgnoreCase("-featureVersionsAdvice")) { //$NON-NLS-1$ VersionAdvice versionAdvice = new VersionAdvice(); versionAdvice.load(IInstallableUnit.NAMESPACE_IU_ID, parameter, ".feature.group"); //$NON-NLS-1$ info.addAdvice(versionAdvice); } } }
/** * Load the given namespace with version mappings from the properties file at * the given location. The properties file is expected to be in the normal format * produced and consumed by PDE Build. * @param namespace the namespace to populate. If "null" is passed * in, the version will be stored in the "null" namespace * @param location the location of the mapping file */ public void load(String namespace, String location) { load(namespace, location, null); }
public void load(String namespace, String location, String idSuffix) { File file = new File(location); if (namespace == null) namespace = "null"; //$NON-NLS-1$ Map<String, String> properties; InputStream stream = null; try { stream = new BufferedInputStream(new FileInputStream(file)); properties = CollectionUtils.loadProperties(stream); } catch (IOException e) { return; } finally { if (stream != null) try { stream.close(); } catch (IOException e) { //nothing } } for (Entry<String, String> entry : properties.entrySet()) { String key = entry.getKey(); if (idSuffix != null) key += idSuffix; setVersion(namespace, key, Version.parseVersion(entry.getValue())); } }
public IPublisherAdvice merge(IPublisherAdvice advice) { if (!(advice instanceof VersionAdvice)) return this; VersionAdvice source = (VersionAdvice) advice; for (String namespace : source.versions.keySet()) { Map<String, Version> myValues = versions.get(namespace); Map<String, Version> sourceValues = source.versions.get(namespace); if (myValues == null) versions.put(namespace, sourceValues); else if (sourceValues != null) versions.put(namespace, merge(myValues, sourceValues)); } return this; }
/** * Load the given namespace with version mappings from the properties file at * the given location. The properties file is expected to be in the normal format * produced and consumed by PDE Build. * @param namespace the namespace to populate. If "null" is passed * in, the version will be stored in the "null" namespace * @param location the location of the mapping file */ public void load(String namespace, String location) { load(namespace, location, null); }
public void load(String namespace, String location, String idSuffix) { File file = new File(location); if (namespace == null) namespace = "null"; //$NON-NLS-1$ Map<String, String> properties; InputStream stream = null; try { stream = new BufferedInputStream(new FileInputStream(file)); properties = CollectionUtils.loadProperties(stream); } catch (IOException e) { return; } finally { if (stream != null) try { stream.close(); } catch (IOException e) { //nothing } } for (Entry<String, String> entry : properties.entrySet()) { String key = entry.getKey(); if (idSuffix != null) key += idSuffix; setVersion(namespace, key, Version.parseVersion(entry.getValue())); } }
public IPublisherAdvice merge(IPublisherAdvice advice) { if (!(advice instanceof VersionAdvice)) return this; VersionAdvice source = (VersionAdvice) advice; for (String namespace : source.versions.keySet()) { Map<String, Version> myValues = versions.get(namespace); Map<String, Version> sourceValues = source.versions.get(namespace); if (myValues == null) versions.put(namespace, sourceValues); else if (sourceValues != null) versions.put(namespace, merge(myValues, sourceValues)); } return this; }
/** * Load the given namespace with version mappings from the properties file at * the given location. The properties file is expected to be in the normal format * produced and consumed by PDE Build. * @param namespace the namespace to populate. If "null" is passed * in, the version will be stored in the "null" namespace * @param location the location of the mapping file */ public void load(String namespace, String location) { load(namespace, location, null); }
public IPublisherAdvice merge(IPublisherAdvice advice) { if (!(advice instanceof VersionAdvice)) return this; VersionAdvice source = (VersionAdvice) advice; for (String namespace : source.versions.keySet()) { Map<String, Version> myValues = versions.get(namespace); Map<String, Version> sourceValues = source.versions.get(namespace); if (myValues == null) versions.put(namespace, sourceValues); else if (sourceValues != null) versions.put(namespace, merge(myValues, sourceValues)); } return this; }