Tabnine Logo
IPublisherInfo
Code IndexAdd Tabnine to your IDE (free)

How to use
IPublisherInfo
in
org.eclipse.equinox.p2.publisher

Best Java code snippets using org.eclipse.equinox.p2.publisher.IPublisherInfo (Showing top 20 results out of 315)

origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.publisher

/**
 * Creates an artifact descriptor for the given key and path.
 * @param info the publisher info
 * @param key the key of the artifact to publish
 * @param pathOnDisk the path of the artifact on disk
 * @return a new artifact descriptor
 */
public static IArtifactDescriptor createArtifactDescriptor(IPublisherInfo info, IArtifactKey key, File pathOnDisk) {
  return createArtifactDescriptor(info, info.getArtifactRepository(), key, pathOnDisk);
}
origin: org.eclipse.platform/org.eclipse.equinox.p2.publisher

/**
 * Loop over the known metadata repositories looking for the given IU within a particular range
 * @param publisherResult
 * @param iuId the id of the IU to look for
 * @param versionRange the version range to consider
 * @return The the IUs with the matching ids in the given range
 */
protected IQueryResult<IInstallableUnit> queryForIUs(IPublisherResult publisherResult, String iuId, VersionRange versionRange) {
  IQuery<IInstallableUnit> query = null;
  IQueryResult<IInstallableUnit> queryResult = Collector.emptyCollector();
  query = QueryUtil.createIUQuery(iuId, versionRange);
  NullProgressMonitor progress = new NullProgressMonitor();
  if (publisherResult != null)
    queryResult = publisherResult.query(query, progress);
  if (queryResult.isEmpty() && info.getMetadataRepository() != null)
    queryResult = info.getMetadataRepository().query(query, progress);
  if (queryResult.isEmpty() && info.getContextMetadataRepository() != null)
    queryResult = info.getContextMetadataRepository().query(query, progress);
  return queryResult;
}
origin: org.eclipse.osgi/org.eclipse.equinox.p2.publisher.eclipse

private IBrandingAdvice getBrandingAdvice() {
  // there is expected to only be one branding advice for a given configspec so
  // just return the first one we find.
  Collection<IBrandingAdvice> advice = info.getAdvice(configSpec, true, null, null, IBrandingAdvice.class);
  for (Iterator<IBrandingAdvice> i = advice.iterator(); i.hasNext();)
    return i.next();
  return null;
}
origin: org.eclipse.osgi/org.eclipse.equinox.p2.publisher.eclipse

protected void createRootFilesAdvice() {
  File[] baseExclusions = computeRootFileExclusions();
  if (baseExclusions != null)
    info.addAdvice(new RootFilesAdvice(null, null, baseExclusions, null));
  String[] configs = info.getConfigurations();
  for (int i = 0; i < configs.length; i++)
    info.addAdvice(computeRootFileAdvice(configs[i]));
}
origin: org.eclipse.equinox.p2/updatesite

  protected Transport getTransport(IPublisherInfo info) {
    @SuppressWarnings("rawtypes")
    IRepository repo = info.getMetadataRepository();
    if (repo == null)
      repo = info.getArtifactRepository();
    if (repo == null)
      throw new IllegalStateException("The transport service can not be found."); //$NON-NLS-1$
    return (Transport) repo.getProvisioningAgent().getService(Transport.SERVICE_NAME);
  }
}
origin: org.eclipse.osgi/org.eclipse.equinox.p2.publisher.eclipse

