Package aQute.bnd.build

Examples of aQute.bnd.build.Workspace


    }

    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


        @Override
        public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
            Collection<Project> projects = null;
            try {
                Workspace ws = Central.getWorkspace();
                projects = ws.getBuildOrder();
            } catch (Exception e) {
                throw new CoreException(new Status(IStatus.ERROR, NewBuilder.PLUGIN_ID, 0, "Error rebuilding bnd projects after creating workspace configuration.", e));
            }
            if (projects == null || projects.isEmpty())
                return Status.OK_STATUS;
View Full Code Here

            throw new IllegalStateException("Central has not been initialised");

        if (workspace != null)
            return workspace;

        Workspace newWorkspace = null;

        try {
            newWorkspace = Workspace.getWorkspace(getWorkspaceDirectory());

            newWorkspace.addBasicPlugin(new WorkspaceListener(newWorkspace));
            newWorkspace.addBasicPlugin(instance.repoListenerTracker);
            newWorkspace.addBasicPlugin(getWorkspaceR5Repository());

            // Initialize projects in synchronized block
            newWorkspace.getBuildOrder();

            // Monitor changes in cnf so we can refresh the workspace
            addCnfChangeListener(newWorkspace);

            // The workspace has been initialized fully, set the field now
            workspace = newWorkspace;

            // Call the queued workspace init callbacks
            while (!workspaceInitCallbackQueue.isEmpty()) {
                Function<Workspace,Void> callback = workspaceInitCallbackQueue.remove(0);
                callback.run(workspace);
            }

            return workspace;
        } catch (final Exception e) {
            if (newWorkspace != null) {
                newWorkspace.close();
            }
            throw e;
        }
    }
View Full Code Here

    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

        return configuredClassPathEntries;
    }

    private static File getSourceBundle(IPath path, Map<String,String> props) {
        Workspace bndWorkspace;

        try {
            bndWorkspace = Central.getWorkspace();
            if (bndWorkspace == null) {
                return null;
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

        }

        public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
            Collection<Project> projects = null;
            try {
                Workspace ws = Central.getWorkspace();
                projects = ws.getBuildOrder();
            } catch (Exception e) {
                throw new CoreException(new Status(IStatus.ERROR, NewBuilder.PLUGIN_ID, 0, "Error rebuilding bnd projects after creating workspace configuration.", e));
            }
            if (projects == null || projects.isEmpty())
                return Status.OK_STATUS;
View Full Code Here

public class RepositoryBundlesContentProvider implements ITreeContentProvider {

    private static final ILogger logger = Logger.getLogger(RepositoryBundlesContentProvider.class);

    public Object[] getElements(Object inputElement) {
        Workspace workspace = (Workspace) inputElement;

        List<RepositoryPlugin> repos = workspace.getPlugins(RepositoryPlugin.class);
        return repos.toArray(new RepositoryPlugin[repos.size()]);
    }
View Full Code Here

        return configuredClassPathEntries;
    }

    private static File getSourceBundle(IPath path) {
        Workspace bndWorkspace;

        try {
            bndWorkspace = Central.getWorkspace();
            if (bndWorkspace == null) {
                return null;
View Full Code Here

            throw new IllegalStateException("Central has not been initialised");

        if (workspace != null)
            return workspace;

        Workspace newWorkspace = null;

        try {
            Workspace.setDriver(Constants.BNDDRIVER_ECLIPSE);
            newWorkspace = Workspace.getWorkspace(getWorkspaceDirectory());

            newWorkspace.addBasicPlugin(new WorkspaceListener(newWorkspace));
            newWorkspace.addBasicPlugin(instance.repoListenerTracker);
            newWorkspace.addBasicPlugin(getWorkspaceR5Repository());

            // Initialize projects in synchronized block
            newWorkspace.getBuildOrder();

            // Monitor changes in cnf so we can refresh the workspace
            addCnfChangeListener(newWorkspace);

            // The workspace has been initialized fully, set the field now
            workspace = newWorkspace;

            // Call the queued workspace init callbacks
            while (!workspaceInitCallbackQueue.isEmpty()) {
                Function<Workspace,Void> callback = workspaceInitCallbackQueue.remove(0);
                callback.run(workspace);
            }

            return workspace;
        } catch (final Exception e) {
            if (newWorkspace != null) {
                newWorkspace.close();
            }
            throw e;
        }
    }
View Full Code Here

TOP

Related Classes of aQute.bnd.build.Workspace

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.