summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-03-23 22:03:55 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2010-03-23 22:03:55 +0000
commit9c466c78b19347797d294f66faf7db91596c40de (patch)
tree358444de4ec973c058369e3a328fbc6dd31ae655
parent497e8dc38cfdbab4b754684f2cea5c74a5e405e4 (diff)
Reorder the methods
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@926811 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sandbox/rfeng/eclipse-workspace/src/main/java/org/apache/tuscany/eclipse/workspace/WorkspaceConfigurator.java41
1 files changed, 28 insertions, 13 deletions
diff --git a/sandbox/rfeng/eclipse-workspace/src/main/java/org/apache/tuscany/eclipse/workspace/WorkspaceConfigurator.java b/sandbox/rfeng/eclipse-workspace/src/main/java/org/apache/tuscany/eclipse/workspace/WorkspaceConfigurator.java
index ca1fbfa412..54f2ae9cbe 100644
--- a/sandbox/rfeng/eclipse-workspace/src/main/java/org/apache/tuscany/eclipse/workspace/WorkspaceConfigurator.java
+++ b/sandbox/rfeng/eclipse-workspace/src/main/java/org/apache/tuscany/eclipse/workspace/WorkspaceConfigurator.java
@@ -71,21 +71,35 @@ public class WorkspaceConfigurator implements IApplication {
private final Object lock = new Object();
public Object start(final IApplicationContext appcontext) throws Exception {
- IProgressMonitor monitor = createMonitor();
final String[] args = (String[])appcontext.getArguments().get(IApplicationContext.APPLICATION_ARGS);
+ configure(args);
+ return EXIT_OK;
+ }
+ private void configure(final String[] args) throws JavaModelException, InterruptedException, Exception,
+ CoreException, FileNotFoundException, ParserConfigurationException, SAXException, IOException {
+ IProgressMonitor monitor = createMonitor();
+
+ // Configure JDT
configureJDT();
- setM2REPOClassPathVariable(args, monitor);
+
+ // Set M2_REPO classpath variable
+ configureMavenClassPathVariable(args, monitor);
+
+ // Schedule a job to set target platform
setTargetPlatform(args, monitor);
- synchronized (lock) {
- lock.wait(60000);
- }
+
+ // Import/refresh projects
configureWorkspace(args, monitor);
- return EXIT_OK;
+
+ // Start a clean/full build
+ buildWorkspace(monitor);
+
+ // Save the workspace
+ workspace.save(true, monitor);
}
- private void setTargetPlatform(String args[], IProgressMonitor monitor) throws FileNotFoundException,
- CoreException, ParserConfigurationException, SAXException, IOException {
+ private void setTargetPlatform(String args[], IProgressMonitor monitor) throws Exception {
String targetFile = getOptionValue(args, TARGET_DEFINITION);
if (targetFile == null) {
return;
@@ -135,6 +149,11 @@ public class WorkspaceConfigurator implements IApplication {
}
});
job.schedule();
+ // Wait for the target platform to be set
+ synchronized (lock) {
+ lock.wait(60000);
+ }
+
}
private IProgressMonitor createMonitor() {
@@ -156,7 +175,7 @@ public class WorkspaceConfigurator implements IApplication {
};
}
- private IPath setM2REPOClassPathVariable(String args[], IProgressMonitor monitor) throws JavaModelException {
+ private IPath configureMavenClassPathVariable(String args[], IProgressMonitor monitor) throws JavaModelException {
IPath var = JavaCore.getClasspathVariable(M2_REPO);
if (var == null) {
String localRepo = getOptionValue(args, MAVEN_LOCAL_REPO);
@@ -183,10 +202,6 @@ public class WorkspaceConfigurator implements IApplication {
configureProjects(sourceRoot, monitor);
- // cleanProjects(monitor);
- buildWorkspace(monitor);
-
- workspace.save(true, monitor);
}
private String getOptionValue(final String[] args, String option) {