Package aQute.bnd.build

Examples of aQute.bnd.build.Project


            return Status.CANCEL_STATUS;
        }

        IWorkspaceRoot wsroot = ResourcesPlugin.getWorkspace().getRoot();
        while (!projects.isEmpty()) {
            Project project = projects.remove(0);
            IProject eclipseProject = WorkspaceUtils.findOpenProject(wsroot, project);
            if (eclipseProject != null && !eclipseProject.equals(addedProject)) {
                List<String> errors = new LinkedList<String>();
                try {
                    project.propertiesChanged();
                    BndContainerInitializer.resetClasspaths(project, eclipseProject, errors);
                    BndContainerInitializer.replaceClasspathProblemMarkers(eclipseProject, errors);
                } catch (CoreException e) {
                    logger.logStatus(e.getStatus());
                    return Status.CANCEL_STATUS;
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

        IProject project = wsfiles[0].getProject();

        // Calculate the manifest
        try {
            Project bndProject = Central.getInstance().getModel(JavaCore.create(project));
            if (bndProject == null)
                return null;
            Builder builder;
            if (file.getName().equals(Project.BNDFILE)) {
                builder = bndProject.getSubBuilders().iterator().next();
            } else {
                builder = bndProject.getSubBuilder(file);
            }

            if (builder == null) {
                builder = new Builder();
                builder.setProperties(file);
View Full Code Here

        return false;
    }

    private static void calculateAndUpdateClasspathEntries(IJavaProject project, Collection< ? super String> errors) throws CoreException {
        IClasspathEntry[] entries = new IClasspathEntry[0];
        Project model;
        try {
            model = Central.getProject(project.getProject().getLocation().toFile());
        } catch (Exception e) {
            // Abort quickly if there is no Bnd workspace
            setClasspathEntries(project, entries);
View Full Code Here

    }

    void setupProjects() throws Exception {
        IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
        for (IProject project : projects) {
            Project model = Central.getProject(project.getLocation().toFile());
            if (model != null) {
                File targetDir = getTarget(model);
                if (targetDir != null) {
                    File indexFile = new File(targetDir, ".index");
                    if (indexFile != null && indexFile.isFile()) {
View Full Code Here

            // Get the initial project
            IProject myProject = getProject();
            reportDelta(myProject);

            listeners.fireBuildStarting(myProject);
            Project model = null;
            try {
                model = Central.getProject(myProject.getLocation().toFile());
            } catch (Exception e) {
                clearBuildMarkers();
                addBuildMarkers(e.getMessage(), IMarker.SEVERITY_ERROR);
            }
            if (model == null)
                return null;
            this.model = model;
            model.setDelayRunDependencies(true);

            // Main build section
            IProject[] dependsOn = calculateDependsOn(model);

            // Clear errors and warnings
            model.clear();

            // CASE 1: CNF changed
            if (isCnfChanged()) {
                log(LOG_BASIC, "cnf project changed");
                model.refresh();
                if (BndContainerInitializer.resetClasspaths(model, myProject, classpathErrors)) {
                    log(LOG_BASIC, "classpaths were changed");
                } else {
                    log(LOG_FULL, "classpaths did not need to change");
                }

                // Notify the repository listeners that ALL repo contents may have changed.
                List<RepositoryListenerPlugin> repoListeners = Central.getWorkspace().getPlugins(RepositoryListenerPlugin.class);
                for (RepositoryListenerPlugin repoListener : repoListeners) {
                    repoListener.repositoriesRefreshed();
                }

                return dependsOn;
            }

            // CASE 2: local Bnd file changed, or Eclipse asks for full build
            boolean localChange = false;
            if (kind == FULL_BUILD) {
                localChange = true;
                log(LOG_BASIC, "Eclipse requested full build");
            } else if (isLocalBndFileChange()) {
                localChange = true;
                log(LOG_BASIC, "local bnd files changed");
            }
            if (localChange) {
                model.refresh();
                if (BndContainerInitializer.resetClasspaths(model, myProject, classpathErrors)) {
                    log(LOG_BASIC, "classpaths were changed");
                    return dependsOn;
                }
                log(LOG_FULL, "classpaths were not changed");
                this.subBuilders = model.getSubBuilders();
                rebuildIfLocalChanges(dependsOn, true);
                return dependsOn;
            }
            // (NB: from now on the delta cannot be null, due to the check in
            // isLocalBndFileChange)

            // CASE 3: JAR file in dependency project changed
            Project changedDependency = getDependencyTargetChange();
            if (changedDependency != null) {
                log(LOG_BASIC, "target files in dependency project %s changed", changedDependency.getName());
                model.propertiesChanged();
                if (BndContainerInitializer.resetClasspaths(model, myProject, classpathErrors)) {
                    log(LOG_BASIC, "classpaths were changed");
                    return dependsOn;
                }
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

            listeners = new BuildListeners();

            // Get the initial project
            IProject myProject = getProject();
            listeners.fireBuildStarting(myProject);
            Project model = null;
            try {
                model = Central.getProject(myProject.getLocation().toFile());
            } catch (Exception e) {
                clearBuildMarkers();
                addBuildMarkers(e.getMessage(), IMarker.SEVERITY_ERROR);
            }
            if (model == null)
                return null;
            this.model = model;
            model.setDelayRunDependencies(true);

            // Main build section
            IProject[] dependsOn = calculateDependsOn(model);

            // Clear errors and warnings
            model.clear();

            // CASE 1: CNF changed
            if (isCnfChanged()) {
                log(LOG_BASIC, "cnf project changed");
                model.refresh();
                if (BndContainerInitializer.resetClasspaths(model, myProject, classpathErrors)) {
                    log(LOG_BASIC, "classpaths were changed");
                } else {
                    log(LOG_FULL, "classpaths did not need to change");
                }

                // Notify the repository listeners that ALL repo contents may have changed.
                List<RepositoryListenerPlugin> repoListeners = Central.getWorkspace().getPlugins(RepositoryListenerPlugin.class);
                for (RepositoryListenerPlugin repoListener : repoListeners) {
                    repoListener.repositoriesRefreshed();
                }

                return dependsOn;
            }

            // CASE 2: local Bnd file changed, or Eclipse asks for full build
            boolean localChange = false;
            if (kind == FULL_BUILD) {
                localChange = true;
                log(LOG_BASIC, "Eclipse requested full build");
            } else if (isLocalBndFileChange()) {
                localChange = true;
                log(LOG_BASIC, "local bnd files changed");
            }
            if (localChange) {
                model.refresh();
                if (BndContainerInitializer.resetClasspaths(model, myProject, classpathErrors)) {
                    log(LOG_BASIC, "classpaths were changed");
                    return dependsOn;
                }
                log(LOG_FULL, "classpaths were not changed");
                this.subBuilders = model.getSubBuilders();
                rebuildIfLocalChanges(dependsOn, true);
                return dependsOn;
            }
            // (NB: from now on the delta cannot be null, due to the check in
            // isLocalBndFileChange)

            // CASE 3: JAR file in dependency project changed
            Project changedDependency = getDependencyTargetChange();
            if (changedDependency != null) {
                log(LOG_BASIC, "target files in dependency project %s changed", changedDependency.getName());
                model.propertiesChanged();
                if (BndContainerInitializer.resetClasspaths(model, myProject, classpathErrors)) {
                    log(LOG_BASIC, "classpaths were changed");
                    return dependsOn;
                }
View Full Code Here

        return false;
    }

    private static void calculateAndUpdateClasspathEntries(IJavaProject project, Collection< ? super String> errors) throws CoreException {
        IClasspathEntry[] entries = new IClasspathEntry[0];
        Project model;
        try {
            model = Central.getProject(project.getProject().getLocation().toFile());
        } catch (Exception e) {
            // Abort quickly if there is no Bnd workspace
            setClasspathEntries(project, entries);
View Full Code Here

    public static String getLaunchProjectName(IResource launchResource) {
        String result;

        IProject project = launchResource.getProject();
        Project bnd;
        try {
            bnd = Central.getWorkspace().getProject(project.getName());
        } catch (Exception e) {
            bnd = null;
        }

        result = (bnd != null) ? bnd.getName() : Project.BNDCNF;
        return result;
    }
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.