Package org.apache.felix.sigil.common.model.eclipse

Examples of org.apache.felix.sigil.common.model.eclipse.ISigilBundle


    private ISigilBundle buildBundle(JarFile jar, File f) throws IOException
    {
        IBundleModelElement info = ManifestUtil.buildBundleModelElement(jar);

        ISigilBundle bundle = null;

        if (info != null)
        {
            bundle = ModelElementFactory.getInstance().newModelElement(ISigilBundle.class);
            bundle.addChild(info);
            bundle.setLocation(f);
        }

        return bundle;
    }
View Full Code Here


        if (!found.isEmpty())
            return found;

        // find best fuzzy match
        ISigilBundle fuzzyMatch = null;
        int fuzzyLen = 0;

        for (ISigilBundle bundle : getWildBundles())
        {
            if (policy.accept(bundle))
View Full Code Here

            info.setSymbolicName(bb.getSymbolicName());

            Version version = VersionTable.getVersion(bb.getVersion());
            info.setVersion(version);

            ISigilBundle pb = ModelElementFactory.getInstance().newModelElement(
                ISigilBundle.class);
            pb.setBundleInfo(info);

            Map<Object, Object> meta = new HashMap<Object, Object>();
            ModuleDescriptor md = SigilParser.instance().parseDescriptor(uri.toURL());
            if (!bb.getId().equals(md.getModuleRevisionId().getName()))
            { // non-default artifact
                for (Artifact a : md.getAllArtifacts())
                {
                    if (a.getName().equals(bb.getId()))
                    {
                        meta.put(Artifact.class, a);
                        break;
                    }
                }
            }

            meta.put(ModuleDescriptor.class, md);
            pb.setMeta(meta);

            list.add(pb);
            Log.debug("ProjectRepository: added " + pb);
            Log.debug("ProjectRepository: exports " + bb.getExports());
        }
View Full Code Here

    public String getText(Object element)
    {
        if (element instanceof ISigilBundle)
        {
            ISigilBundle bundle = (ISigilBundle) element;
            return bundle.getBundleInfo().getSymbolicName() + " "
                + bundle.getBundleInfo().getVersion();
        }
        if (element instanceof IBundleModelElement)
        {
            IBundleModelElement bundle = (IBundleModelElement) element;
            return bundle.getSymbolicName();
        }
        if (element instanceof IRequiredBundle)
        {
            IRequiredBundle req = (IRequiredBundle) element;
            return req.getSymbolicName() + " " + req.getVersions();
View Full Code Here

    private static ISigilBundle systemBundle;

    @Override
    public void accept(IRepositoryVisitor visitor, int options)
    {
        ISigilBundle bundle = loadSystemBundle();

        if (bundle != null)
        {
            visitor.visit(bundle);
        }
View Full Code Here

       
        ISigilProjectModel sigil = SigilCore.create(project);
        IClasspathEntry cp = JavaCore.newSourceEntry(src);
        String encodedClasspath = sigil.getJavaModel().encodeClasspathEntry(cp);

        ISigilBundle bundle = sigil.getBundle();
        bundle.addClasspathEntry(encodedClasspath);

        // fine set up other values
        bundle.getBundleInfo().setSymbolicName(bsn);
        if (description != null)
        {
            bundle.getBundleInfo().setDescription(description);
        }
        if (projectVersion != null)
        {
            bundle.setVersion(projectVersion);
        }
        if (vendorName != null)
        {
            bundle.getBundleInfo().setVendor(vendorName);
        }
        if (bundleName != null)
        {
            bundle.getBundleInfo().setName(bundleName);
        }
        sigil.save(monitor);
    }
View Full Code Here

                Link l = (Link) element;
                return !l.isSatisfied();
            }
            else if (element instanceof ISigilBundle)
            {
                ISigilBundle bundle = (ISigilBundle) element;
                for (Link l : view.getBundlegraph().getLinks(bundle))
                {
                    if (!l.isSatisfied())
                    {
                        return true;
View Full Code Here

    public void testSimple() throws IOException
    {
        IBldProject project = BldFactory.getProject(base.resolve("test1.properties"));

        ISigilBundle bundle = project.getDefaultBundle();
        IBundleModelElement info = bundle.getBundleInfo();

        PackageImport foo = new PackageImport();
        foo.setPackageName("foo");
        foo.setVersions(VersionRange.parseVersionRange("1.0.0"));
        PackageImport bar = new PackageImport();
View Full Code Here

    public void testInherited() throws IOException
    {
        IBldProject project = BldFactory.getProject(base.resolve("inheritance/foo/sigil.properties"));

        ISigilBundle bundle = project.getDefaultBundle();
        IBundleModelElement info = bundle.getBundleInfo();

        Collection<IPackageImport> imports = info.getImports();
        assertEquals(1, imports.size());
        IPackageImport i = imports.iterator().next();
        assertEquals("org.bar", i.getPackageName());
View Full Code Here

                    // TODO replace with logging framework for build
                    // should hook in with ide/build logging
                    System.err.println(obrURL + " contains duplicate uri: " + uri);
                }
               
                ISigilBundle b = ModelElementFactory.getInstance().newModelElement(
                    ISigilBundle.class);
                IBundleModelElement info = ModelElementFactory.getInstance().newModelElement(
                    IBundleModelElement.class);
                info.setSymbolicName(attributes.getValue("", SYMBOLIC_NAME));
                info.setVersion(VersionTable.getVersion(attributes.getValue("", VERSION)));
                info.setName(attributes.getValue("", PRESENTATION_NAME));
                URI l = makeAbsolute(uri);
                info.setUpdateLocation(l);
                if ("file".equals(l.getScheme()))
                {
                    b.setLocation(new File(l));
                }
                else
                {
                    b.setLocation(cachePath(info));
                }
                b.setBundleInfo(info);
                bundle = b;
            }
        }
        catch (Exception e)
        {
View Full Code Here

TOP

Related Classes of org.apache.felix.sigil.common.model.eclipse.ISigilBundle

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.