Package org.eclipse.pde.core.plugin

Examples of org.eclipse.pde.core.plugin.IPluginModelBase


              Status.ERROR,
              PLUGIN_ID,
              "Unable to find any Apache Felix main bundle (org.apache.felix.main) in the workspace or the Target Platform."));
    // Find the selected apache felix bundle version
    Version targetVersion = findTargetApacheFelixVersion(configuration);
    IPluginModelBase apacheFelixBundle = null;
    if (targetVersion != null) {
      for (int i = 0; i < apacheFelixBundles.length; i++) {
        if (apacheFelixBundles[i].getBundleDescription().getVersion()
            .equals(targetVersion)) {
          apacheFelixBundle = apacheFelixBundles[i];
          break;
        }
      }
      if (apacheFelixBundle == null) {
        throw new CoreException(
            new Status(
                Status.ERROR,
                PLUGIN_ID,
                "Could not find bundle location for selected Apache Felix Main version "
                    + targetVersion
                    + " among Apache Felix Main bundles found in target platform "
                    + Arrays.toString(apacheFelixBundles)));
      }
    } else {
      apacheFelixBundle = apacheFelixBundles[0];
    }
    if (apacheFelixBundle.getInstallLocation() == null)
      throw new CoreException(
          new Status(
              Status.ERROR,
              PLUGIN_ID,
              "Found Felix plugin in workspace, but unable to find its corresponding JAR file."));
    classpath.add(apacheFelixBundle.getInstallLocation());

    Version felixBundleVersion = apacheFelixBundle.getBundleDescription()
        .getVersion();
    int major = felixBundleVersion.getMajor();
    int minor = felixBundleVersion.getMinor();
    Collection<String> felix42LauncherClasspath = calculateNeededClassPath(LAUNCHER_PLUGIN_ID_FELIX42);
    Collection<String> legacyLauncherClasspath = calculateNeededClassPath(LAUNCHER_PLUGIN_ID_LEGACY);
View Full Code Here


   *             workspace or Eclipse installation.
   */
  private Collection<String> calculateNeededClassPath(String pluginId)
      throws CoreException {
    ArrayList<String> classpath = new ArrayList<String>();
    IPluginModelBase model = PluginRegistry.findModel(pluginId);
    if (model != null && model.getUnderlyingResource() == null) {
      classpath.add(model.getInstallLocation());
      return classpath;
    }
    Bundle bundle = Platform.getBundle(pluginId);
    if (bundle != null) {
      try {
View Full Code Here

          bundles = new ArrayList<String>();
          installLevelBundles.put(plugin.startLevel, bundles);
        }
      }

      IPluginModelBase pluginModelBase = findBundleModel(
          plugin.bundleName, plugin.version);
      if (pluginModelBase == null) {
        throw new CoreException(new Status(Status.ERROR, PLUGIN_ID,
            "Unable to load plugin model for bundle '"
                + plugin.bundleName + "' version "
                + plugin.version));
      }
      bundles.add(protocol + ":" + pluginModelBase.getInstallLocation());
    }
  }
View Full Code Here

        // see org.eclipse.pde.internal.ui.wizards.tools.UpdateClasspathJob
        // PDE populates the model cache lazily from WorkspacePluginModelManager.visit() ResourceChangeListenter
        // That means the model may be available or not at this point in the lifecycle.
        // If it is, update its classpath right away.
        // If not add the project to the list to be updated later based on model change events.
        IPluginModelBase model = PluginRegistry.findModel( project );
        if ( model != null )
        {
            setClasspath( project, model, monitor );
        }
        else
