core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv2.java
branchC3_BUILDER_WORK
changeset 1418 8ca7cf978139
child 1419 ab555eecf681
equal deleted inserted replaced
1417:8e6d57a444fc 1418:8ca7cf978139
       
     1 package com.nokia.carbide.cpp.internal.api.sdk;
       
     2 
       
     3 import java.io.File;
       
     4 import java.util.List;
       
     5 
       
     6 import org.eclipse.core.runtime.IPath;
       
     7 
       
     8 import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine;
       
     9 import com.nokia.carbide.cpp.sdk.core.ISBSv2BuildContext;
       
    10 import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
       
    11 
       
    12 public class BuildContextSBSv2 implements ISBSv2BuildContext {
       
    13 	
       
    14 	private String platform;
       
    15 	private String target;
       
    16 	private String sbsv2Alias;
       
    17 	ISymbianSDK sdk;
       
    18 	
       
    19 	public BuildContextSBSv2(ISymbianSDK theSDK, String thePlatform, String theTarget, String theSBSv2Alias) {
       
    20 		sdk = theSDK;
       
    21 		platform = thePlatform.toUpperCase();
       
    22 		target = theTarget.toUpperCase();
       
    23 		sbsv2Alias = theSBSv2Alias;
       
    24 		
       
    25 		getDisplayString();
       
    26 	}
       
    27 
       
    28 	@Override
       
    29 	public ISymbianSDK getSDK() {
       
    30 		return sdk;
       
    31 	}
       
    32 
       
    33 	@Override
       
    34 	public String getPlatformString() {
       
    35 		return platform;
       
    36 	}
       
    37 
       
    38 	@Override
       
    39 	public String getTargetString() {
       
    40 		return target;
       
    41 	}
       
    42 
       
    43 	@Override
       
    44 	public String getDisplayString() {
       
    45 		// TODO Auto-generated method stub
       
    46 		return sbsv2Alias;
       
    47 	}
       
    48 
       
    49 	@Override
       
    50 	public String getDefaultDefFileDirectoryName(boolean isASSP) {
       
    51 		// TODO Auto-generated method stub
       
    52 		return null;
       
    53 	}
       
    54 
       
    55 	@Override
       
    56 	public IPath getCompilerPrefixFile() {
       
    57 		// TODO Auto-generated method stub
       
    58 		return null;
       
    59 	}
       
    60 
       
    61 	@Override
       
    62 	public List<IDefine> getVariantHRHDefines() {
       
    63 		// TODO Auto-generated method stub
       
    64 		return null;
       
    65 	}
       
    66 
       
    67 	@Override
       
    68 	public List<File> getPrefixFileIncludes() {
       
    69 		// TODO Auto-generated method stub
       
    70 		return null;
       
    71 	}
       
    72 
       
    73 	@Override
       
    74 	public List<IDefine> getCompilerMacros() {
       
    75 		// TODO Auto-generated method stub
       
    76 		return null;
       
    77 	}
       
    78 
       
    79 	@Override
       
    80 	public String getBuildVariationName() {
       
    81 		// TODO Auto-generated method stub
       
    82 		return null;
       
    83 	}
       
    84 
       
    85 	@Override
       
    86 	public boolean isSymbianBinaryVariation() {
       
    87 		// TODO Auto-generated method stub
       
    88 		return false;
       
    89 	}
       
    90 	
       
    91 	/**
       
    92 	 * See if the build configuration is an SBSv2 alias, and if so get the build-able alias name 
       
    93 	 * @param displayName
       
    94 	 * @return The full SBSv2 alias that can be used with -c, otherwise null if not SBSv2
       
    95 	 */
       
    96 	private static String getSBSv2AliasFromConfigName(String displayName) {
       
    97 		int indexBegin = displayName.indexOf("(");  //$NON-NLS-1$
       
    98 		int indexEnd = displayName.indexOf(")");  //$NON-NLS-1$
       
    99 		if (indexBegin > 0 && indexEnd > 0){
       
   100 			String configPart =  displayName.substring(indexBegin+1, indexEnd);
       
   101 			if (configPart.split("_").length > 1){
       
   102 				return configPart;
       
   103 			}
       
   104 		} 
       
   105 		
       
   106 		return null;
       
   107 	}
       
   108 
       
   109 	@Override
       
   110 	public String getSBSv2Alias() {
       
   111 		return sbsv2Alias;
       
   112 	}
       
   113 
       
   114 	
       
   115 
       
   116 }