summaryrefslogtreecommitdiffstats
path: root/plugins/org.yocto.bc.ui/src/org/yocto/bc/bitbake/BBSession.java
blob: 4434df80cd443e96c1c8908aeff6eb69d3790451 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
/*****************************************************************************
 * Copyright (c) 2009 Ken Gilmer, 2013 Intel Corporation
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Ken Gilmer - initial API and implementation
 *     Ioana Grigoropol (Intel) - adapt class for remote support
 *******************************************************************************/
package org.yocto.bc.bitbake;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.io.StringReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Stack;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.concurrent.locks.Lock;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.preference.JFacePreferences;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.console.MessageConsoleStream;
import org.eclipse.ui.progress.WorkbenchJob;

import org.yocto.bc.ui.model.IModelElement;
import org.yocto.bc.ui.model.ProjectInfo;
import org.yocto.remote.utils.RemoteHelper;
import org.yocto.remote.utils.YoctoCommand;

/**
 * BBSession encapsulates a global bitbake configuration and is the primary interface
 * for actions against a BitBake installation.
 * 
 * @author kgilmer
 *
 */
public class BBSession implements IBBSessionListener, IModelElement, Map {
	public static final int TYPE_VARIABLE_ASSIGNMENT = 1;
	public static final int TYPE_UNKNOWN = 2;
	public static final int TYPE_STATEMENT = 3;
	public static final int TYPE_FLAG = 4;
	
	public static final String BB_ENV_FILE = "bitbake.env";

	public static final String CONF_DIR = "conf";
	public static final String BUILDDIR_INDICATORS [] = {
		"local.conf",
		"bblayers.conf",
	};

	protected final ProjectInfo pinfo;
	protected final ShellSession shell;
	protected Map<?,?> properties = null;
	protected List <URI> depends = null;
	protected boolean initialized = false;
	protected boolean errorOccured = false;
	protected MessageConsole sessionConsole;
	private final ReentrantReadWriteLock rwlock = new ReentrantReadWriteLock();
	private final Lock rlock = rwlock.readLock();
	private final Lock wlock = rwlock.writeLock();
	protected String parsingCmd;
	private boolean silent = false;
	private String errorLines = "";

	public BBSession(ShellSession ssession, URI projectRoot) throws IOException {
		shell = ssession;
		this.pinfo = new ProjectInfo();
		pinfo.setLocationURI(projectRoot);
		pinfo.setInitScriptPath(ProjectInfoHelper.getInitScriptPath(projectRoot));
		this.parsingCmd = "DISABLE_SANITY_CHECKS=\"1\" bitbake -e >& " + BB_ENV_FILE;
	}

	public BBSession(ShellSession ssession, URI projectRoot, boolean silent) throws IOException {
		this(ssession, projectRoot);
		this.silent = silent;
	}
	
	private Collection adapttoIPath(List<File> asList, IProject project) {

		List pathList = new ArrayList();

		for (Iterator i = asList.iterator(); i.hasNext();) {
			File f = (File) i.next();
			IFile ff = project.getFile(stripLeading(f.toString(), project.getLocationURI().getPath()));
			if (ff.exists()) {
				pathList.add(ff);
			}
		}

		return pathList;
	}
	
	private String appendAll(String[] elems, int st) {
		StringBuffer sb = new StringBuffer();

		for (int i = st; i < elems.length; ++i) {
			sb.append(elems[i]);
		}

		return sb.toString();
	}
	
	private int charCount(String trimmed, char c) {
		int i = 0;
		int p = 0;

		while ((p = trimmed.indexOf(c, p)) > -1) {
			i++;
			p++;
		}

		return i;
	}
	
	public void clear() {
		throw new RuntimeException("BB configuration is read-only.");
	}

	public boolean containsKey(Object arg0) {
		try {
			checkValidAndLock(true);
			return properties.containsKey(arg0);
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}finally {
			rlock.unlock();
		}
	}

	public boolean containsValue(Object arg0) {
		try {
			checkValidAndLock(true);
			return properties.containsValue(arg0);
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}finally {
			rlock.unlock();
		}
	}

