Package aQute.bnd.build

Examples of aQute.bnd.build.Project


            throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Bnd launch target was not specified, or does not exist.", null));
        return getBndProject(targetResource);
    }

    public static Project getBndProject(IResource targetResource) throws CoreException {
        Project result;

        IProject project = targetResource.getProject();
        File projectDir = project.getLocation().toFile();

        if (targetResource.getType() == IResource.FILE && targetResource.getName().endsWith(LaunchConstants.EXT_BNDRUN)) {
            if (!targetResource.getName().endsWith(LaunchConstants.EXT_BNDRUN))
                throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, MessageFormat.format("Bnd launch target file \"{0}\" is not a .bndrun file.", targetResource.getFullPath().toString()), null));

            // Get the synthetic "run" project (based on a .bndrun file)
            File runFile = targetResource.getLocation().toFile();
            File bndbnd = new File(runFile.getParentFile(), Project.BNDFILE);
            try {
                Project parent = new Project(Central.getWorkspace(), projectDir, bndbnd);
                result = new Project(Central.getWorkspace(), projectDir, runFile);
                result.setParent(parent);
            } catch (Exception e) {
                throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, MessageFormat.format("Failed to create synthetic project for run file {0} in project {1}.", targetResource.getProjectRelativePath().toString(),
                        project.getName()), e));
            }
View Full Code Here


    @Override
    protected ISourceContainer[] createSourceContainers() throws CoreException {
        List<ISourceContainer> result = new LinkedList<ISourceContainer>();

        ILaunchConfiguration config = getLaunchConfiguration();
        Project project = LaunchUtils.getBndProject(config);
        if (project != null) {
            try {
                Collection<Container> runbundles = project.getRunbundles();
                for (Container runbundle : runbundles) {
                    if (runbundle.getType() == TYPE.PROJECT) {
                        String targetProjName = runbundle.getProject().getName();
                        IProject targetProj = ResourcesPlugin.getWorkspace().getRoot().getProject(targetProjName);
                        if (targetProj != null) {
View Full Code Here

        }
    }

    public Project getModel(IJavaProject project) {
        try {
            Project model = javaProjectToModel.get(project);
            if (model == null) {
                File projectDir = project.getProject().getLocation().makeAbsolute().toFile();
                try {
                    model = getProject(projectDir);
                } catch (IllegalArgumentException e) {
                    // initialiseWorkspace();
                    // model = Central.getProject(projectDir);
                    return null;
                }
                if (workspace == null) {
                    model.getWorkspace();
                }
                if (model != null) {
                    javaProjectToModel.put(project, model);
                }
            }
View Full Code Here

                                        changed.addAll(workspace.getCurrentProjects());
                                    }
                                    return false;
                                }
                                if (workspace.isPresent(file.getName())) {
                                    Project project = workspace.getProject(file.getName());
                                    changed.add(project);
                                } else {
                                    // Project not created yet, so we
                                    // have
                                    // no cached results
View Full Code Here

        return null;
    }

    private void doAddBundle() {
        try {
            Project project = getProject();

            RepoBundleSelectionWizard wizard = new RepoBundleSelectionWizard(project, new ArrayList<VersionedClause>(), DependencyPhase.Run);
            wizard.setSelectionPageTitle("Add Bundle Requirement");
            WizardDialog dialog = new WizardDialog(getSection().getShell(), wizard);
View Full Code Here

            return false;
        }
    }

    Project getProject() {
        Project project = null;
        try {
            BndEditModel model = (BndEditModel) getManagedForm().getInput();
            File bndFile = model.getBndResource();
            IPath path = Central.toPath(bndFile);
            IFile resource = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
            File projectDir = resource.getProject().getLocation().toFile();
            if (Project.BNDFILE.equals(resource.getName())) {
                project = Central.getProject(projectDir);
            } else {
                project = new Project(Central.getWorkspace(), projectDir, resource.getLocation().toFile());
            }
        } catch (Exception e) {
            logger.logError("Error getting project from editor model", e);
        }
        return project;
View Full Code Here

            }
        }

        IFile targetResource = ResourceUtil.getFile(editor.getEditorInput());
        try {
            Project project = LaunchUtils.getBndProject(targetResource);

            RunExportSelectionWizard wizard = new RunExportSelectionWizard(configElems, model, project);
            WizardDialog dialog = new WizardDialog(parentShell, wizard);
            dialog.open();
View Full Code Here

    protected void saveToModel(BndEditModel model, List< ? extends ExportedPackage> clauses) {
        model.setExportedPackages(clauses);
    }

    Project getProject() {
        Project project = null;
        try {
            BndEditModel model = (BndEditModel) getManagedForm().getInput();
            File bndFile = model.getBndResource();
            IPath path = Central.toPath(bndFile);
            IFile resource = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
View Full Code Here

        this.bundles = bundles;
        viewer.setInput(bundles);
    }

    private void doAdd() {
        Project project = getProject();
        try {
            RepoBundleSelectionWizard wizard = createBundleSelectionWizard(project, getBundles());
            if (wizard != null) {
                WizardDialog dialog = new WizardDialog(getSection().getShell(), wizard);
                if (dialog.open() == Window.OK) {
View Full Code Here

            ErrorDialog.openError(getSection().getShell(), "Error", null, new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Error opening bundle resolver wizard.", e));
        }
    }

    Project getProject() {
        Project project = null;
        try {
            BndEditModel model = (BndEditModel) getManagedForm().getInput();
            File bndFile = model.getBndResource();
            IPath path = Central.toPath(bndFile);
            IFile resource = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
            File projectDir = resource.getProject().getLocation().toFile();
            if (Project.BNDFILE.equals(resource.getName())) {
                project = Central.getProject(projectDir);
            } else {
                project = new Project(Central.getWorkspace(), projectDir, resource.getLocation().toFile());
            }
        } catch (Exception e) {
            logger.logError("Error getting project from editor model", e);
        }
        return project;
View Full Code Here

TOP

Related Classes of aQute.bnd.build.Project

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.