core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv1.java
author wpaul
Mon, 23 Aug 2010 18:14:52 -0500
branchC3_BUILDER_WORK
changeset 1871 4d38e1ac1cff
parent 1811 b1772bf1197b
permissions -rw-r--r--
fixed incorrect use of @Override. cleaned up a few warnings.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
     1
/*
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
     3
* All rights reserved.
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
     4
* This component and the accompanying materials are made available
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
     6
* which accompanies this distribution, and is available
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
     8
*
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
     9
* Initial Contributors:
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    11
*
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    12
*/
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    13
package com.nokia.carbide.cpp.internal.api.sdk;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    14
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    15
import java.io.File;
1801
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
    16
import java.io.FileReader;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
    17
import java.io.IOException;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
    18
import java.io.Reader;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
    19
import java.util.ArrayList;
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    20
import java.util.Collections;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    21
import java.util.List;
1801
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
    22
import java.util.regex.Matcher;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
    23
import java.util.regex.Pattern;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    24
1755
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
    25
import org.eclipse.cdt.core.settings.model.ICStorageElement;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    26
import org.eclipse.core.runtime.IPath;
1801
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
    27
import org.eclipse.core.runtime.Path;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    28
import org.osgi.framework.Version;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    29
1811
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
    30
import com.nokia.carbide.cpp.epoc.engine.preprocessor.DefineFactory;
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    31
import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    32
import com.nokia.carbide.cpp.internal.sdk.core.model.SBSv1BuildInfo;
1776
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1770
diff changeset
    33
import com.nokia.carbide.cpp.internal.sdk.core.model.SDKManager;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    34
import com.nokia.carbide.cpp.internal.sdk.core.model.SymbianMissingSDKFactory;
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    35
import com.nokia.carbide.cpp.internal.sdk.core.model.SymbianSDK;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    36
import com.nokia.carbide.cpp.sdk.core.IBSFCatalog;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    37
import com.nokia.carbide.cpp.sdk.core.IBSFPlatform;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    38
import com.nokia.carbide.cpp.sdk.core.IRVCTToolChainInfo;
1776
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1770
diff changeset
    39
import com.nokia.carbide.cpp.sdk.core.ISDKManager;
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    40
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    41
import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    42
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    43
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
1803
9482220f0b7b fix some merge glitches
timkelly
parents: 1802
diff changeset
    44
import com.nokia.cpp.internal.api.utils.core.PathUtils;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    45
1799
ee7381872847 mark abld-specific methods as deprecated
timkelly
parents: 1779
diff changeset
    46
