diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:36:50 +0100 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 15:25:03 +0100 |
commit | 41ac47d732eed8392d60d0f6773e5a279d49b999 (patch) | |
tree | cf19d099db9cfdb8d73aa21c31e7aa1cc86ff860 /plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/newproject/BBConfigurationInitializeOperation.java | |
download | eclipse-poky-juno-master.tar.gz |
Migrated from the internal git server on the dora-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/newproject/BBConfigurationInitializeOperation.java')
-rw-r--r-- | plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/newproject/BBConfigurationInitializeOperation.java | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/newproject/BBConfigurationInitializeOperation.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/newproject/BBConfigurationInitializeOperation.java new file mode 100644 index 0000000..4f15107 --- /dev/null +++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/wizards/newproject/BBConfigurationInitializeOperation.java | |||
@@ -0,0 +1,50 @@ | |||
1 | /***************************************************************************** | ||
2 | * Copyright (c) 2009 Ken Gilmer | ||
3 | * All rights reserved. This program and the accompanying materials | ||
4 | * are made available under the terms of the Eclipse Public License v1.0 | ||
5 | * which accompanies this distribution, and is available at | ||
6 | * http://www.eclipse.org/legal/epl-v10.html | ||
7 | * | ||
8 | * Contributors: | ||
9 | * Ken Gilmer - initial API and implementation | ||
10 | *******************************************************************************/ | ||
11 | package org.yocto.bc.ui.wizards.newproject; | ||
12 | |||
13 | import java.io.Writer; | ||
14 | import java.lang.reflect.InvocationTargetException; | ||
15 | |||
16 | import org.eclipse.core.runtime.IProgressMonitor; | ||
17 | import org.eclipse.jface.operation.IRunnableWithProgress; | ||
18 | |||
19 | import org.yocto.bc.bitbake.BBSession; | ||
20 | import org.yocto.bc.bitbake.ProjectInfoHelper; | ||
21 | import org.yocto.bc.ui.Activator; | ||
22 | import org.yocto.bc.ui.model.ProjectInfo; | ||
23 | |||
24 | public class BBConfigurationInitializeOperation implements IRunnableWithProgress { | ||
25 | |||
26 | private final ProjectInfo pinfo; | ||
27 | private final Writer writer; | ||
28 | |||
29 | public BBConfigurationInitializeOperation(ProjectInfo pinfo) { | ||
30 | this.pinfo = pinfo; | ||
31 | writer = null; | ||
32 | } | ||
33 | |||
34 | public BBConfigurationInitializeOperation(ProjectInfo pinfo, Writer writer) { | ||
35 | this.pinfo = pinfo; | ||
36 | this.writer = writer; | ||
37 | } | ||
38 | |||
39 | public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { | ||
40 | BBSession session; | ||
41 | try { | ||
42 | ProjectInfoHelper.store(pinfo.getRootPath(), pinfo); | ||
43 | session = Activator.getBBSession(pinfo.getRootPath(), writer); | ||
44 | session.initialize(); | ||
45 | |||
46 | } catch (Exception e) { | ||
47 | throw new InvocationTargetException(e); | ||
48 | } | ||
49 | } | ||
50 | } | ||