@Override
protected void publishArtifact(IArtifactDescriptor descriptor, File jarFile, IPublisherInfo publisherInfo) {
  // no files to publish so this is done.
  if (jarFile == null || publisherInfo == null)
    return;
  // if the destination already contains the descriptor, there is nothing to do.
  IArtifactRepository destination = publisherInfo.getArtifactRepository();
  if (destination == null || destination.contains(descriptor))
    return;
  super.publishArtifact(descriptor, jarFile, publisherInfo);
  // if we are assimilating pack200 files then add the packed descriptor
  // into the repo assuming it does not already exist.
  boolean reuse = "true".equals(destination.getProperties().get(AbstractPublisherApplication.PUBLISH_PACK_FILES_AS_SIBLINGS)); //$NON-NLS-1$
  if (reuse && (publisherInfo.getArtifactOptions() & IPublisherInfo.A_PUBLISH) > 0) {
    File packFile = new Path(jarFile.getAbsolutePath()).addFileExtension("pack.gz").toFile(); //$NON-NLS-1$
    if (packFile.exists()) {
      IArtifactDescriptor ad200 = createPack200ArtifactDescriptor(descriptor.getArtifactKey(), packFile, descriptor.getProperty(IArtifactDescriptor.ARTIFACT_SIZE));
      publishArtifact(ad200, packFile, publisherInfo);
    }
  }
}
origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.publisher

  protected void savePublishedIUs() {
    IMetadataRepository metadataRepository = info.getMetadataRepository();
    if (metadataRepository != null) {
      Collection<IInstallableUnit> ius = results.getIUs(null, null);
      metadataRepository.addInstallableUnits(ius);
    }
  }
}
origin: org.eclipse.platform/org.eclipse.equinox.p2.publisher.eclipse

protected IPublisherAction[] createActions() {
  createAdvice();
  ArrayList<IPublisherAction> actions = new ArrayList<>();
  // create an action that just publishes the raw bundles and features
  IPublisherAction action = new MergeResultsAction(new IPublisherAction[] {createFeaturesAction(), createBundlesAction()}, IPublisherResult.MERGE_ALL_ROOT);
  actions.add(action);
  actions.add(createApplicationExecutableAction(info.getConfigurations()));
  actions.add(createRootFilesAction());
  actions.addAll(createAccumulateConfigDataActions(info.getConfigurations()));
  actions.add(createJREAction());
  actions.add(createConfigCUsAction());
  actions.add(createDefaultCUsAction());
  actions.add(createRootIUAction());
  return actions.toArray(new IPublisherAction[actions.size()]);
}
origin: org.eclipse.platform/org.eclipse.equinox.p2.publisher.eclipse

@Override
public IStatus perform(IPublisherInfo publisherInfo, IPublisherResult results, IProgressMonitor monitor) {
  IPublisherResult innerResult = new PublisherResult();
  this.outerResults = results;
  this.info = publisherInfo;
  // we have N platforms, generate a CU for each
  // TODO try and find common properties across platforms
  String[] configSpecs = publisherInfo.getConfigurations();
  for (int i = 0; i < configSpecs.length; i++) {
    if (monitor.isCanceled())
      return Status.CANCEL_STATUS;
    String configSpec = configSpecs[i];
    Collection<IConfigAdvice> configAdvice = publisherInfo.getAdvice(configSpec, false, id, version, IConfigAdvice.class);
    BundleInfo[] bundles = fillInBundles(configAdvice, results);
    publishBundleCUs(publisherInfo, bundles, configSpec, innerResult);
    publishConfigIUs(configAdvice, innerResult, configSpec);
    Collection<IExecutableAdvice> launchingAdvice = publisherInfo.getAdvice(configSpec, false, id, version, IExecutableAdvice.class);
    publishIniIUs(launchingAdvice, innerResult, configSpec);
  }
  // merge the IUs  into the final result as non-roots and create a parent IU that captures them all
  results.merge(innerResult, IPublisherResult.MERGE_ALL_NON_ROOT);
  publishTopLevelConfigurationIU(innerResult.getIUs(null, IPublisherResult.ROOT), results);
  return Status.OK_STATUS;
}
origin: org.eclipse.platform/org.eclipse.equinox.p2.publisher