	public Set entrySet() {
		try {
			checkValidAndLock(true);
			return properties.entrySet();
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}finally {
			rlock.unlock();
		}
	}

	@Override
	public boolean equals(Object arg0) {
		try {
			checkValidAndLock(true);
			return properties.equals(arg0);
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}finally {
			rlock.unlock();
		}
	}

	public ShellSession getShell() {
		return shell;
	}

	public URI getProjInfoRoot() {
		return pinfo.getOriginalURI();
	}

	/**
	 * Recursively generate list of Recipe files from a root directory.
	 * 
	 * @param rootDir
	 * @param recipes
	 * @param fileExtension
	 * @param project
	 */
	private void findRecipes(File rootDir, List recipes, final String fileExtension, IProject project) {
		File[] children = rootDir.listFiles(new FileFilter() {

			public boolean accept(File pathname) {
				return pathname.isFile() && pathname.getName().endsWith(fileExtension);
			}

		});

		if (children != null && children.length > 0) {
			recipes.addAll(adapttoIPath(Arrays.asList(children), project));
		}

		File[] childDirs = rootDir.listFiles(new FileFilter() {

			public boolean accept(File pathname) {
				return pathname.isDirectory();
			}

		});

		if (childDirs != null && childDirs.length > 0) {
			for (int i = 0; i < childDirs.length; ++i) {
				findRecipes(childDirs[i], recipes, fileExtension, project);
			}
		}
	}

	private Collection findRecipes(List paths, IProject project) {
		List recipes = new ArrayList();

		for (Iterator i = paths.iterator(); i.hasNext();) {
			String rawPath = (String) i.next();
			String[] elems = rawPath.split("\\*/\\*");

			if (elems.length == 2) {

				File rootDir = new File(elems[0]);

				findRecipes(rootDir, recipes, elems[1], project);
			}
		}

		return recipes;
	}

	public Object get(Object arg0) {
		try {
			checkValidAndLock(true);
			return properties.get(arg0);
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}finally {
			rlock.unlock();
		}
	}

	private List getBitBakeKeywords() {
		return Arrays.asList(BBLanguageHelper.BITBAKE_KEYWORDS);
	}

	/**
	 * @return A MessageConsole for this BB session.
	 */
	public MessageConsole getConsole() {
		if (sessionConsole == null) {
			String cName = ProjectInfoHelper.getProjectName(pinfo.getOriginalURI()) + " Console";
			IConsoleManager conMan = ConsolePlugin.getDefault().getConsoleManager();
			IConsole[] existing = conMan.getConsoles();
			for (int i = 0; i < existing.length; i++)
				if (cName.equals(existing[i].getName())) {
					sessionConsole = (MessageConsole) existing[i];
					break;
				}
			if (sessionConsole == null) {
				sessionConsole = new MessageConsole(cName, null);
				conMan.addConsoles(new IConsole[] { sessionConsole });
			}
		}
		
		ConsolePlugin.getDefault().getConsoleManager().showConsoleView(sessionConsole);
		
		return sessionConsole;
	}

	private int getLineType(String line) {

		if (line.contains("=")) {
			return TYPE_VARIABLE_ASSIGNMENT;
		}

		for (Iterator i = getBitBakeKeywords().iterator(); i.hasNext();) {
			if (line.startsWith((String) i.next())) {
				return TYPE_STATEMENT;
			}
		}

		if (line.contains(":")) {
			return TYPE_FLAG;
		}

		return TYPE_UNKNOWN;
	}

	public Collection getRecipeFiles(IProject project) {
		try {
			checkValidAndLock(true);
			if (!initialized) {
				throw new RuntimeException(this.getClass().getName() + " is not initialized.");
			}
			String bbfiles = (String) this.properties.get("BBFILES");
			List paths = parseBBFiles(bbfiles);
			return findRecipes(paths, project);
		} catch (Exception e) {
			return null;
		}
		finally {
			rlock.unlock();
		}
	}

