Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-10-28 07:44:27 +0000
committerEike Stepper2012-10-28 07:44:27 +0000
commit5318390ffd6a22cee61a65f636924ed72d2d18fa (patch)
tree630a8140e279fe10b6c1f04b3fb3eda15f212b0b /plugins/org.eclipse.emf.cdo.releng.apireports
parent7d6b5e47252ef232486a2434c88e98cc25ff7e8d (diff)
downloadcdo-5318390ffd6a22cee61a65f636924ed72d2d18fa.tar.gz
cdo-5318390ffd6a22cee61a65f636924ed72d2d18fa.tar.xz
cdo-5318390ffd6a22cee61a65f636924ed72d2d18fa.zip
[391874] [Releng] Generate API reports during Hudson build drops/I20121028-0345
https://bugs.eclipse.org/bugs/show_bug.cgi?id=391874
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.releng.apireports')
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.apireports/src/org/eclipse/emf/cdo/releng/apireports/ApiReportsActor.java76
1 files changed, 48 insertions, 28 deletions
diff --git a/plugins/org.eclipse.emf.cdo.releng.apireports/src/org/eclipse/emf/cdo/releng/apireports/ApiReportsActor.java b/plugins/org.eclipse.emf.cdo.releng.apireports/src/org/eclipse/emf/cdo/releng/apireports/ApiReportsActor.java
index 1041fd1d3c..85b788a0b3 100644
--- a/plugins/org.eclipse.emf.cdo.releng.apireports/src/org/eclipse/emf/cdo/releng/apireports/ApiReportsActor.java
+++ b/plugins/org.eclipse.emf.cdo.releng.apireports/src/org/eclipse/emf/cdo/releng/apireports/ApiReportsActor.java
@@ -27,6 +27,7 @@ import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.pde.api.tools.internal.ApiBaselineManager;
import org.eclipse.pde.api.tools.internal.comparator.DeltaXmlVisitor;
@@ -64,31 +65,18 @@ public class ApiReportsActor extends AbstractActor
{
}
- public static void updateMonitor(IProgressMonitor monitor, int work) throws OperationCanceledException
+ @Override
+ protected IStatus internalPerform(IActionContext context, IProgressMonitor monitor) throws CoreException
{
- if (monitor == null)
+ Map<String, ? extends Object> properties = context.getAction().getActorProperties();
+ String baselineName = (String)properties.get("baseline");
+ if (baselineName == null || baselineName.length() == 0)
{
- return;
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Baseline name not specified");
}
- if (monitor.isCanceled())
- {
- throw new OperationCanceledException();
- }
- monitor.worked(work);
- }
- public static void updateMonitor(IProgressMonitor monitor) throws OperationCanceledException
- {
- updateMonitor(monitor, 0);
- }
-
- @Override
- protected IStatus internalPerform(IActionContext context, IProgressMonitor monitor) throws CoreException
- {
- Map<String, ? extends Object> properties = context.getProperties();
- String baselineName = (String)properties.get("baseline.name");
- String reportFileName = (String)properties.get("reportfile.name");
- String exclusionPatterns = (String)properties.get("exclusion.patterns");
+ String exclusionPatterns = (String)properties.get("exclude");
+ String reportFileName = System.getProperty("api.report", new File("api.xml").getAbsolutePath());
SubMonitor progress = SubMonitor.convert(monitor, 100);
progress.subTask("Collecting elements to compare");
@@ -185,20 +173,32 @@ public class ApiReportsActor extends AbstractActor
private List<Object> collectProjects(String exclusionPatterns)
{
- Pattern[] patterns = new Pattern[exclusionPatterns.length()];
- String[] split = exclusionPatterns.split(",");
- for (int i = 0; i < split.length; i++)
+ Pattern[] patterns = new Pattern[0];
+ if (exclusionPatterns != null)
{
- patterns[i] = Pattern.compile(split[i]);
+ String[] split = exclusionPatterns.split(",");
+ patterns = new Pattern[split.length];
+ for (int i = 0; i < split.length; i++)
+ {
+ Pattern pattern = Pattern.compile(split[i]);
+ patterns[i] = pattern;
+ }
}
List<Object> result = new ArrayList<Object>();
for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects())
{
- String name = project.getName();
- if (!isExcluded(patterns, name))
+ if (project.isAccessible())
{
- result.add(project);
+ String name = project.getName();
+ if (!isExcluded(patterns, name))
+ {
+ IJavaProject javaProject = JavaCore.create(project);
+ if (javaProject != null)
+ {
+ result.add(javaProject);
+ }
+ }
}
}
@@ -396,4 +396,24 @@ public class ApiReportsActor extends AbstractActor
}
}
}
+
+ private static void updateMonitor(IProgressMonitor monitor, int work) throws OperationCanceledException
+ {
+ if (monitor == null)
+ {
+ return;
+ }
+
+ if (monitor.isCanceled())
+ {
+ throw new OperationCanceledException();
+ }
+
+ monitor.worked(work);
+ }
+
+ private static void updateMonitor(IProgressMonitor monitor) throws OperationCanceledException
+ {
+ updateMonitor(monitor, 0);
+ }
}

Back to the top