diff options
author | Alexander Kurtakov | 2013-01-11 15:51:34 +0000 |
---|---|---|
committer | Camilo Bernal | 2013-01-11 19:28:27 +0000 |
commit | 5bf898df4587cb5dcb2f2d924c61f68dc071375b (patch) | |
tree | b8c366e7bad0f0041f7ffce3b051999ea0a0b83c /rpm/org.eclipse.linuxtools.rpm.core | |
parent | c3896d90b78cf4c44c682ccd7fd14993228531f6 (diff) | |
download | org.eclipse.linuxtools-5bf898df4587cb5dcb2f2d924c61f68dc071375b.tar.gz org.eclipse.linuxtools-5bf898df4587cb5dcb2f2d924c61f68dc071375b.tar.xz org.eclipse.linuxtools-5bf898df4587cb5dcb2f2d924c61f68dc071375b.zip |
Let it test all build options.
* make buildPrep has similar signature to other build*
* add javadocs
* simplify test class to not have checks to explicitly fail if it will
happen internally too.
Change-Id: I53c9df116bd636677d0f510fcb8a1ece3bf05c52
Reviewed-on: https://git.eclipse.org/r/9627
Tested-by: Hudson CI
Reviewed-by: Camilo Bernal <cabernal@redhat.com>
IP-Clean: Camilo Bernal <cabernal@redhat.com>
Tested-by: Camilo Bernal <cabernal@redhat.com>
Diffstat (limited to 'rpm/org.eclipse.linuxtools.rpm.core')
2 files changed, 35 insertions, 6 deletions
diff --git a/rpm/org.eclipse.linuxtools.rpm.core/src/org/eclipse/linuxtools/internal/rpm/core/utils/RPMBuild.java b/rpm/org.eclipse.linuxtools.rpm.core/src/org/eclipse/linuxtools/internal/rpm/core/utils/RPMBuild.java index a8db118c84..971f460dfe 100644 --- a/rpm/org.eclipse.linuxtools.rpm.core/src/org/eclipse/linuxtools/internal/rpm/core/utils/RPMBuild.java +++ b/rpm/org.eclipse.linuxtools.rpm.core/src/org/eclipse/linuxtools/internal/rpm/core/utils/RPMBuild.java @@ -75,12 +75,13 @@ public class RPMBuild { * the spec file * @param outStream * The stream to write the output to. + * @return The return code of the build job. * @throws CoreException * If the operation fails. */ - public void buildPrep(IResource specFile, OutputStream outStream) + public IStatus buildPrep(IResource specFile, OutputStream outStream) throws CoreException { - build(specFile, outStream, "-bp"); //$NON-NLS-1$ + return build(specFile, outStream, "-bp"); //$NON-NLS-1$ } /** diff --git a/rpm/org.eclipse.linuxtools.rpm.core/src/org/eclipse/linuxtools/rpm/core/RPMProject.java b/rpm/org.eclipse.linuxtools.rpm.core/src/org/eclipse/linuxtools/rpm/core/RPMProject.java index b8a8b95651..e8c429a33b 100644 --- a/rpm/org.eclipse.linuxtools.rpm.core/src/org/eclipse/linuxtools/rpm/core/RPMProject.java +++ b/rpm/org.eclipse.linuxtools.rpm.core/src/org/eclipse/linuxtools/rpm/core/RPMProject.java @@ -66,10 +66,20 @@ public class RPMProject { } } + /** + * Returns the configuration (RPMBuild, FLAT) for this project. + * + * @return The project configuration. + */ public IProjectConfiguration getConfiguration() { return rpmConfig; } + /** + * Returns the .spec file of this project. + * + * @return The .spec file or null if one is not found. + */ public IResource getSpecFile() { IContainer specsFolder = getConfiguration().getSpecsFolder(); IResource file = null; @@ -80,12 +90,17 @@ public class RPMProject { List<IResource> installedSpecs = specVisitor.getSpecFiles(); file = installedSpecs.get(0); } catch (CoreException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + // ignore, failed to find .spec file. } return file; } + /** + * Import a SRPM into this RPM project using local file. + * + * @param externalFile The SRPM file. + * @throws CoreException If there is problem with the .src.rpm file. + */ public void importSourceRPM(File externalFile) throws CoreException { // Copy original SRPM to workspace IFile srpmFile = getConfiguration().getSrpmsFolder().getFile( @@ -139,6 +154,12 @@ public class RPMProject { importSourceRPM(tempFile); } + /** + * Build both source and binary rpms. + * @param outStream The stream to right command output to. + * @return The result of the command. + * @throws CoreException If exception occurs during building. + */ public IStatus buildAll(OutputStream outStream) throws CoreException { RPMBuild rpmbuild = new RPMBuild(getConfiguration()); IStatus result = rpmbuild.buildAll(getSpecFile(), outStream); @@ -186,11 +207,18 @@ public class RPMProject { return result; } - public void buildPrep(OutputStream out) throws CoreException { + /** + * Prepares sources for build (rpmbuild -bp). + * @param out The stream to right command output to. + * @return The result of the command. + * @throws CoreException If exception occurs during building. + */ + public IStatus buildPrep(OutputStream out) throws CoreException { RPMBuild rpmbuild = new RPMBuild(getConfiguration()); - rpmbuild.buildPrep(getSpecFile(), out); + IStatus result = rpmbuild.buildPrep(getSpecFile(), out); getConfiguration().getBuildFolder().refreshLocal( IResource.DEPTH_INFINITE, null); + return result; } } |