	@Override
	public int hashCode() {
		try {
			checkValidAndLock(true);
			return properties.hashCode();
		} catch (Exception e) {
			e.printStackTrace();
			return 0;
		}finally {
			rlock.unlock();
		}
	}

	protected void checkExecuteError(String result, boolean hasErrors) {
		URI recipeURI = getDefaultDepends();
		String text = "Parsing " + ((recipeURI != null) ? ("recipe " + recipeURI) : "base configurations");
		if (hasErrors) {
			text = text + " ERROR!\n" + result;
		}else {
				text = text + " SUCCESS.\n";
		}
		if(!silent) {
			displayInConsole(text, -1, false);
		}
	}

	protected void displayInConsole(final String result, final int code, boolean clear) {
		MessageConsole  console = getConsole();
		final MessageConsoleStream info = console.newMessageStream();
		if(clear)
			console.clearConsole();
		new WorkbenchJob("Display parsing result") {
			public IStatus runInUIThread(IProgressMonitor monitor) {
				if(code != 0) {
					info.setColor(JFaceResources.getColorRegistry().get(JFacePreferences.ERROR_COLOR));
				}
				try {
					info.println(result);
					info.close();
				}catch (Exception e) {
					e.printStackTrace();
				}
				return Status.OK_STATUS;
			}
		}.schedule();
	}

	private void checkValidAndLock(boolean rdlck) throws Exception {
		if(rdlck)
			rlock.lock();
		else
			wlock.lock();
		if(!initialized) {
			//upgrade lock manually
			if(rdlck) {
				rlock.unlock();
				wlock.lock();
			}
			try {
				if(!initialized) { //recheck
					boolean hasErrors = false;
					String result = shell.execute(parsingCmd, hasErrors);

					properties = parseBBEnvironment(result);

					if (properties.size() == 0) { // there was an error in sourcing bitbake environment
						shell.printError(errorLines);
						errorOccured = true;
					} else {
						errorLines = "";
						errorOccured = false;
						initialized = true;
					}
					RemoteHelper.handleRunCommandRemote(this.pinfo.getConnection(), new YoctoCommand("rm -rf " + result + BB_ENV_FILE, result, ""), new NullProgressMonitor());
				}
			} finally {
				//downgrade lock
				if(rdlck) {
					rlock.lock();
					wlock.unlock();
				}
			}
		}
		//not release lock
	}

	public void initialize() throws Exception {
		try {
			checkValidAndLock(false);
		}finally {
			wlock.unlock();
		}
	}

	private boolean isBlockEnd(String trimmed) {
		return charCount(trimmed, '}') > charCount(trimmed, '{');
		// return trimmed.indexOf('}') > -1 && trimmed.indexOf('{') == -1;
	}

	private boolean isBlockStart(String trimmed) {
		return charCount(trimmed, '{') > charCount(trimmed, '}');
		// return trimmed.indexOf('{') > -1 && trimmed.indexOf('}') == -1;
	}

	public boolean isEmpty() {
		try {
			checkValidAndLock(true);
			return properties.isEmpty();
		} catch (Exception e) {
			e.printStackTrace();
			return true;
		}finally {
			rlock.unlock();
		}
	}
	
	public Set keySet() {
		try {
			checkValidAndLock(true);
			return properties.keySet();
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}finally {
			rlock.unlock();
		}
	}

