Package aQute.bnd.build

Examples of aQute.bnd.build.Workspace$CachedFileRepo


    public static Project getProject(File projectDir) throws Exception {
        File projectDirAbsolute = projectDir.getAbsoluteFile();
        assert projectDirAbsolute.isDirectory();

        Workspace ws = getWorkspace();
        return ws.getProject(projectDir.getName());
    }
View Full Code Here


    private static final Object CACHE_REPO = "cache";
    private static final String VERSION_LATEST = "latest";

    public static List<RepositoryPlugin> listRepositories(boolean hideCache) {
        Workspace workspace;
        try {
            workspace = Central.getWorkspace();
        } catch (Exception e1) {
            return Collections.emptyList();
        }

        try {
            List<RepositoryPlugin> plugins = workspace.getPlugins(RepositoryPlugin.class);
            List<RepositoryPlugin> repos = new ArrayList<RepositoryPlugin>(plugins.size() + 1);

            repos.add(Central.getWorkspaceRepository());

            for (RepositoryPlugin plugin : plugins) {
View Full Code Here

    }

    static List<IProject> loadProjects() {
        Collection<Project> projects;
        try {
            Workspace workspace = Central.getWorkspace();
            projects = workspace.getAllProjects();
        } catch (Exception e) {
            logger.logError("Internal error querying projects.", e);
            return Collections.emptyList();
        }
        List<IProject> result = new ArrayList<IProject>(projects.size());
View Full Code Here

    @SuppressWarnings("unchecked")
    public Object[] getElements(Object inputElement) {
        Collection<Object> result;
        if (inputElement instanceof Workspace) {
            result = new ArrayList<Object>();
            Workspace workspace = (Workspace) inputElement;
            addRepositoryPlugins(result, workspace);
        } else if (inputElement instanceof Collection) {
            result = new ArrayList<Object>();
            addCollection(result, (Collection<Object>) inputElement);
        } else if (inputElement instanceof Object[]) {
View Full Code Here

    List<OSGiFramework> frameworks = new ArrayList<OSGiFramework>();

    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
        frameworks.clear();

        Workspace workspace = (Workspace) newInput;
        IConfigurationElement[] configElements = Platform.getExtensionRegistry().getConfigurationElementsFor(Plugin.PLUGIN_ID, "osgiFrameworks");

        for (IConfigurationElement element : configElements) {
            String frameworkName = element.getAttribute("name");
            String bsn = element.getAttribute("bsn");

            URL iconUrl = null;
            String iconPath = element.getAttribute("icon");
            if (iconPath != null) {
                Bundle contributorBundle = BundleUtils.findBundle(Plugin.getDefault().getBundleContext(), element.getContributor().getName(), null);
                if (contributorBundle != null)
                    iconUrl = contributorBundle.getEntry(iconPath);
            }

            List<RepositoryPlugin> repositories = (workspace != null) ? workspace.getRepositories() : Collections.<RepositoryPlugin> emptyList();
            for (RepositoryPlugin repo : repositories) {
                try {
                    SortedSet<Version> versions = repo.versions(bsn);
                    if (versions != null)
                        for (Version version : versions) {
View Full Code Here

    private void runQuery() {
        if (!queried) {
            errorText = null;
            try {
                Workspace workspace = Central.getWorkspace();
                repository = workspace.getPlugin(SearchableRepository.class);
                if (repository == null)
                    throw new Exception("No searchable repository is configured in the workspace. Try adding the JPM4J plugin.");

                QueryJpmDependenciesRunnable query = new QueryJpmDependenciesRunnable(originUri, repository);
                getContainer().run(true, true, query);
View Full Code Here

    }

    private static IPath findWorkspaceLocation() {
        IPath p = Platform.getLocation();

        Workspace ws;
        try {
            ws = Central.getWorkspace();
        } catch (Exception e) {
            ws = null;
        }

        if (ws != null)
            p = Path.fromOSString(ws.getBase().getAbsolutePath());
        return p;
    }
View Full Code Here

        String name = url.getPath().substring(idx + 1);
        return name.substring(0, name.lastIndexOf('.'));
    }

    public static void refreshProject(Project project) throws Exception {
        Workspace ws = getWorkspace();
        if (ws == null) {
            return;
        }
        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        IWorkspaceRoot root = workspace.getRoot();
View Full Code Here

        return workspaceTracker.getService();
    }

    public static List<RepositoryPlugin> getRepositories() {

        Workspace ws = workspaceTracker.getService();
        if (ws == null) {
            return Collections.emptyList();
        }

        return ws.getPlugins(RepositoryPlugin.class);
    }
View Full Code Here

                }
            }
        });

        try {
            Workspace workspace = Central.getWorkspace();
            viewer.setInput(workspace);
            if (selectedRepository != null)
                viewer.setSelection(new StructuredSelection(selectedRepository));

            validate(workspace);
View Full Code Here

TOP

Related Classes of aQute.bnd.build.Workspace$CachedFileRepo

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.