/**
ee7381872847 mark abld-specific methods as deprecated
timkelly
parents: 1779
diff changeset
    47
 * @deprecated - Temporary support exists for abld on Symbian^2 but will be removed, vFuture
ee7381872847 mark abld-specific methods as deprecated
timkelly
parents: 1779
diff changeset
    48
 *
ee7381872847 mark abld-specific methods as deprecated
timkelly
parents: 1779
diff changeset
    49
 */
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    50
public class BuildContextSBSv1 implements ISBSv1BuildContext {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    51
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    52
	private String sdkId;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    53
	private String platform;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    54
	private String target;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    55
	private String displayString = null;
1479
a654857ddb87 refactor out ABLD-style platform constants into ISBSv1BuildContext from ISymbianBuildContext
timkelly
parents: 1471
diff changeset
    56
		
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    57
	private static String EMULATOR_DISPLAY_TEXT = "Emulator"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    58
	private static String PHONE_DISPLAY_TEXT = "Phone"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    59
	private static String DEBUG_DISPLAY_TEXT = "Debug"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    60
	private static String RELEASE_DISPLAY_TEXT = "Release"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    61
	private static String SPACE_DISPLAY_TEXT = " "; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    62
	private static String SDK_NOT_INSTALLED = "SDK not installed"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    63
	
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    64
	// a copy of bad SDK default to fall back
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    65
	private static ISymbianSDK fallbackForBadSdk = SymbianMissingSDKFactory.createInstance("dummy_ID"); //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    66
	
1755
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
    67
	// Preference data
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
    68
	protected BuildArgumentsInfo buildArgumentsInfo;
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
    69
	protected final static String ARGUMENTS_DATA_ID = "ARGUMENTS_DATA_ID"; //$NON-NLS-1$
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
    70
	
1801
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
    71
	// --> variant.cfg info
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
    72
	// greedy match means the filename is in the last group
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
    73
	public static Pattern VARIANT_HRH_LINE_PATTERN = Pattern.compile("(?i)(.*)(/|\\\\)(.*hrh)");
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
    74
	private IPath variantFilePath;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
    75
	public static final String VARIANT_CFG_FILE = "epoc32/tools/variant/variant.cfg"; //$NON-NLS-1$
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
    76
	public static final String SPP_VARIANT_CFG_FILE = "epoc32/tools/variant/spp_variant.cfg"; //$NON-NLS-1$
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
    77
	// <--
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
    78
	
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    79
	public BuildContextSBSv1(ISymbianSDK theSDK, String thePlatform, String theTarget) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    80
		sdkId = theSDK.getUniqueId();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    81
		platform = thePlatform.toUpperCase();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    82
		target = theTarget.toUpperCase();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    83
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    84
		getDisplayString();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    85
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    86
	
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    87
	@Override
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    88
	public int hashCode() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    89
		final int prime = 31;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    90
		int result = 1;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    91
		result = prime * result
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    92
				+ ((platform == null) ? 0 : platform.hashCode());
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    93
		result = prime * result + ((getSDK() == null) ? 0 : getSDK().getEPOCROOT().hashCode());
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    94
		result = prime * result + ((target == null) ? 0 : target.hashCode());
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    95
		return result;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    96
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    97
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    98
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    99
	@Override
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   100
	public boolean equals(Object obj) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   101
		if (this == obj)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   102
			return true;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   103
		if (obj == null)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   104
			return false;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   105
		if (!(obj instanceof BuildContextSBSv1))
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   106
			return false;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   107
		final BuildContextSBSv1 other = (BuildContextSBSv1) obj;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   108
		if (platform == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   109
			if (other.platform != null)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   110
				return false;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   111
		} else if (!platform.equals(other.platform))
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   112
			return false;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   113
		if (getSDK() == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   114
			if (other.getSDK() != null)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   115
				return false;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   116
		} else if (!getSDK().getEPOCROOT().equals(other.getSDK().getEPOCROOT()))
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   117
			return false;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   118
		if (target == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   119
			if (other.target != null)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   120
				return false;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   121
		} else if (!target.equals(other.target)) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   122
			return false;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   123
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   124
		return true;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   125
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   126
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   127
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   128
	public ISymbianSDK getSDK() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   129
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   130
		ISymbianSDK sdk = SDKCorePlugin.getSDKManager().getSDK(sdkId, true);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   131
		if (sdk == null){
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   132
			sdk = fallbackForBadSdk;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   133
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   134
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   135
		return sdk;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   136
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   137
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   138
	public String getPlatformString() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   139
		return platform.toUpperCase();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   140
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   141
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   142
	public String getTargetString() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   143
		return target.toUpperCase();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   144
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   145
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   146
	public String getDisplayString() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   147
		if (displayString == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   148
			// in the form Emulation Debug (WINSCW) [S60_3rd_MR] or
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   149
			// Phone Release (GCCE) [S60_3rd_MR]
1479
a654857ddb87 refactor out ABLD-style platform constants into ISBSv1BuildContext from ISymbianBuildContext
timkelly
parents: 1471
diff changeset
   150
			if (platform.compareTo(EMULATOR_PLATFORM) == 0) {
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   151
				displayString = EMULATOR_DISPLAY_TEXT;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   152
			} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   153
				displayString = PHONE_DISPLAY_TEXT;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   154
			}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   155
			
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   156
			if (target.compareTo(ISymbianBuildContext.DEBUG_TARGET) == 0) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   157
				displayString = displayString + SPACE_DISPLAY_TEXT + DEBUG_DISPLAY_TEXT;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   158
			} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   159
				displayString = displayString + SPACE_DISPLAY_TEXT + RELEASE_DISPLAY_TEXT;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   160
			}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   161
			
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   162
			String basePlatform = platform;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   163
			
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   164
			displayString = displayString + " (" + basePlatform + ") [" + getSDK().getUniqueId() + "]"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   165
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   166
		return displayString;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   167
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   168
	
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   169
	public static ISymbianBuildContext getBuildContextFromDisplayName(String displayName) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   170
		if (isValidConfigName(displayName)) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   171
			String sdkId = getSDKIDFromConfigName(displayName);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   172
			ISymbianSDK sdk = SDKCorePlugin.getSDKManager().getSDK(sdkId, true);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   173
			if (sdk == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   174
				// add a dummy should a build context ask for a removed SDK
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   175
				sdk = SDKManagerInternalAPI.addMissingSdk(sdkId);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   176
			}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   177
						
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   178
			return new BuildContextSBSv1(sdk, 
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   179
						getPlatformFromBuildConfigName(displayName), 
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   180
						getTargetFromBuildConfigName(displayName));
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   181
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   182
		return new BuildContextSBSv1(fallbackForBadSdk, SDK_NOT_INSTALLED, SDK_NOT_INSTALLED);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   183
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   184
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   185
	private static String getPlatformFromBuildConfigName(String configName) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   186
		String[] tokens = configName.split(SPACE_DISPLAY_TEXT);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   187
		String sdkIdToken = tokens[2];
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   188
		if (sdkIdToken.contains("_")){
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   189
			sdkIdToken = sdkIdToken.substring(1, sdkIdToken.length()-1);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   190
			String[] aliasTokens = sdkIdToken.split("_");
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   191
			return aliasTokens[0];
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   192
		} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   193
			return sdkIdToken.substring(1, sdkIdToken.length()-1);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   194
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   195
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   196
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   197
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   198
	public static String getSDKIDFromConfigName(String configName) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   199
		int indexBegin = configName.indexOf("[");  //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   200
		int indexEnd = configName.indexOf("]");  //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   201
		if (indexBegin > 0 && indexEnd > 0){
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   202
			return configName.substring(indexBegin+1, indexEnd);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   203
		} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   204
			return ""; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   205
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   206
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   207
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   208
	private static String getTargetFromBuildConfigName(String configName) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   209
		String[] tokens = configName.split(SPACE_DISPLAY_TEXT);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   210
		if (tokens[1].compareTo(DEBUG_DISPLAY_TEXT) == 0) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   211
			return ISymbianBuildContext.DEBUG_TARGET;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   212
		} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   213
			return ISymbianBuildContext.RELEASE_TARGET;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   214
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   215
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   216
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   217
	private static boolean isValidConfigName(String configName) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   218
		// <Phone | Emulator> <Target> (<Platform>) [<SDK ID>]
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   219
		if (configName != null && !configName.equals("")) { //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   220
			String[] tokens = configName.split(SPACE_DISPLAY_TEXT);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   221
			if (tokens.length >= 4) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   222
				if (tokens[0].compareTo(EMULATOR_DISPLAY_TEXT) == 0 || tokens[0].compareTo(PHONE_DISPLAY_TEXT) == 0) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   223
					if (tokens[1].compareTo(DEBUG_DISPLAY_TEXT) == 0 || tokens[1].compareTo(RELEASE_DISPLAY_TEXT) == 0) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   224
						if (tokens[2].matches("(.*)")) { //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   225
							if (tokens[3].matches("\\[.*")) { //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   226
								return true;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   227
							}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   228
						}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   229
					}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   230
				}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   231
			}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   232
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   233
		return false;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   234
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   235
	
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   236
	public String toString() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   237
		return getDisplayString();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   238
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   239
	
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   240
	private ISBSv1BuildInfo getBuildInfo() {
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   241
		ISBSv1BuildInfo buildInfo = (ISBSv1BuildInfo)getSDK().getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   242
		if (buildInfo == null) {
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   243
			buildInfo = new SBSv1BuildInfo(getSDK());
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   244
			((SymbianSDK)getSDK()).setBuildInfo(buildInfo, ISymbianBuilderID.SBSV1_BUILDER);
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   245
		}
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   246
		return buildInfo;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   247
	}
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   248
1471
62024a5fa81d Refactor out BSF/SBV support from SBSv2 Builder data. Create new package for SBSv2Query APIs (moved from builder tests).
timkelly
parents: 1462
diff changeset
   249
	public String getDefaultDefFileDirectoryName() {
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   250
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   251
		String dirName = getDefFileDirectoryNameForPlatform(platform);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   252
		if (dirName == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   253
			// check BSF's
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   254
			IBSFCatalog catalog = getBuildInfo().getBSFCatalog();
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   255
			if (catalog != null) {
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   256
	    		for (IBSFPlatform plat : catalog.getPlatforms()) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   257
	    			if (plat.getName().compareToIgnoreCase(platform) == 0) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   258
	    				String mainPlatform = catalog.getReleasePlatform(platform);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   259
	    				if (mainPlatform != null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   260
	    					dirName = getDefFileDirectoryNameForPlatform(mainPlatform);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   261
	    					if (dirName == null || dirName.length() < 1) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   262
	    						// fallback - all BSF's should be EABI anyway
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   263
			    				return "EABI"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   264
	    					}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   265
	    				}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   266
	    			}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   267
	    		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   268
	    	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   269
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   270
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   271
		if (dirName == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   272
			// fallback for unknown cases
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   273
			dirName = platform;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   274
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   275
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   276
		return dirName;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   277
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   278
	
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   279
	private String getDefFileDirectoryNameForPlatform(String platform) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   280
		if (platform.equals(EMULATOR_PLATFORM)) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   281
			return "BWINS"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   282
		} else if (platform.equals(ARMV5_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   283
					|| platform.equals(ARMV5_ABIV2_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   284
					|| platform.equals(ARMV6_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   285
					|| platform.equals(ARMV6_ABIV2_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   286
					|| platform.equals(GCCE_PLATFORM)) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   287
			return "EABI"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   288
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   289
		return null;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   290
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   291
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   292
	public IPath getCompilerPrefixFile() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   293
		if (platform.equals(GCCE_PLATFORM)) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   294
			return getGCCEPrefixFilePath();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   295
		} else if (platform.equals(ARMV5_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   296
					|| platform.equals(ARMV5_ABIV2_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   297
					|| platform.equals(ARMV6_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   298
					|| platform.equals(ARMV6_ABIV2_PLATFORM)) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   299
			return getRVCTPrefixFilePath();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   300
		} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   301
			// check BSF's
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   302
			IBSFCatalog catalog = getBuildInfo().getBSFCatalog();
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   303
	    	if (catalog != null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   304
	    		for (IBSFPlatform plat : catalog.getPlatforms()) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   305
	    			if (plat.getName().compareToIgnoreCase(platform) == 0) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   306
	    				String mainPlatform = catalog.getReleasePlatform(platform);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   307
	    				if (mainPlatform != null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   308
	    					if (mainPlatform.equals(GCCE_PLATFORM)) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   309
	    						return getGCCEPrefixFilePath();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   310
	    					} else if (mainPlatform.equals(ARMV5_PLATFORM) 
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   311
	    								|| mainPlatform.equals(ARMV5_ABIV2_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   312
	    								|| mainPlatform.equals(ARMV6_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   313
	    								|| mainPlatform.equals(ARMV6_ABIV2_PLATFORM)) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   314
	    						return getRVCTPrefixFilePath();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   315
	    					} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   316
	    						// fallback - all BSF's should be EABI anyway
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   317
	    						return getRVCTPrefixFilePath();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   318
	    					}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   319
	    				}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   320
	    			}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   321
	    		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   322
	    	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   323
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   324
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   325
		// fallback for WINSCW, MSVC, etc.
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   326
		return null;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   327
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   328
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   329
	private IPath getIncludePath() {
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   330
		return getSDK().getIncludePath();
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   331
	}
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   332
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   333
	private IPath getGCCEPrefixFilePath() {
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   334
		return getIncludePath().append("gcce/gcce.h"); //$NON-NLS-1$
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   335
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   336
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   337
	private IPath getRVCTPrefixFilePath() {
1776
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1770
diff changeset
   338
		ISDKManager sdkManager = SDKCorePlugin.getSDKManager();
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1770
diff changeset
   339
		IRVCTToolChainInfo[] installedRVCTTools = ((SDKManager)sdkManager).getInstalledRVCTTools();
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   340
		// use default in case tools aren't installed
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   341
		String rvctFragment = "rvct2_2"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   342
		if (installedRVCTTools.length > 0) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   343
			rvctFragment = getRVCTFragment(installedRVCTTools[0]);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   344
		}
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   345
		IPath prefixFilePath = getIncludePath().append(rvctFragment).append(rvctFragment + ".h"); //$NON-NLS-1$
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   346
		if (prefixFilePath.toFile().exists()){
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   347
			return prefixFilePath;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   348
		} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   349
			// SF kits around SF^3 started to only use a single rvct.h header instead of specific versioned ones
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   350
			// based on the default installation
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   351
			return getIncludePath().append("rvct").append("rvct" + ".h");
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   352
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   353
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   354
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   355
	private String getRVCTFragment(IRVCTToolChainInfo info) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   356
		int major = 0, minor = 0;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   357
		if (info != null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   358
			Version rvctToolsVersion = info.getRvctToolsVersion();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   359
			if (rvctToolsVersion != null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   360
				major = info.getRvctToolsVersion().getMajor();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   361
				minor = info.getRvctToolsVersion().getMinor();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   362
			}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   363
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   364
		return "rvct" + major + "_" + minor; //$NON-NLS-1$ //$NON-NLS-2$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   365
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   366
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   367
	public List<IDefine> getVariantHRHDefines() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   368
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   369
		return getCachedData().getVariantHRHDefines();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   370
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   371
1801
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   372
	public List<File> getVariantHRHIncludes() {
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   373
		return getCachedData().getPrefixFileIncludes();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   374
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   375
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   376
1801
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   377
	public List<IDefine> getCompilerPreincludeDefines() {
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   378
		// we parse the compiler prefix file to gather macros.  this can be time consuming so do it
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   379
		// once and cache the values.  only reset the cache when the compiler prefix has changed.
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   380
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   381
		IPath prefixFile = getCompilerPrefixFile();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   382
		if (prefixFile == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   383
			return Collections.emptyList();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   384
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   385
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   386
		return getCachedData().getCompilerMacros(prefixFile);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   387
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   388
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   389
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   390
	public String getBuildVariationName() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   391
		String varName = "";
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   392
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   393
		String[] tokens = getPlatformString().split("\\.");
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   394
		if (tokens.length == 2){
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   395
			varName = tokens[1];
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   396
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   397
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   398
		return varName;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   399
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   400
1801
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   401
//	public boolean isSymbianBinaryVariation() {
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   402
//		if (getPlatformString().split("\\.").length == 2){
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   403
//			return true;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   404
//		} else {
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   405
//			return false;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   406
//		}
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   407
//	}
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   408
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   409
	/**
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   410
	 * Get the cache holding the data that applies to this build context globally.
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   411
	 * A build context is subclassed by CarbideBuildConfiguration, which has multiple
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   412
	 * instances at runtime, thus, a SymbianBuildContext instance should not hold a cache itself.
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   413
	 * @return cache, never <code>null</code>
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   414
	 */
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   415
	private SymbianBuildContextDataCache getCachedData() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   416
		return SymbianBuildContextDataCache.getCache(this);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   417
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   418
	
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   419
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   420
	public String getBasePlatformForVariation() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   421
		String plat = "";
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   422
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   423
		String[] tokens = getPlatformString().split("\\.");
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   424
		if (tokens.length == 2){
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   425
			plat = tokens[0];
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   426
		} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   427
			return platform;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   428
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   429
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   430
		return plat;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   431
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   432
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   433
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   434
	/**
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   435
	 * Get the list of #include paths detected for this context.
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   436
	 * @return List or <code>null</code>
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   437
	 */
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   438
	public List<File> getCachedSystemIncludePaths() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   439
		return getCachedData().getSystemIncludePaths();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   440
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   441
1755
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   442
	public void loadConfigurationSettings(ICStorageElement se) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   443
		if (se.getName().equals(ARGUMENTS_DATA_ID)) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   444
			loadBuildArgsFromStorage(se);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   445
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   446
	}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   447
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   448
	public IBuildArgumentsInfo getBuildArgumentsInfo() {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   449
		return (IBuildArgumentsInfo)buildArgumentsInfo;
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   450
	}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   451
	
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   452
	public BuildArgumentsInfo getBuildArgumentsInfoCopy() {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   453
		return new BuildArgumentsInfo(buildArgumentsInfo);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   454
	}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   455
	
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   456
	public void setBuildArgumentsInfo(BuildArgumentsInfo buildArgumentsInfo) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   457
		this.buildArgumentsInfo = buildArgumentsInfo;
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   458
	}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   459
	
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   460
	private void loadBuildArgsFromStorage(ICStorageElement rootStorage) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   461
		buildArgumentsInfo = new BuildArgumentsInfo(getSDK());
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   462
		String value = rootStorage.getAttribute(BuildArgumentsInfo.BLDMAKEBLDFILESARGSSTORAGE);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   463
		if (value != null) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   464
			buildArgumentsInfo.bldmakeBldFilesArgs = value;
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   465
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   466
		
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   467
		value = rootStorage.getAttribute(BuildArgumentsInfo.BLDMAKECLEANARGSSTORAGE);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   468
		if (value != null) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   469
			buildArgumentsInfo.bldmakeCleanArgs = value;
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   470
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   471
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   472
		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDBUILDARGSSTORAGE);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   473
		if (value != null) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   474
			buildArgumentsInfo.abldBuildArgs = value;
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   475
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   476
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   477
		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDEXPORTARGSSTORAGE);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   478
		if (value != null) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   479
			buildArgumentsInfo.abldExportArgs = value;
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   480
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   481
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   482
		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDMAKEFILEARGSSTORAGE);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   483
		if (value != null) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   484
			buildArgumentsInfo.abldMakefileArgs = value;
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   485
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   486
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   487
		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDLIBRARYARGSSTORAGE);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   488
		if (value != null) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   489
			buildArgumentsInfo.abldLibraryArgs = value;
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   490
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   491
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   492
		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDRESOURCEARGSSTORAGE);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   493
		if (value != null) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   494
			buildArgumentsInfo.abldResourceArgs = value;
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   495
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   496
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   497
		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDTARGETARGSSTORAGE);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   498
		if (value != null) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   499
			buildArgumentsInfo.abldTargetArgs = value;
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   500
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   501
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   502
		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDFINALARGSSTORAGE);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   503
		if (value != null) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   504
			buildArgumentsInfo.abldFinalArgs = value;
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   505
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   506
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   507
		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDCLEANARGSSTORAGE);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   508
		if (value != null) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   509
			buildArgumentsInfo.abldCleanArgs = value;
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   510
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   511
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   512
		value = rootStorage.getAttribute(BuildArgumentsInfo.ABLDFREEZEARGSSTORAGE);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   513
		if (value != null) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   514
			buildArgumentsInfo.abldFreezeArgs = value;
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   515
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   516
	}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   517
	
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   518
	public void saveBuildArgsToStorage(ICStorageElement rootStorage) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   519
		if (buildArgumentsInfo == null){
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   520
			buildArgumentsInfo = new BuildArgumentsInfo(getSDK());
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   521
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   522
		
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   523
		if (buildArgumentsInfo.bldmakeBldFilesArgs.trim().length() > 0) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   524
			rootStorage.setAttribute(BuildArgumentsInfo.BLDMAKEBLDFILESARGSSTORAGE, buildArgumentsInfo.bldmakeBldFilesArgs);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   525
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   526
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   527
		if (buildArgumentsInfo.bldmakeCleanArgs.trim().length() > 0) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   528
			rootStorage.setAttribute(BuildArgumentsInfo.BLDMAKECLEANARGSSTORAGE, buildArgumentsInfo.bldmakeCleanArgs);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   529
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   530
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   531
		if (buildArgumentsInfo.abldBuildArgs.trim().length() > 0) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   532
			rootStorage.setAttribute(BuildArgumentsInfo.ABLDBUILDARGSSTORAGE, buildArgumentsInfo.abldBuildArgs);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   533
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   534
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   535
		if (buildArgumentsInfo.abldExportArgs.trim().length() > 0) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   536
			rootStorage.setAttribute(BuildArgumentsInfo.ABLDEXPORTARGSSTORAGE, buildArgumentsInfo.abldExportArgs);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   537
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   538
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   539
		if (buildArgumentsInfo.abldMakefileArgs.trim().length() > 0) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   540
			rootStorage.setAttribute(BuildArgumentsInfo.ABLDMAKEFILEARGSSTORAGE, buildArgumentsInfo.abldMakefileArgs);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   541
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   542
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   543
		if (buildArgumentsInfo.abldLibraryArgs.trim().length() > 0) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   544
			rootStorage.setAttribute(BuildArgumentsInfo.ABLDLIBRARYARGSSTORAGE, buildArgumentsInfo.abldLibraryArgs);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   545
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   546
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   547
		if (buildArgumentsInfo.abldResourceArgs.trim().length() > 0) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   548
			rootStorage.setAttribute(BuildArgumentsInfo.ABLDRESOURCEARGSSTORAGE, buildArgumentsInfo.abldResourceArgs);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   549
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   550
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   551
		if (buildArgumentsInfo.abldTargetArgs.trim().length() > 0) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   552
			rootStorage.setAttribute(BuildArgumentsInfo.ABLDTARGETARGSSTORAGE, buildArgumentsInfo.abldTargetArgs);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   553
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   554
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   555
		if (buildArgumentsInfo.abldFinalArgs.trim().length() > 0) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   556
			rootStorage.setAttribute(BuildArgumentsInfo.ABLDFINALARGSSTORAGE, buildArgumentsInfo.abldFinalArgs);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   557
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   558
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   559
		if (buildArgumentsInfo.abldCleanArgs.trim().length() > 0) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   560
			rootStorage.setAttribute(BuildArgumentsInfo.ABLDCLEANARGSSTORAGE, buildArgumentsInfo.abldCleanArgs);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   561
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   562
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   563
		if (buildArgumentsInfo.abldFreezeArgs.trim().length() > 0) {
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   564
			rootStorage.setAttribute(BuildArgumentsInfo.ABLDFREEZEARGSSTORAGE, buildArgumentsInfo.abldFreezeArgs);
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   565
		}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   566
	}
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   567
1764
df8e072f8f71 refactoring sbsv2 configuration specific data under ISBSv2BuildContext interfaces (fixes some glitches with prior attempt)
timkelly
parents: 1755
diff changeset
   568
	public void saveConfigurationSettings(ICStorageElement se, ISymbianBuildContext context) {
1755
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   569
		saveBuildArgsToStorage(se.createChild(ARGUMENTS_DATA_ID)); 
e65ffeef96f7 refactor abld arguments tab settings under ISBSV1BuildContext API. WIP to push builder specific settings under their respective ISymbianBuildContext implementation.
timkelly
parents: 1739
diff changeset
   570
	}