	protected void parse(String bbOutfilePath, Map outMap) throws Exception {
		IHost connection = shell.getProjectInfo().getConnection();
		InputStream is = RemoteHelper.getRemoteInputStream(connection, bbOutfilePath, BB_ENV_FILE, new NullProgressMonitor());
		RemoteHelper.getRemoteHostFile(connection, bbOutfilePath + BB_ENV_FILE, new NullProgressMonitor());
		BufferedReader reader = new BufferedReader(new InputStreamReader(is));
		String line;
		boolean inLine = false;
		StringBuffer sb = null;
		Stack blockStack = new Stack();

		while ((line = reader.readLine()) != null) {
			errorLines += line;
			String trimmed = line.trim();
			if (trimmed.length() == 0 || line.startsWith("#")) {
				// weed out the blank and comment lines
				continue;
			}
			// Now we look for block start ends, and ignore all code within
			// blocks.
			if (isBlockStart(trimmed)) {
				blockStack.push(trimmed);
			} else if (isBlockEnd(trimmed)) {
				blockStack.pop();

			}

			if (!blockStack.isEmpty()) {
				// we are in a code block, continue until we break into global
				// scope.
				continue;
			}
			if (trimmed.endsWith("\\")) {
				if (!inLine) {
					inLine = true;
					sb = new StringBuffer(trimmed.substring(0, trimmed.length() - 1));
				} else {
					sb.append(trimmed.substring(0, trimmed.length() - 1));
				}
				// Only parse the line when we have the complete contents.
				continue;
			} else if (inLine) {
				inLine = false;
				line = sb.toString();
			}

			parseLine(line, outMap);
		}
	}
	
	private void parseAdditiveAssignment(String line, String operator, Map mo) throws Exception {
		String[] elems = splitAssignment(line, "\\+=");

		if (elems.length != 2) {
			throw new Exception("Unable to parse additive variable assignment in line: " + line);
		}

		if (!mo.containsKey(elems[0])) {
			mo.put(elems[0].trim(), elems[1]);
		} else {
			String existing = (String) mo.get(elems[0]);
			if (operator.equals("+=")) {
				mo.put(elems[0], existing + elems[1]);
			} else {
				mo.put(elems[0], elems[1] + existing);
			}
		}
	}

	protected URI getDefaultDepends() {
		return null;
	}
	
	protected Map parseBBEnvironment(String bbOutFilePath) throws Exception {
		Map env = new Hashtable();
		this.depends = new ArrayList<URI>();

		parse(bbOutFilePath, env);

		String included = (String) env.get("BBINCLUDED");
		if(getDefaultDepends() != null) {
			this.depends.add(getDefaultDepends());
		}
		if(included != null) {
			String[] includedSplitted = included.split(" ");
			for (String incl : includedSplitted){
				if (!incl.contains("${")) {
					this.depends.add(new URI(incl));
				}
			}
		}

		return env;
	}


	private List parseBBFiles(String bbfiles) {
		return Arrays.asList(bbfiles.split(" "));
	}
	
	//Map delegate methods 

	private void parseConditionalAssignment(String line, Map mo) throws Exception {
		String[] elems = splitAssignment(line, "\\?=");

		if (elems.length != 2) {
			throw new Exception("Unable to parse conditional variable assignment in line: " + line);
		}

		if (!mo.containsKey(elems[0].trim())) {
			mo.put(elems[0].trim(), elems[1].trim());
		}
	}

	private void parseImmediateAssignment(String line, String delimiter, Map mo) throws Exception {
		String[] elems = splitAssignment(line, delimiter);

		mo.put(elems[0], substitute(elems[1], mo));
	}

	private void parseKeyValue(String line, String delimiter, Map mo) throws Exception {
		String[] elems = splitAssignment(line, delimiter);

		mo.put(elems[0], elems[1]);
	}

	private void parseLine(String line, Map mo) throws Exception {

		switch (getLineType(line)) {
		case TYPE_VARIABLE_ASSIGNMENT:
			parseVariableAssignment(line, mo);
			break;
		case TYPE_STATEMENT:
		case TYPE_FLAG:
			// for now ignore statements
			break;
		case TYPE_UNKNOWN:
			// we'll gloss over unknown lines as well;
			break;
		default:
			throw new Exception("Unable to parse line: " + line);
		}
	}

	private void parseVariableAssignment(String line, Map mo) throws Exception {
		if (line.contains("?=")) {
			parseConditionalAssignment(line, mo);
		} else if (line.contains("+=")) {
			parseAdditiveAssignment(line, "+=", mo);
		} else if (line.contains("=+")) {
			parseAdditiveAssignment(line, "=+", mo);
		} else if (line.contains(":=")) {
			parseImmediateAssignment(line, ":=", mo);
		} else {
			parseKeyValue(line, "=", mo);
		}

	}

