35 import com.nokia.cpp.internal.api.utils.core.*; |
35 import com.nokia.cpp.internal.api.utils.core.*; |
36 |
36 |
37 |
37 |
38 public class SBVView extends ViewBase<ISBVOwnedModel> implements ISBVView { |
38 public class SBVView extends ViewBase<ISBVOwnedModel> implements ISBVView { |
39 |
39 |
|
40 /** The name of the variant that this configuration extends */ |
40 private static final String EXTENDS = "EXTENDS"; //$NON-NLS-1$ |
41 private static final String EXTENDS = "EXTENDS"; //$NON-NLS-1$ |
|
42 /** The name of the variant */ |
|
43 private static final String VARIANT = "VARIANT"; //$NON-NLS-1$ |
|
44 /** Defines the variant as a virtual variant, which means that this variant configuration is not compiled. */ |
41 private static final String VIRTUAL = "VIRTUAL"; //$NON-NLS-1$ |
45 private static final String VIRTUAL = "VIRTUAL"; //$NON-NLS-1$ |
|
46 /** The global variant hrh file, which is include to the building and image creation. If this parameter is not existing the system tries to include a <variantname>.hrh */ |
42 private static final String VARIANT_HRH = "VARIANT_HRH"; //$NON-NLS-1$ |
47 private static final String VARIANT_HRH = "VARIANT_HRH"; //$NON-NLS-1$ |
43 |
48 /** set,prepend or append include paths to the global list of build time system includes (Used during abld command). */ |
|
49 private static final String BUILD_INCLUDE = "BUILD_INCLUDE"; //$NON-NLS-1$ |
|
50 /** set,prepend or append include paths to the global list of rom build time system includes (Used during buildrom.pl command). */ |
|
51 private static final String ROM_INCLUDE = "ROM_INCLUDE"; //$NON-NLS-1$ |
44 |
52 |
45 private IASTSBVTranslationUnit tu; |
53 private IASTSBVTranslationUnit tu; |
|
54 private String variantName; |
46 private boolean sawHeaderComment; |
55 private boolean sawHeaderComment; |
47 private boolean sawExtends; |
56 private boolean sawExtends; |
48 private boolean sawBuildHRH; |
57 private boolean sawBuildHRH; |
49 private String extendsVariantStr; |
58 private String extendsVariantStr; |
50 private String varintHRHStr; |
59 private String varintHRHStr; |
51 private boolean isVirtual; |
60 private boolean isVirtual; |
|
61 |
|
62 /** Path, flag */ |
|
63 private Map<String, String> buildIncludePaths = new HashMap<String, String>(); |
|
64 |
|
65 /** ROM build includes */ |
|
66 private Map<String, String> romBuildIncludePaths = new HashMap<String, String>();; |
52 |
67 |
53 /** |
68 /** |
54 * @param model |
69 * @param model |
55 * @param parser |
70 * @param parser |
56 * @param viewConfiguration |
71 * @param viewConfiguration |
93 if (!sawExtends && option.equals(EXTENDS)) { |
108 if (!sawExtends && option.equals(EXTENDS)) { |
94 setExtends(value); |
109 setExtends(value); |
95 sawExtends = true; |
110 sawExtends = true; |
96 } |
111 } |
97 |
112 |
98 if (!sawBuildHRH && option.equals(VARIANT_HRH)) { |
113 else if (!sawBuildHRH && option.equals(VARIANT_HRH)) { |
99 setBuildHRHFile(value); |
114 setBuildHRHFile(value); |
100 sawBuildHRH = true; |
115 sawBuildHRH = true; |
101 } |
116 } |
|
117 |
|
118 else if (option.equals(VARIANT)) { |
|
119 setVariantName(value); |
|
120 } |
|
121 |
|
122 else if (option.equals(BUILD_INCLUDE)){ |
|
123 addBuildInclude(value); |
|
124 } |
|
125 |
|
126 else if (option.equals(ROM_INCLUDE)){ |
|
127 addROMInclude(value); |
|
128 } |
102 |
129 |
103 } |
130 } |
104 |
131 |
105 /** |
132 /** |
106 * Handle a flag statement |
133 * Handle a flag statement |
181 public String getExtends() { |
208 public String getExtends() { |
182 return extendsVariantStr; |
209 return extendsVariantStr; |
183 } |
210 } |
184 |
211 |
185 /* (non-Javadoc) |
212 /* (non-Javadoc) |
186 * @see com.nokia.carbide.cpp.epoc.engine.model.sbv.ISBVView#getName() |
|
187 */ |
|
188 public String getName() { |
|
189 return getModel().getPath().removeFileExtension().lastSegment(); |
|
190 } |
|
191 |
|
192 |
|
193 /* (non-Javadoc) |
|
194 * @see com.nokia.carbide.cpp.epoc.engine.model.sbv.ISBVView#setCustomizes(java.lang.String) |
213 * @see com.nokia.carbide.cpp.epoc.engine.model.sbv.ISBVView#setCustomizes(java.lang.String) |
195 */ |
214 */ |
196 public void setExtends(String platform) { |
215 public void setExtends(String platform) { |
197 this.extendsVariantStr = platform; |
216 this.extendsVariantStr = platform; |
198 } |
217 } |
221 |
240 |
222 public void setBuildHRHFile(String pathStr) { |
241 public void setBuildHRHFile(String pathStr) { |
223 varintHRHStr = pathStr; |
242 varintHRHStr = pathStr; |
224 } |
243 } |
225 |
244 |
|
245 public void setVariantName(String variantName){ |
|
246 this.variantName = variantName; |
|
247 } |
|
248 |
|
249 public String getVariantName(){ |
|
250 return variantName; |
|
251 } |
|
252 |
|
253 public void addBuildInclude(String arguments) { |
|
254 String[] args = arguments.split("\\s+"); |
|
255 if (args.length == 2){ |
|
256 buildIncludePaths.put(args[1], args[0]); |
|
257 } |
|
258 |
|
259 } |
|
260 |
|
261 public void addROMInclude(String arguments) { |
|
262 String[] args = arguments.split("\\s+"); |
|
263 if (args.length == 2){ |
|
264 romBuildIncludePaths.put(args[1], args[0]); |
|
265 } |
|
266 |
|
267 } |
|
268 |
|
269 public Map<String, String> getBuildIncludes() { |
|
270 return buildIncludePaths; |
|
271 } |
|
272 |
|
273 public Map<String, String> getROMBuildIncludes() { |
|
274 return romBuildIncludePaths; |
|
275 } |
|
276 |
226 |
277 |
227 |
278 |
228 } |
279 } |