1770
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   571
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   572
	/**
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   573
	 * Get the unique ID for this build configuration.
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   574
	 * For ABLD it is the display name, for SBSv2, it is the builder ID
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   575
	 * @return
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   576
	 */
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   577
	public String getConfigurationID() {
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   578
		return getDisplayString();
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   579
	}
1801
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   580
	
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   581
	/**
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   582
	 * Get the full path to the prefix file defined under \epoc32\tools\variant\variant.cfg
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   583
	 * @return A path object, or null if the variant.cfg does not exist. This routine does not check to see if the returned path exists.
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   584
	 */
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   585
	public IPath getPrefixFromVariantCfg(){
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   586
		
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   587
		if (variantFilePath != null){
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   588
			return variantFilePath;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   589
		}
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   590
		
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   591
		File epocRoot = new File(getSDK().getEPOCROOT());
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   592
		File variantCfg;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   593
		variantCfg = new File(epocRoot, SPP_VARIANT_CFG_FILE);
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   594
		if (!variantCfg.exists()) {
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   595
			variantCfg = new File(epocRoot, VARIANT_CFG_FILE);
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   596
			if (!variantCfg.exists())
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   597
				return null;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   598
		}
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   599
		
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   600
		String variantDir = null;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   601
		String variantFile = null;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   602
		try {
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   603
			char[] cbuf = new char[(int) variantCfg.length()];
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   604
			Reader reader = new FileReader(variantCfg);
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   605
			reader.read(cbuf);
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   606
			reader.close();
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   607
			String[] lines = new String(cbuf).split("\r\n|\r|\n");
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   608
			for (int i = 0; i < lines.length; i++) {
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   609
				// skip comments and blank lines
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   610
				String line = SymbianSDK.removeComments(lines[i]);
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   611
				if (line.matches("\\s*#.*") || line.trim().length() == 0) 
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   612
					continue;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   613
				
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   614
				// parse the variant line, which is an EPOCROOT-relative
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   615
				// path to a bldvariant.hrh file
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   616
				Matcher matcher = VARIANT_HRH_LINE_PATTERN.matcher(line);
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   617
				if (matcher.matches()) {
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   618
					variantDir = matcher.group(1);
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   619
					variantFile = matcher.group(3); 
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   620
					File variantFullPathFile = new File(epocRoot, variantDir + File.separator + variantFile);
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   621
					variantFilePath = new Path(PathUtils.convertPathToUnix(variantFullPathFile.getAbsolutePath()));
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   622
					return variantFilePath;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   623
				}
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   624
			}
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   625
		} catch (IOException e) {
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   626
		}
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   627
		
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   628
		return null; // can't find the file...
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   629
	}
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   630
	
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   631
	@SuppressWarnings("unchecked")
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   632
	public List<String> getVariantCFGMacros(){
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   633
		
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   634
		List<String> variantCFGMacros = new ArrayList<String>();
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   635
		File epocRoot = new File(getSDK().getEPOCROOT());
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   636
		File variantCfg;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   637
		variantCfg = new File(epocRoot, SPP_VARIANT_CFG_FILE);
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   638
		if (!variantCfg.exists()) {
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   639
			variantCfg = new File(epocRoot, VARIANT_CFG_FILE);
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   640
			if (!variantCfg.exists())
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   641
				return Collections.EMPTY_LIST;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   642
		}
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   643
		
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   644
		try {
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   645
			char[] cbuf = new char[(int) variantCfg.length()];
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   646
			Reader reader = new FileReader(variantCfg);
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   647
			reader.read(cbuf);
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   648
			reader.close();
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   649
			String[] lines = new String(cbuf).split("\r\n|\r|\n");
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   650
			for (int i = 0; i < lines.length; i++) {
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   651
				// skip comments and blank lines
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   652
				String line = SymbianSDK.removeComments(lines[i]);
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   653
				if (line.matches("\\s*#.*") || line.trim().length() == 0) 
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   654
					continue;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   655
				
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   656
				// parse the variant line, which is an EPOCROOT-relative
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   657
				// path to a bldvariant.hrh file
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   658
				Matcher matcher = VARIANT_HRH_LINE_PATTERN.matcher(line);
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   659
				if (matcher.matches()) {
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   660
					continue; // Skip this it's the file
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   661
				} else {
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   662
					// all other patterns are assumed to be macro
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   663
					variantCFGMacros.add(line.trim());
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   664
				}
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   665
			}
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   666
		} catch (IOException e) {
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   667
		}
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   668
		
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   669
		return variantCFGMacros;
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   670
	}