	private List parseVars(String line) {
		List l = new ArrayList();

		int i = 0;

		while ((i = line.indexOf("${", i)) > -1) {
			int i2 = line.indexOf("}", i);

			l.add(line.subSequence(i + 2, i2));
			i++;
		}

		return l;
	}

	public Object put(Object arg0, Object arg1) {
		throw new RuntimeException("BB configuration is read-only.");
	}

	public void putAll(Map arg0) {
		throw new RuntimeException("BB configuration is read-only.");
	}

	public Object remove(Object arg0) {
		throw new RuntimeException("BB configuration is read-only.");
	}

	private String removeQuotes(String line) {
		line = line.trim();

		if (line.startsWith("\"")) {
			line = line.substring(1);
		}

		if (line.endsWith("\"")) {
			line = line.substring(0, line.length() - 1);
		}

		return line;
	}

	public int size() {
		try {
			checkValidAndLock(true);
			return properties.size();
		}catch (Exception e) {
			e.printStackTrace();
			return 0;
		}finally {
			rlock.unlock();
		}
	}

	private String[] splitAssignment(String line, String seperator) throws Exception {
		String[] elems = line.split(seperator);

		if (elems.length < 2) {
			throw new Exception("Unable to parse assignment in line: " + line);
		} else if (elems.length == 2) {

			elems[0] = elems[0].trim(); // Clean up trailing or leading spaces.
			if (elems[0].startsWith("export ")) {
				elems[0] = elems[0].substring("export ".length()).trim();
			}
			elems[1] = removeQuotes(elems[1]); // Evaluate variables

			return elems;
		} else {
			String[] retVal = new String[2];

			retVal[0] = elems[0];
			if (retVal[0].startsWith("export ")) {
				retVal[0] = retVal[0].substring("export ".length()).trim();
			}
			retVal[1] = appendAll(elems, 1);

			return retVal;
		}
	}

	private String stripLeading(String target, String leading) {
		if (target.startsWith(leading)) {
			target = target.substring(leading.length());
		}

		return target;
	}

	/**
	 * Return a string with variable substitutions in place.
	 * 
	 * @param expression
	 * @return Input string with any substitutions from this file.
	 */
	public String substitute(String expression, Map mo) {

		List vars = parseVars(expression);

		for (Iterator i = vars.iterator(); i.hasNext();) {
			String varName = (String) i.next();
			String varToken = "${" + varName + "}";

			if (mo.containsKey(varName)) {
				expression = expression.replace(varToken, (String) mo.get(varName));
			} else if (System.getProperty(varName) != null) {
				expression = expression.replace(varToken, System.getProperty(varName));
			} else if (varName.toUpperCase().equals("HOME")) {
				expression = expression.replace(varToken, System.getProperty("user.home"));
			}
		}

		return expression;
	}

	public Collection values() {
		try {
			checkValidAndLock(true);
			return properties.values();
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}finally {
			rlock.unlock();
		}
	}

	public void changeNotified(IResource[] added, IResource[] removed, IResource[] changed) {
		wlock.lock();
		try {
			if (initialized && (removed != null || changed != null)) {
				for(int i=0;removed != null && i<removed.length;i++) {
					if (this.depends.contains(removed[i].getLocationURI())) {
						initialized = false;
						return;
					}
				}
				if (!depends.isEmpty()) {
					for(int i=0;changed != null && i<changed.length;i++) {
						if (changed[i].getLocation() != null && this.depends.contains(changed[i].getLocation().toString())) {
							initialized = false;
							return;
						}
					}
				}
			}
		}
		finally {
			wlock.unlock();
		}
	}

	public Map<String, String> getProperties() {
		return (Map<String, String>) properties;
	}

	public ProjectInfo getProjectInfo() {
		return pinfo;
	}

	public boolean hasErrorOccured() {
		return errorOccured;
	}

	public String getErrorLines() {
		return errorLines;
	}

}