View Full Code Here

            importMavenProject( "projects/maven-bundle-plugin/embed-dependency/maven", "pom.xml" );
        maven.getProject().build( IncrementalProjectBuilder.FULL_BUILD, monitor );
        workspace.build( IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor );
        waitForJobsToComplete();

        IPluginModelBase model = PluginRegistry.findModel( maven.getProject() );
        assertNotNull( model );

        IJavaProject javaProject = JavaCore.create( maven.getProject() );
        IClasspathEntry[] cp = javaProject.getRawClasspath();
        IClasspathEntry mavenContainer = getClasspathEntry( cp, new Path( IClasspathManager.CONTAINER_ID ) );
View Full Code Here

            importProjectAndAssertLifecycleMappingType( "projects/lifecyclemapping", "tycho-eclipse-plugin/pom.xml" );

        IProject project = facade.getProject();
        assertTrue( project.hasNature( PDE.PLUGIN_NATURE ) );
        assertTrue( project.hasNature( JavaCore.NATURE_ID ) );
        IPluginModelBase model = PluginRegistry.findModel( project );
        assertNotNull( model );

        IClasspathEntry[] classpathEntries =
            ClasspathComputer.getClasspath( project, model, null /* sourceLibraryMap */, false /* clear */, true /* overrideCompliance */);
        assertEquals( 2, classpathEntries.length );
View Full Code Here

                                                        "tycho-eclipse-test-plugin/pom.xml" );

        IProject project = facade.getProject();
        assertTrue( project.hasNature( PDE.PLUGIN_NATURE ) );
        assertTrue( project.hasNature( JavaCore.NATURE_ID ) );
        IPluginModelBase model = PluginRegistry.findModel( project );
        assertNotNull( model );

        IClasspathEntry[] classpathEntries =
            ClasspathComputer.getClasspath( project, model, null /* sourceLibraryMap */, false /* clear */, true /* overrideCompliance */);
        assertEquals( 2, classpathEntries.length );
View Full Code Here

            importProjectAndAssertLifecycleMappingType( "projects/local-jar-classpath", "pom.xml" );

        IProject project = facade.getProject();
        assertTrue( project.hasNature( PDE.PLUGIN_NATURE ) );
        assertTrue( project.hasNature( JavaCore.NATURE_ID ) );
        IPluginModelBase model = PluginRegistry.findModel( project );
        assertNotNull( model );

        IJavaProject jproject = JavaCore.create( project );
        assertNotNull( jproject );
        IClasspathEntry[] classpathEntries = jproject.getRawClasspath();
View Full Code Here

            getTriggerBundlePlatformFactoryMap();

        for (Map.Entry<String, IConfigurationElement> e : triggerBundleMap.entrySet()) {
            final String symbolicName = e.getKey();

            IPluginModelBase karafPlatformPlugin = PluginRegistry.findModel(symbolicName);

            if (karafPlatformPlugin == null) {
                continue;
            }

            final IConfigurationElement c = e.getValue();
            final KarafPlatformModelFactory f =
                (KarafPlatformModelFactory)c.createExecutableExtension(ATT_CLASS);

            final KarafPlatformValidator validator = f.getPlatformValidator();

            IPath modelPath = new Path(karafPlatformPlugin.getInstallLocation()).removeLastSegments(1);
            while(!modelPath.isEmpty() && !modelPath.isRoot()) {
                modelPath = modelPath.removeLastSegments(1);

                if (validator.isValid(modelPath)) {
                    return f.getPlatformModel(modelPath);
View Full Code Here

     * @return a fully qualified path to the requested bundle or null if it does
     *         not exist
     * @throws CoreException
     */
    private static String getBundlePath(String bundleName, String packageName) throws CoreException {
        final IPluginModelBase model = PluginRegistry.findModel(bundleName);
        if (model != null) {
            final IResource resource = model.getUnderlyingResource();

            if (!isWorkspaceModel(model)) {
                return model.getInstallLocation();
            }

            final IProject project = resource.getProject();
            if (project.hasNature(JavaCore.NATURE_ID)) {
                final IJavaProject jProject = JavaCore.create(project);
View Full Code Here

TOP

Related Classes of org.eclipse.pde.core.plugin.IPluginModelBase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.