private static IArtifactDescriptor createArtifactDescriptor(IPublisherInfo info, IArtifactRepository artifactRepo, IArtifactKey key, File pathOnDisk) {
  IArtifactDescriptor result = artifactRepo != null ? artifactRepo.createArtifactDescriptor(key) : new ArtifactDescriptor(key);
  if (result instanceof ArtifactDescriptor) {
    if (pathOnDisk != null && pathOnDisk.isFile()) {
      ArtifactDescriptor descriptor = (ArtifactDescriptor) result;
      descriptor.setProperty(IArtifactDescriptor.ARTIFACT_SIZE, Long.toString(pathOnDisk.length()));
      descriptor.setProperty(IArtifactDescriptor.DOWNLOAD_SIZE, Long.toString(pathOnDisk.length()));
      boolean generateChecksums = info == null || (info.getArtifactOptions() & IPublisherInfo.A_NO_MD5) == 0;
      if (generateChecksums) {
        calculateChecksums(pathOnDisk, descriptor);
      }
    }
  }
  return result;
}
origin: org.eclipse.platform/org.eclipse.equinox.p2.publisher.eclipse

/**
 * 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);
}
origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.publisher.eclipse

protected void createRootAdvice() {
  if (topLevel != null)
    info.addAdvice(new RootIUAdvice(getTopLevel()));
  info.addAdvice(new RootIUResultFilterAdvice(null));
}
origin: org.eclipse.platform/org.eclipse.equinox.p2.publisher.eclipse

@Override
protected void publishArtifact(IArtifactDescriptor descriptor, File jarFile, IPublisherInfo publisherInfo) {
  // no files to publish so this is done.
  if (jarFile == null || publisherInfo == null)
    return;
  // if the destination already contains the descriptor, there is nothing to do.
  IArtifactRepository destination = publisherInfo.getArtifactRepository();
  if (destination == null || destination.contains(descriptor))
    return;
  super.publishArtifact(descriptor, jarFile, publisherInfo);
  // if we are assimilating pack200 files then add the packed descriptor
  // into the repo assuming it does not already exist.
  boolean reuse = "true".equals(destination.getProperties().get(AbstractPublisherApplication.PUBLISH_PACK_FILES_AS_SIBLINGS)); //$NON-NLS-1$
  if (reuse && (publisherInfo.getArtifactOptions() & IPublisherInfo.A_PUBLISH) > 0) {
    File packFile = new Path(jarFile.getAbsolutePath()).addFileExtension("pack.gz").toFile(); //$NON-NLS-1$
    if (packFile.exists()) {
      IArtifactDescriptor ad200 = createPack200ArtifactDescriptor(descriptor.getArtifactKey(), packFile, descriptor.getProperty(IArtifactDescriptor.ARTIFACT_SIZE));
      publishArtifact(ad200, packFile, publisherInfo);
    }
  }
}
origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.publisher.eclipse

protected void createRootFilesAdvice() {
  File[] baseExclusions = computeRootFileExclusions();
  if (baseExclusions != null)
    info.addAdvice(new RootFilesAdvice(null, null, baseExclusions, null));
  String[] configs = info.getConfigurations();
  for (int i = 0; i < configs.length; i++)
    info.addAdvice(computeRootFileAdvice(configs[i]));
}
origin: org.eclipse.platform/org.eclipse.equinox.p2.publisher

  protected void savePublishedIUs() {
    IMetadataRepository metadataRepository = info.getMetadataRepository();
    if (metadataRepository != null) {
      Collection<IInstallableUnit> ius = results.getIUs(null, null);
      metadataRepository.addInstallableUnits(ius);
    }
  }
}
origin: org.eclipse.osgi/org.eclipse.equinox.p2.publisher.eclipse

protected IPublisherAction[] createActions() {
  createAdvice();
  ArrayList<IPublisherAction> actions = new ArrayList<IPublisherAction>();
  // create an action that just publishes the raw bundles and features
  IPublisherAction action = new MergeResultsAction(new IPublisherAction[] {createFeaturesAction(), createBundlesAction()}, IPublisherResult.MERGE_ALL_ROOT);
  actions.add(action);
  actions.add(createApplicationExecutableAction(info.getConfigurations()));
  actions.add(createRootFilesAction());
  actions.addAll(createAccumulateConfigDataActions(info.getConfigurations()));
  actions.add(createJREAction());
  actions.add(createConfigCUsAction());
  actions.add(createDefaultCUsAction());
  actions.add(createRootIUAction());
  return actions.toArray(new IPublisherAction[actions.size()]);
}
origin: org.eclipse.osgi/org.eclipse.equinox.p2.publisher.eclipse

public IStatus perform(IPublisherInfo publisherInfo, IPublisherResult results, IProgressMonitor monitor) {
  IPublisherResult innerResult = new PublisherResult();
  this.outerResults = results;
  this.info = publisherInfo;
  // we have N platforms, generate a CU for each
  // TODO try and find common properties across platforms
  String[] configSpecs = publisherInfo.getConfigurations();
  for (int i = 0; i < configSpecs.length; i++) {
    if (monitor.isCanceled())
      return Status.CANCEL_STATUS;
    String configSpec = configSpecs[i];
    Collection<IConfigAdvice> configAdvice = publisherInfo.getAdvice(configSpec, false, id, version, IConfigAdvice.class);
    BundleInfo[] bundles = fillInBundles(configAdvice, results);
    publishBundleCUs(publisherInfo, bundles, configSpec, innerResult);
    publishConfigIUs(configAdvice, innerResult, configSpec);
    Collection<IExecutableAdvice> launchingAdvice = publisherInfo.getAdvice(configSpec, false, id, version, IExecutableAdvice.class);
    publishIniIUs(launchingAdvice, innerResult, configSpec);
  }
  // merge the IUs  into the final result as non-roots and create a parent IU that captures them all
  results.merge(innerResult, IPublisherResult.MERGE_ALL_NON_ROOT);
  publishTopLevelConfigurationIU(innerResult.getIUs(null, IPublisherResult.ROOT), results);
  return Status.OK_STATUS;
}
origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.publisher

private static IArtifactDescriptor createArtifactDescriptor(IPublisherInfo info, IArtifactRepository artifactRepo, IArtifactKey key, File pathOnDisk) {
  IArtifactDescriptor result = artifactRepo != null ? artifactRepo.createArtifactDescriptor(key) : new ArtifactDescriptor(key);
  if (result instanceof ArtifactDescriptor) {
    ArtifactDescriptor descriptor = (ArtifactDescriptor) result;
    if (pathOnDisk != null) {
      descriptor.setProperty(IArtifactDescriptor.ARTIFACT_SIZE, Long.toString(pathOnDisk.length()));
      descriptor.setProperty(IArtifactDescriptor.DOWNLOAD_SIZE, Long.toString(pathOnDisk.length()));
    }
    if (info == null || (info.getArtifactOptions() & IPublisherInfo.A_NO_MD5) == 0) {
      String md5 = computeMD5(pathOnDisk);
      if (md5 != null)
        descriptor.setProperty(IArtifactDescriptor.DOWNLOAD_MD5, md5);
    }
  }
  return result;
}
origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.publisher.eclipse

/**
 * 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);
}
origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.publisher.eclipse

  protected void storeConfigData(IPublisherInfo publisherInfo, String config, IPublisherResult result) {
    ConfigData data = loader.getConfigData();
    if (data == null)
      return;
    publisherInfo.addAdvice(new ConfigAdvice(data, config));
    LauncherData launcherData = loader.getLauncherData();
    if (launcherData == null)
      return;
    publisherInfo.addAdvice(new LaunchingAdvice(launcherData, config));
  }
}
org.eclipse.equinox.p2.publisherIPublisherInfo

Most used methods

  • getArtifactRepository
    Returns the artifact repository into which any publishable artifacts are published or null if none.
  • getMetadataRepository
    Returns the metadata repository into which any publishable metadata is published or null if none.
  • getAdvice
  • getArtifactOptions
    Returns whether or not artifacts themselves should be published.
  • getConfigurations
    Returns the configurations being published. Each configuration is a string of the form ws.os.arch de
  • getContextMetadataRepository
    Returns the metadata repository given to the publisher as context for the publisher actions. May be
  • addAdvice
    Add the given advice to the set of publishing advices.

Popular in Java

  • Making http post requests using okhttp
  • addToBackStack (FragmentTransaction)
  • getSystemService (Context)
  • putExtra (Intent)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • ImageIO (javax.imageio)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now