19 public class BuildContextSBSv2 implements ISBSv2BuildContext { |
19 public class BuildContextSBSv2 implements ISBSv2BuildContext { |
20 |
20 |
21 private String platform; |
21 private String platform; |
22 private String target; |
22 private String target; |
23 private String sbsv2Alias; |
23 private String sbsv2Alias; |
24 ISymbianSDK sdk; |
24 private ISymbianSDK sdk; |
25 |
25 private String displayString; |
26 public BuildContextSBSv2(ISymbianSDK theSDK, String thePlatform, String theTarget, String theSBSv2Alias) { |
26 private String configID; // cconfiguration 'id' attribute from .cproject |
27 sdk = theSDK; |
27 |
28 platform = thePlatform.toUpperCase(); |
28 public BuildContextSBSv2(ISymbianSDK theSDK, String thePlatform, String theTarget, String theSBSv2Alias, String displayName, String configID) { |
29 target = theTarget.toUpperCase(); |
29 this.sdk = theSDK; |
30 sbsv2Alias = theSBSv2Alias; |
30 this.platform = thePlatform.toUpperCase(); |
31 |
31 this.target = theTarget.toUpperCase(); |
32 getDisplayString(); |
32 this.sbsv2Alias = theSBSv2Alias; |
|
33 this.displayString = displayName; |
|
34 this.configID = configID; |
33 } |
35 } |
34 |
36 |
35 @Override |
37 @Override |
36 public ISymbianSDK getSDK() { |
38 public ISymbianSDK getSDK() { |
37 return sdk; |
39 return sdk; |
45 @Override |
47 @Override |
46 public String getTargetString() { |
48 public String getTargetString() { |
47 return target; |
49 return target; |
48 } |
50 } |
49 |
51 |
|
52 public String getConfigID(){ |
|
53 return configID; |
|
54 } |
|
55 |
50 @Override |
56 @Override |
51 public String getDisplayString() { |
57 public String getDisplayString() { |
52 // TODO We will need to cobble up proper display names |
58 |
53 //return "(" + sbsv2Alias + ") " + "[" + sdk.getUniqueId() + "]" ; |
59 |
54 |
60 // TODO: Still need to decide on how to set display string |
55 // TODO: This is temporary to support the old configs where |
61 // and how it's used for legacy SBSv2 configs |
56 // The display name and id were the same thing. Need to work on supporting both |
62 if (displayString != null && !displayString.equals(configID)){ |
57 // as we migrate the display name to the settings and use a truly unique ID for configs. |
63 return displayString; |
58 |
64 } |
59 String EMULATOR_DISPLAY_TEXT = "Emulator"; //$NON-NLS-1$ |
65 |
60 String PHONE_DISPLAY_TEXT = "Phone"; //$NON-NLS-1$ |
66 // TODO: else fallback for old configs, we should convert |
61 String DEBUG_DISPLAY_TEXT = "Debug"; //$NON-NLS-1$ |
67 String EMULATOR_DISPLAY_TEXT = "Emulator"; //$NON-NLS-1$ |
62 String RELEASE_DISPLAY_TEXT = "Release"; //$NON-NLS-1$ |
68 String PHONE_DISPLAY_TEXT = "Phone"; //$NON-NLS-1$ |
63 String SPACE_DISPLAY_TEXT = " "; //$NON-NLS-1$ |
69 String DEBUG_DISPLAY_TEXT = "Debug"; //$NON-NLS-1$ |
64 String SDK_NOT_INSTALLED = "SDK not installed"; //$NON-NLS-1$ |
70 String RELEASE_DISPLAY_TEXT = "Release"; //$NON-NLS-1$ |
|
71 String SPACE_DISPLAY_TEXT = " "; //$NON-NLS-1$ |
|
72 String SDK_NOT_INSTALLED = "SDK not installed"; //$NON-NLS-1$ |
65 String displayString = null; |
73 String displayString = null; |
66 if (displayString == null) { |
74 if (displayString == null) { |
67 // in the form Emulation Debug (WINSCW) [S60_3rd_MR] or |
75 // in the form Emulation Debug (WINSCW) [S60_3rd_MR] or |
68 // Phone Release (GCCE) [S60_3rd_MR] |
76 // Phone Release (GCCE) [S60_3rd_MR] |
69 if (platform.compareTo(ISymbianBuildContext.EMULATOR_PLATFORM) == 0) { |
77 if (platform.compareTo(ISymbianBuildContext.EMULATOR_PLATFORM) == 0) { |
81 String basePlatform = sbsv2Alias; |
89 String basePlatform = sbsv2Alias; |
82 |
90 |
83 displayString = displayString + " (" + basePlatform + ") [" + getSDK().getUniqueId() + "]"; //$NON-NLS-1$ |
91 displayString = displayString + " (" + basePlatform + ") [" + getSDK().getUniqueId() + "]"; //$NON-NLS-1$ |
84 } |
92 } |
85 return displayString; |
93 return displayString; |
|
94 } |
|
95 |
|
96 @Override |
|
97 public String toString() { |
|
98 return getConfigID(); |
86 } |
99 } |
87 |
100 |
88 @Override |
101 @Override |
89 public String getDefaultDefFileDirectoryName(boolean isASSP) { |
102 public String getDefaultDefFileDirectoryName(boolean isASSP) { |
90 // TOOD: THIS IS ABLD STUFF. isASSP does not belong with Raptor |
103 // TOOD: THIS IS ABLD STUFF. isASSP does not belong with Raptor |