Search in sources :

Example 1 with RPMProjectCreator

use of org.eclipse.linuxtools.rpm.core.RPMProjectCreator in project linuxtools by eclipse.

the class RPMProjectCreatorTest method createRPMBuild.

@Test
public void createRPMBuild() throws CoreException {
    RPMProjectCreator projectCreator = new RPMProjectCreator();
    newProject = projectCreator.create("rpmbuild", Platform.getLocation(), new NullProgressMonitor());
    assertNotNull(newProject);
    assertEquals(1, newProject.getDescription().getNatureIds().length);
    assertEquals(IRPMConstants.RPM_NATURE_ID, newProject.getDescription().getNatureIds()[0]);
    assertTrue(newProject.exists(new Path("SOURCES")));
    assertTrue(newProject.exists(new Path("SPECS")));
}
Also used : Path(org.eclipse.core.runtime.Path) NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) RPMProjectCreator(org.eclipse.linuxtools.rpm.core.RPMProjectCreator) Test(org.junit.Test)

Example 2 with RPMProjectCreator

use of org.eclipse.linuxtools.rpm.core.RPMProjectCreator in project linuxtools by eclipse.

the class RPMNewProject method createProject.

protected void createProject(IProgressMonitor monitor) throws CoreException {
    RPMProjectCreator rpmProjectCreator = new RPMProjectCreator(namePage.getSelectedLayout());
    IProject project = rpmProjectCreator.create(namePage.getProjectName(), namePage.getLocationPath(), monitor);
    // Add new project to working sets, if requested
    IWorkingSet[] workingSets = namePage.getWorkingSets();
    if (workingSets.length > 0) {
        PlatformUI.getWorkbench().getWorkingSetManager().addToWorkingSets(project, workingSets);
    }
}
Also used : RPMProjectCreator(org.eclipse.linuxtools.rpm.core.RPMProjectCreator) IProject(org.eclipse.core.resources.IProject) IWorkingSet(org.eclipse.ui.IWorkingSet)

Example 3 with RPMProjectCreator

use of org.eclipse.linuxtools.rpm.core.RPMProjectCreator in project linuxtools by eclipse.

the class SRPMImportPage method getNewProject.

/**
 * Creates a new project.
 * @throws CoreException If project creation failed.
 */
private IProject getNewProject() throws CoreException {
    IPath path = detailsPanel.getLocationPath();
    RPMProjectCreator projectCreator = new RPMProjectCreator(detailsPanel.getSelectedLayout());
    return projectCreator.create(getProjectName(path.lastSegment()), path.removeLastSegments(1), new NullProgressMonitor());
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IPath(org.eclipse.core.runtime.IPath) RPMProjectCreator(org.eclipse.linuxtools.rpm.core.RPMProjectCreator)

Example 4 with RPMProjectCreator

use of org.eclipse.linuxtools.rpm.core.RPMProjectCreator in project linuxtools by eclipse.

the class RPMProjectCreatorTest method createFlat.

@Test
public void createFlat() throws CoreException {
    RPMProjectCreator projectCreator = new RPMProjectCreator(RPMProjectLayout.FLAT);
    newProject = projectCreator.create("flatproject", Platform.getLocation(), new NullProgressMonitor());
    assertNotNull(newProject);
    assertEquals(1, newProject.getDescription().getNatureIds().length);
    assertEquals(IRPMConstants.RPM_NATURE_ID, newProject.getDescription().getNatureIds()[0]);
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) RPMProjectCreator(org.eclipse.linuxtools.rpm.core.RPMProjectCreator) Test(org.junit.Test)

Aggregations

RPMProjectCreator (org.eclipse.linuxtools.rpm.core.RPMProjectCreator)4 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)3 Test (org.junit.Test)2 IProject (org.eclipse.core.resources.IProject)1 IPath (org.eclipse.core.runtime.IPath)1 Path (org.eclipse.core.runtime.Path)1 IWorkingSet (org.eclipse.ui.IWorkingSet)1