Search in sources :

Example 1 with Project

use of aQute.bnd.build.Project in project intellij-plugins by JetBrains.

the class BndProjectImporter method doReimportProjects.

private static void doReimportProjects(com.intellij.openapi.project.Project project, Collection<String> projectDirs, ProgressIndicator indicator) {
    Workspace workspace = getWorkspace(project);
    assert workspace != null : project;
    Collection<Project> projects;
    try {
        refreshRepositories(workspace, indicator);
        projects = ContainerUtil.newArrayListWithCapacity(projectDirs.size());
        for (String dir : projectDirs) {
            if (indicator != null)
                indicator.checkCanceled();
            Project p = workspace.getProject(PathUtil.getFileName(dir));
            if (p != null) {
                p.clear();
                p.forceRefresh();
                projects.add(p);
            }
        }
    } catch (Exception e) {
        LOG.error("ws=" + workspace.getBase() + " pr=" + projectDirs, e);
        return;
    }
    Runnable task = () -> new BndProjectImporter(project, workspace, projects).resolve(true);
    if (!isUnitTestMode()) {
        ApplicationManager.getApplication().invokeLater(task, project.getDisposed());
    } else {
        task.run();
    }
}
Also used : Project(aQute.bnd.build.Project) IOException(java.io.IOException) Workspace(aQute.bnd.build.Workspace)

Example 2 with Project

use of aQute.bnd.build.Project in project intellij-plugins by JetBrains.

the class BndProjectImporter method doReimportWorkspace.

private static void doReimportWorkspace(com.intellij.openapi.project.Project project, ProgressIndicator indicator) {
    Workspace workspace = getWorkspace(project);
    assert workspace != null : project;
    Collection<Project> projects;
    try {
        workspace.clear();
        workspace.forceRefresh();
        refreshRepositories(workspace, indicator);
        projects = getWorkspaceProjects(workspace);
        for (Project p : projects) {
            if (indicator != null)
                indicator.checkCanceled();
            p.clear();
            p.forceRefresh();
        }
    } catch (Exception e) {
        LOG.error("ws=" + workspace.getBase(), e);
        return;
    }
    Runnable task = () -> {
        BndProjectImporter importer = new BndProjectImporter(project, workspace, projects);
        importer.setupProject();
        importer.resolve(true);
    };
    if (!isUnitTestMode()) {
        ApplicationManager.getApplication().invokeLater(task, project.getDisposed());
    } else {
        task.run();
    }
}
Also used : Project(aQute.bnd.build.Project) IOException(java.io.IOException) Workspace(aQute.bnd.build.Workspace)

Example 3 with Project

use of aQute.bnd.build.Project in project bnd by bndtools.

the class WorkspaceTest method testPropertyDefaulting.

public void testPropertyDefaulting() throws Exception {
    try (Workspace ws = Workspace.getWorkspace(IO.getFile("testresources/ws-defaulting"))) {
        Project p = ws.getProject("p1");
        assertEquals("defaults", p.getProperty("myprop1"));
        assertEquals("workspace", p.getProperty("myprop2"));
        assertEquals("project", p.getProperty("myprop3"));
        assertEquals("src", p.mergeProperties("src"));
    }
}
Also used : Project(aQute.bnd.build.Project) Workspace(aQute.bnd.build.Workspace)

Example 4 with Project

use of aQute.bnd.build.Project in project bnd by bndtools.

the class WorkspaceBundleVersionedDependencyTest method testWorkspaceVersionedDependencyWithSubbundle.

public static void testWorkspaceVersionedDependencyWithSubbundle() throws Exception {
    IO.copy(IO.getFile("testresources/ws-versioneddependencies-withsubbundle"), IO.getFile("generated/ws-versioneddependencies-withsubbundle"));
    Workspace ws = Workspace.getWorkspace(IO.getFile("generated/ws-versioneddependencies-withsubbundle"));
    ws.getProject("mydependency").build();
    Project project = ws.getProject("myconsumer");
    project.clean();
    project.build();
    assertTrue(project.check());
}
Also used : Project(aQute.bnd.build.Project) Workspace(aQute.bnd.build.Workspace)

Example 5 with Project

use of aQute.bnd.build.Project in project bnd by bndtools.

the class WorkspaceBundleVersionedDependencyTest method testWorkspaceVersionedDependency.

public static void testWorkspaceVersionedDependency() throws Exception {
    IO.copy(IO.getFile("testresources/ws-versioneddependencies"), IO.getFile("generated/ws-versioneddependencies"));
    Workspace ws = Workspace.getWorkspace(IO.getFile("generated/ws-versioneddependencies"));
    Project project = ws.getProject("myconsumer");
    project.clean();
    project.build();
    assertTrue(project.check());
}
Also used : Project(aQute.bnd.build.Project) Workspace(aQute.bnd.build.Workspace)

Aggregations

Project (aQute.bnd.build.Project)141 Workspace (aQute.bnd.build.Workspace)71 File (java.io.File)46 ArrayList (java.util.ArrayList)22 IProject (org.eclipse.core.resources.IProject)21 Container (aQute.bnd.build.Container)19 IOException (java.io.IOException)18 ProjectLauncher (aQute.bnd.build.ProjectLauncher)15 Version (aQute.bnd.version.Version)12 Description (aQute.lib.getopt.Description)12 Jar (aQute.bnd.osgi.Jar)11 RepositoryPlugin (aQute.bnd.service.RepositoryPlugin)11 Builder (aQute.bnd.osgi.Builder)10 IJavaProject (org.eclipse.jdt.core.IJavaProject)9 ProjectBuilder (aQute.bnd.build.ProjectBuilder)8 Run (aQute.bnd.build.Run)8 BuildException (org.apache.tools.ant.BuildException)8 CoreException (org.eclipse.core.runtime.CoreException)8 IFile (org.eclipse.core.resources.IFile)7 ProjectTester (aQute.bnd.build.ProjectTester)5