core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContext.java
changeset 140 697b7727d088
parent 139 e743b7cf572c
child 147 2bb08686aa38
equal deleted inserted replaced
139:e743b7cf572c 140:697b7727d088
    39 
    39 
    40 	private String sdkId;
    40 	private String sdkId;
    41 	private String platform;
    41 	private String platform;
    42 	private String target;
    42 	private String target;
    43 	private String displayString = null;
    43 	private String displayString = null;
    44 	private String symbianBuildVariationString;
       
    45 	
    44 	
    46 	private static String EMULATOR_DISPLAY_TEXT = "Emulator"; //$NON-NLS-1$
    45 	private static String EMULATOR_DISPLAY_TEXT = "Emulator"; //$NON-NLS-1$
    47 	private static String PHONE_DISPLAY_TEXT = "Phone"; //$NON-NLS-1$
    46 	private static String PHONE_DISPLAY_TEXT = "Phone"; //$NON-NLS-1$
    48 	private static String DEBUG_DISPLAY_TEXT = "Debug"; //$NON-NLS-1$
    47 	private static String DEBUG_DISPLAY_TEXT = "Debug"; //$NON-NLS-1$
    49 	private static String RELEASE_DISPLAY_TEXT = "Release"; //$NON-NLS-1$
    48 	private static String RELEASE_DISPLAY_TEXT = "Release"; //$NON-NLS-1$
    61 	private long compilerCacheTimestamp;
    60 	private long compilerCacheTimestamp;
    62 	
    61 	
    63 	
    62 	
    64 	public SymbianBuildContext(ISymbianSDK theSDK, String thePlatform, String theTarget) {
    63 	public SymbianBuildContext(ISymbianSDK theSDK, String thePlatform, String theTarget) {
    65 		sdkId = theSDK.getUniqueId();
    64 		sdkId = theSDK.getUniqueId();
    66 		String[] platformString = thePlatform.split("\\.");
    65 		platform = thePlatform;
    67 		if (platformString != null && platformString.length == 2){
       
    68 			platform = platformString[0];
       
    69 			symbianBuildVariationString = platformString[1];
       
    70 		} else {
       
    71 			platform = thePlatform;
       
    72 			symbianBuildVariationString = "";
       
    73 		}
       
    74 		
       
    75 		target = theTarget;
    66 		target = theTarget;
    76 		getDisplayString();
    67 		getDisplayString();
    77 	}
    68 	}
    78 	
    69 
    79 	public SymbianBuildContext(ISymbianSDK theSDK, String thePlatform, String theTarget, String theBinaryVariationName) {
       
    80 		sdkId = theSDK.getUniqueId();
       
    81 		platform = thePlatform;
       
    82 		target = theTarget;
       
    83 		symbianBuildVariationString = theBinaryVariationName;
       
    84 		getDisplayString();
       
    85 	}
       
    86 	
    70 	
    87 	@Override
    71 	@Override
    88 	public int hashCode() {
    72 	public int hashCode() {
    89 		final int prime = 31;
    73 		final int prime = 31;
    90 		int result = 1;
    74 		int result = 1;
   155 			if (target.compareTo(ISymbianBuildContext.DEBUG_TARGET) == 0) {
   139 			if (target.compareTo(ISymbianBuildContext.DEBUG_TARGET) == 0) {
   156 				displayString = displayString + SPACE_DISPLAY_TEXT + DEBUG_DISPLAY_TEXT;
   140 				displayString = displayString + SPACE_DISPLAY_TEXT + DEBUG_DISPLAY_TEXT;
   157 			} else {
   141 			} else {
   158 				displayString = displayString + SPACE_DISPLAY_TEXT + RELEASE_DISPLAY_TEXT;
   142 				displayString = displayString + SPACE_DISPLAY_TEXT + RELEASE_DISPLAY_TEXT;
   159 			}
   143 			}
   160 			
   144 
   161 			String platDisplay = platform;
   145 			displayString = displayString + " (" + platform + ") [" + getSDK().getUniqueId() + "]"; //$NON-NLS-1$
   162 			if (symbianBuildVariationString.length() > 0){
       
   163 				platDisplay = platform + "." + symbianBuildVariationString;
       
   164 			}
       
   165 			
       
   166 			displayString = displayString + " (" + platDisplay + ") [" + getSDK().getUniqueId() + "]"; //$NON-NLS-1$
       
   167 		}
   146 		}
   168 		return displayString;
   147 		return displayString;
   169 	}
   148 	}
   170 	
   149 	
   171 	public static ISymbianBuildContext getBuildContextFromDisplayName(String displayName) {
   150 	public static ISymbianBuildContext getBuildContextFromDisplayName(String displayName) {
   527 		return compilerPrefixMacros;
   506 		return compilerPrefixMacros;
   528 	}
   507 	}
   529 
   508 
   530 
   509 
   531 	public String getBuildVariationName() {
   510 	public String getBuildVariationName() {
   532 		return symbianBuildVariationString;
   511 		String varName = "";
       
   512 		
       
   513 		String[] tokens = getPlatformString().split("\\.");
       
   514 		if (tokens.length == 2){
       
   515 			varName = tokens[1];
       
   516 		}
       
   517 		
       
   518 		return varName;
   533 	}
   519 	}
   534 }
   520 }