1804
c13983cc5630 added stubs for two wrapper utils to get build (cpp) macros and metadata macros -- WIP
timkelly
parents: 1803
diff changeset
   671
c13983cc5630 added stubs for two wrapper utils to get build (cpp) macros and metadata macros -- WIP
timkelly
parents: 1803
diff changeset
   672
	public List<IDefine> getBuildMacros() {
1811
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   673
		ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)getSDK().getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   674
		List<IDefine> defines = new ArrayList<IDefine>();
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   675
		for (String builtinMacro : sbsv1BuildInfo.getVendorSDKMacros()) {
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   676
			defines.add(DefineFactory.createDefine(builtinMacro));
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   677
		}
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   678
		
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   679
		for (String builtinMacro : sbsv1BuildInfo.getBuiltinMacros(this)) {
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   680
			defines.add(DefineFactory.createDefine(builtinMacro));
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   681
		}
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   682
		
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   683
		for (String variantCFGMacro : getVariantCFGMacros()) {
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   684
			defines.add(DefineFactory.createDefine(variantCFGMacro));
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   685
		}
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   686
		
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   687
		for (String platMacro : sbsv1BuildInfo.getPlatformMacros(getPlatformString())) {
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   688
			defines.add(DefineFactory.createDefine("__" + platMacro + "__")); //$NON-NLS-1$ //$NON-NLS-2$
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   689
		}
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   690
		
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   691
		return defines;
