blob: b7906d52658a250365a1d8e38b1cff7a5c0104ab (
plain) (
blame)
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
|
/*******************************************************************************
* Copyright (c) 2011 protos software gmbh (http://www.protos.de).
* 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:
* Thomas Schuetz and Henrik Rentz-Reichert (initial contribution)
*
*******************************************************************************/
package org.eclipse.etrice.generator.launch.cpp;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.etrice.generator.base.ILineOutput;
import org.eclipse.etrice.generator.cpp.Main;
import org.eclipse.etrice.generator.launch.GeneratorLaunchConfigurationDelegate;
/**
* @author Henrik Rentz-Reichert
*
*/
public class CppGeneratorLaunchConfigurationDelegate extends GeneratorLaunchConfigurationDelegate {
/* (non-Javadoc)
* @see org.eclipse.etrice.generator.launch.GeneratorLaunchConfigurationDelegate#addArguments(org.eclipse.debug.core.ILaunchConfiguration, java.lang.StringBuffer)
*/
@SuppressWarnings("deprecation")
@Override
protected void addArguments(ILaunchConfiguration configuration, StringBuffer argString) throws CoreException {
if (configuration.getAttribute(CppGeneratorConfigTab.LIB, false)) {
argString.append(" "+Main.OPTION_LIB);
}
if (configuration.getAttribute(CppGeneratorConfigTab.SAVE_GEN_MODEL, false)) {
argString.append(" "+Main.OPTION_SAVE_GEN_MODEL);
argString.append(" "+configuration.getAttribute(CppGeneratorConfigTab.GEN_MODEL_PATH, "?"));
}
if (configuration.getAttribute(CppGeneratorConfigTab.GEN_DOCUMENTATION, false)
|| configuration.getAttribute(CppGeneratorConfigTab.GEN_INSTANCE_DIAGRAM, false))
argString.append(" "+Main.OPTION_DOCUMENTATION);
if (configuration.getAttribute(CppGeneratorConfigTab.ETUNIT, false))
argString.append(" "+Main.OPTION_ETUNIT);
}
/* (non-Javadoc)
* @see org.eclipse.etrice.generator.launch.GeneratorLaunchConfigurationDelegate#runGenerator(java.lang.String[], org.eclipse.etrice.generator.launch.ILineOutput)
*/
@Override
protected void runGenerator(String[] args, ILineOutput out) {
org.eclipse.etrice.generator.cpp.Main.setOutput(out);
org.eclipse.etrice.generator.cpp.Main.setTerminateOnError(false);
org.eclipse.etrice.generator.cpp.Main.main(args);
}
/* (non-Javadoc)
* @see org.eclipse.etrice.generator.launch.GeneratorLaunchConfigurationDelegate#getConsoleName()
*/
@Override
protected String getConsoleName() {
return "eTrice C++ Generator Console";
}
}
|