use of org.eclipse.linuxtools.rpm.core.RPMProject in project linuxtools by eclipse.
the class RPMProjectTest method testBuildBinaryRPMHelloWorld.
@Test
@Ignore
public void testBuildBinaryRPMHelloWorld() throws Exception {
// Create a project for the test
IProject testProject = root.getProject("testBuildBinaryRPMHelloWorld1");
RPMProject rpmProject = importSrpm(testProject);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
rpmProject.buildBinaryRPM(bos);
IFile foo2 = rpmProject.getConfiguration().getSrpmsFolder().getFile(new Path("helloworld-2-2.src.rpm"));
assertTrue(foo2.exists());
String arch = Utils.runCommandToString("rpm", "--eval", "%{_arch}").trim();
IFile foo3 = rpmProject.getConfiguration().getRpmsFolder().getFolder(new Path(arch)).getFile(new Path("helloworld-2-2." + arch + ".rpm"));
assertTrue(foo3.exists());
testProject.delete(true, true, null);
}
use of org.eclipse.linuxtools.rpm.core.RPMProject in project linuxtools by eclipse.
the class RPMProjectTest method testBuildPrepHelloWorld.
@Test
@Ignore
public void testBuildPrepHelloWorld() throws Exception {
// Create a project for the test
IProject testProject = root.getProject("testBuildPrepHelloWorld");
RPMProject rpmProject = importSrpm(testProject);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
rpmProject.buildPrep(bos);
// Make sure we got everything in the build directory
IContainer builddir = rpmProject.getConfiguration().getBuildFolder();
IFolder helloworldFolder = builddir.getFolder(new Path("helloworld-2"));
assertTrue(helloworldFolder.exists());
// Clean up
testProject.delete(true, true, monitor);
}
use of org.eclipse.linuxtools.rpm.core.RPMProject in project linuxtools by eclipse.
the class RPMProjectTest method testBuildSourceRPMHelloWorld.
@Test
@Ignore
public void testBuildSourceRPMHelloWorld() throws Exception {
// Create a project for the test
IProject testProject = root.getProject("testBuildSourceRPMHelloWorld1");
RPMProject rpmProject = importSrpm(testProject);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
rpmProject.buildSourceRPM(bos);
IFile foo2 = rpmProject.getConfiguration().getSrpmsFolder().getFile(new Path("helloworld-2-2.src.rpm"));
assertTrue(foo2.exists());
testProject.delete(true, true, null);
}
use of org.eclipse.linuxtools.rpm.core.RPMProject in project linuxtools by eclipse.
the class SRPMImportOperation method run.
/**
* @see org.eclipse.jface.operation.IRunnableWithProgress#run(IProgressMonitor)
*
* Perform the import of SRPM import. Call the build class incrementally
*/
@Override
public void run(IProgressMonitor progressMonitor) {
// Total number of work steps needed
int totalWork = 3;
rpmErrorTable = new ArrayList<>();
// $NON-NLS-1$
progressMonitor.beginTask(// $NON-NLS-1$
Messages.getString("SRPMImportOperation.Starting"), totalWork);
// Try to create an instance of the build class.
try {
RPMProject rpmProject = new RPMProject(project, projectLayout);
progressMonitor.worked(1);
// $NON-NLS-1$
progressMonitor.setTaskName(Messages.getString("SRPMImportOperation.Importing_SRPM"));
if (sourceRPM != null) {
rpmProject.importSourceRPM(sourceRPM);
progressMonitor.worked(2);
} else if (remoteSRPM != null) {
SubMonitor submonitor = SubMonitor.convert(progressMonitor, 1);
rpmProject.importSourceRPM(remoteSRPM, submonitor);
progressMonitor.worked(2);
}
} catch (CoreException e) {
rpmErrorTable.add(e);
}
progressMonitor.worked(2);
}
use of org.eclipse.linuxtools.rpm.core.RPMProject in project linuxtools by eclipse.
the class DownloadPrepareSourcesTest method layoutFLATPrepareSourcesTest.
/**
* Test preparing sources using FLAT layout
*
* @throws CoreException
* @throws IOException
* @throws InterruptedException
*/
@Test
public void layoutFLATPrepareSourcesTest() throws CoreException, IOException, InterruptedException {
RPMProject rpmProject = importSrpm(testProject, RPMProjectLayout.FLAT);
assertNotNull(rpmProject);
downloadFile(rpmProject);
checkDownloadedFile(rpmProject, RPMProjectLayout.FLAT);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
IStatus is = rpmProject.buildPrep(bos);
assertTrue(is.isOK());
checkPreparedSources(rpmProject, RPMProjectLayout.FLAT);
}
Aggregations