1804
c13983cc5630 added stubs for two wrapper utils to get build (cpp) macros and metadata macros -- WIP
timkelly
parents: 1803
diff changeset
   692
	}
c13983cc5630 added stubs for two wrapper utils to get build (cpp) macros and metadata macros -- WIP
timkelly
parents: 1803
diff changeset
   693
c13983cc5630 added stubs for two wrapper utils to get build (cpp) macros and metadata macros -- WIP
timkelly
parents: 1803
diff changeset
   694
	public List<IDefine> getMetadataMacros() {
1811
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   695
		ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)getSDK().getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   696
		List<IDefine> defines = new ArrayList<IDefine>();
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   697
		for (String platMacro : sbsv1BuildInfo.getPlatformMacros(getPlatformString())) {
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   698
			defines.add(DefineFactory.createDefine(platMacro)); //$NON-NLS-1$ //$NON-NLS-2$
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   699
		}
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   700
		
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   701
		return defines;
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   702
	}
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   703
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   704
	public IDefine getTargetTypeMacro(String targettype) {
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   705
		ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)getSDK().getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
b1772bf1197b major refactor to wrap retieval of macros all around ISymbianBuildContext, to avoid need to access internal apis. Added getTargetTypeMacro(String targettype),
timkelly
parents: 1804
diff changeset
   706
		return DefineFactory.createDefine(sbsv1BuildInfo.getTargetTypeMacro(targettype));
1804
c13983cc5630 added stubs for two wrapper utils to get build (cpp) macros and metadata macros -- WIP
timkelly
parents: 1803
diff changeset
   707
	}
1801
1d73a4591cf8 refactoring usage for getting variant.hrh and compiler preinclude macros. Now should use ISymbianContext both for preprocessed results and getting the IPath to the file.
timkelly
parents: 1779
diff changeset
   708
	
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   709
}