Package aQute.bnd.build

Examples of aQute.bnd.build.Project


    @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


                cell.setImage(image);
            }
        } else if (element instanceof Project) {
            if (index == 0) {
                Project project = (Project) element;
                StyledString label = new StyledString(project.getName());
                if (showRepoId)
                    label.append("  [Workspace]", StyledString.QUALIFIER_STYLER);

                cell.setText(label.getString());
                cell.setStyleRanges(label.getStyleRanges());
View Full Code Here

            if (element instanceof Actionable) {
                return ((Actionable) element).title();
            } else if (element instanceof RepositoryPlugin) {
                return ((RepositoryPlugin) element).getName();
            } else if (element instanceof Project) {
                Project project = (Project) element;
                return project.getName();
            } else if (element instanceof ProjectBundle) {
                return ((ProjectBundle) element).getBsn();
            }
        } catch (Exception e) {
            // just take the default
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

            resources = Collections.emptyList();

        // Open stream for physical paths list in target dir
        PrintStream pathsStream = null;
        try {
            Project project = Central.getProject(file.getProject().getLocation().toFile());
            File targetDir = project.getTarget();
            if (!targetDir.exists() && !targetDir.mkdirs()) {
                throw new IOException("Could not create directory " + targetDir);
            }

            File pathsFile = new File(targetDir, file.getName() + RESOLVED_PATHS_EXTENSION);
View Full Code Here

    @Override
    protected IStatus run(IProgressMonitor monitor) {
        instances.remove(project.getFullPath().toPortableString());

        try {
            Project model = null;
            try {
                model = Central.getProject(project.getLocation().toFile());
            } catch (IllegalArgumentException e) {
                // Could not find cnf, ignore
                return Status.OK_STATUS;
            }
            if (model == null) {
                return Status.OK_STATUS;
            }
            Collection< ? extends Builder> builders = model.getSubBuilders();

            Map<String,SortedSet<Version>> allExports = new HashMap<String,SortedSet<Version>>();
            Set<String> allContained = new HashSet<String>();

            for (Builder builder : builders) {
                try {
                    builder.build();
                    Packages exports = builder.getExports();
                    if (exports != null) {
                        for (Entry<PackageRef,Attrs> export : exports.entrySet()) {
                            Version version;
                            String versionStr = export.getValue().get(Constants.VERSION_ATTRIBUTE);
                            try {
                                version = Version.parseVersion(versionStr);
                                String pkgName = Processor.removeDuplicateMarker(export.getKey().getFQN());
                                SortedSet<Version> versions = allExports.get(pkgName);
                                if (versions == null) {
                                    versions = new TreeSet<Version>();
                                    allExports.put(pkgName, versions);
                                }
                                versions.add(version);
                            } catch (IllegalArgumentException e) {
                                // Seems to be an invalid export, ignore it...
                            }
                        }
                    }
                    Packages contained = builder.getContained();
                    for (PackageRef pkgRef : contained.keySet()) {
                        String pkgName = Processor.removeDuplicateMarker(pkgRef.getFQN());
                        allContained.add(pkgName);
                    }
                } catch (Exception e) {
                    logger.logWarning(MessageFormat.format("Unable to process exported packages for builder of {0}.", builder.getPropertiesFile()), e);
                }
            }

            File projectBaseFile = project.getLocation().toFile().getAbsoluteFile();
            Collection<File> modelSourcePaths = model.getSourcePath();
            Collection<IResource> modelSourcePathsResources = null;
            if (modelSourcePaths != null && !modelSourcePaths.isEmpty()) {
                modelSourcePathsResources = new HashSet<IResource>();
                for (File modelSourcePath : modelSourcePaths) {
                    if (projectBaseFile.equals(modelSourcePath.getAbsoluteFile())) {
View Full Code Here

    @Override
    protected void clean(IProgressMonitor monitor) throws CoreException {
        try {
            IProject myProject = getProject();
            Project model = Central.getProject(myProject.getLocation().toFile());
            if (model == null)
                return;

            // Delete everything in the target directory
            File target = model.getTarget();
            if (target.isDirectory() && target.getParentFile() != null) {
                IO.delete(target);
                if (!target.exists() && !target.mkdirs()) {
                    throw new IOException("Could not create directory " + target);
                }
View Full Code Here

        // Generate the index file
        File indexFile;
        OutputStream output = null;
        try {
            Project model = Central.getProject(project.getLocation().toFile());
            File target = model.getTarget();
            indexFile = new File(target, INDEX_FILENAME);

            IFile indexPath = wsroot.getFile(Central.toPath(indexFile));

            // Create the indexer and add ResourceAnalyzers from plugins
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

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.