core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/BuildContextSBSv1.java
author timkelly
Tue, 10 Aug 2010 19:07:16 -0500
branchC3_BUILDER_WORK
changeset 1801 1d73a4591cf8
parent 1779 73303c546665
child 1802 7e50573a0115
permissions -rw-r--r--
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. Removed start-up checks for Perl version.
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
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    30
import com.nokia.carbide.cpp.epoc.engine.preprocessor.IDefine;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    31
import com.nokia.carbide.cpp.internal.sdk.core.model.SBSv1BuildInfo;
1776
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1770
diff changeset
    32
import com.nokia.carbide.cpp.internal.sdk.core.model.SDKManager;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    33
import com.nokia.carbide.cpp.internal.sdk.core.model.SymbianMissingSDKFactory;
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    34
import com.nokia.carbide.cpp.internal.sdk.core.model.SymbianSDK;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    35
import com.nokia.carbide.cpp.sdk.core.IBSFCatalog;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    36
import com.nokia.carbide.cpp.sdk.core.IBSFPlatform;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    37
import com.nokia.carbide.cpp.sdk.core.IRVCTToolChainInfo;
1776
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1770
diff changeset
    38
import com.nokia.carbide.cpp.sdk.core.ISDKManager;
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    39
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    40
import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    41
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    42
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
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
    43
import com.nokia.cpp.internal.api.utils.core.PathUtils;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    44
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    45
public class BuildContextSBSv1 implements ISBSv1BuildContext {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    46
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    47
	private String sdkId;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    48
	private String platform;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    49
	private String target;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    50
	private String displayString = null;
1479
a654857ddb87 refactor out ABLD-style platform constants into ISBSv1BuildContext from ISymbianBuildContext
timkelly
parents: 1471
diff changeset
    51
		
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    52
	private static String EMULATOR_DISPLAY_TEXT = "Emulator"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    53
	private static String PHONE_DISPLAY_TEXT = "Phone"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    54
	private static String DEBUG_DISPLAY_TEXT = "Debug"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    55
	private static String RELEASE_DISPLAY_TEXT = "Release"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    56
	private static String SPACE_DISPLAY_TEXT = " "; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    57
	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
    58
	
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    59
	// a copy of bad SDK default to fall back
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    60
	private static ISymbianSDK fallbackForBadSdk = SymbianMissingSDKFactory.createInstance("dummy_ID"); //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    61
	
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
    62
	// 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
    63
	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
    64
	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
    65
	
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
    66
	// --> 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
    67
	// 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
    68
	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
    69
	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
    70
	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
    71
	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
    72
	// <--
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
	
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    74
	public BuildContextSBSv1(ISymbianSDK theSDK, String thePlatform, String theTarget) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    75
		sdkId = theSDK.getUniqueId();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    76
		platform = thePlatform.toUpperCase();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    77
		target = theTarget.toUpperCase();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    78
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    79
		getDisplayString();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    80
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    81
	
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    82
	@Override
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    83
	public int hashCode() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    84
		final int prime = 31;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    85
		int result = 1;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    86
		result = prime * result
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    87
				+ ((platform == null) ? 0 : platform.hashCode());
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    88
		result = prime * result + ((getSDK() == null) ? 0 : getSDK().getEPOCROOT().hashCode());
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    89
		result = prime * result + ((target == null) ? 0 : target.hashCode());
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    90
		return result;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    91
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    92
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    93
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    94
	@Override
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    95
	public boolean equals(Object obj) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    96
		if (this == obj)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    97
			return true;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    98
		if (obj == null)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
    99
			return false;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   100
		if (!(obj instanceof BuildContextSBSv1))
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   101
			return false;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   102
		final BuildContextSBSv1 other = (BuildContextSBSv1) obj;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   103
		if (platform == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   104
			if (other.platform != null)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   105
				return false;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   106
		} else if (!platform.equals(other.platform))
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   107
			return false;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   108
		if (getSDK() == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   109
			if (other.getSDK() != 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 (!getSDK().getEPOCROOT().equals(other.getSDK().getEPOCROOT()))
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 (target == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   114
			if (other.target != 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 (!target.equals(other.target)) {
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
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   119
		return true;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   120
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   121
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   122
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   123
	public ISymbianSDK getSDK() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   124
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   125
		ISymbianSDK sdk = SDKCorePlugin.getSDKManager().getSDK(sdkId, true);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   126
		if (sdk == null){
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   127
			sdk = fallbackForBadSdk;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   128
		}
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
		return sdk;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   131
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   132
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   133
	public String getPlatformString() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   134
		return platform.toUpperCase();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   135
	}
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
	public String getTargetString() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   138
		return target.toUpperCase();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   139
	}
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
	public String getDisplayString() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   142
		if (displayString == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   143
			// in the form Emulation Debug (WINSCW) [S60_3rd_MR] or
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   144
			// Phone Release (GCCE) [S60_3rd_MR]
1479
a654857ddb87 refactor out ABLD-style platform constants into ISBSv1BuildContext from ISymbianBuildContext
timkelly
parents: 1471
diff changeset
   145
			if (platform.compareTo(EMULATOR_PLATFORM) == 0) {
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   146
				displayString = EMULATOR_DISPLAY_TEXT;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   147
			} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   148
				displayString = PHONE_DISPLAY_TEXT;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   149
			}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   150
			
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   151
			if (target.compareTo(ISymbianBuildContext.DEBUG_TARGET) == 0) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   152
				displayString = displayString + SPACE_DISPLAY_TEXT + DEBUG_DISPLAY_TEXT;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   153
			} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   154
				displayString = displayString + SPACE_DISPLAY_TEXT + RELEASE_DISPLAY_TEXT;
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
			
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   157
			String basePlatform = platform;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   158
			
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   159
			displayString = displayString + " (" + basePlatform + ") [" + getSDK().getUniqueId() + "]"; //$NON-NLS-1$
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
		return displayString;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   162
	}
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
	public static ISymbianBuildContext getBuildContextFromDisplayName(String displayName) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   165
		if (isValidConfigName(displayName)) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   166
			String sdkId = getSDKIDFromConfigName(displayName);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   167
			ISymbianSDK sdk = SDKCorePlugin.getSDKManager().getSDK(sdkId, true);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   168
			if (sdk == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   169
				// 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
   170
				sdk = SDKManagerInternalAPI.addMissingSdk(sdkId);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   171
			}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   172
						
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   173
			return new BuildContextSBSv1(sdk, 
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   174
						getPlatformFromBuildConfigName(displayName), 
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   175
						getTargetFromBuildConfigName(displayName));
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
		return new BuildContextSBSv1(fallbackForBadSdk, SDK_NOT_INSTALLED, SDK_NOT_INSTALLED);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   178
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   179
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   180
	private static String getPlatformFromBuildConfigName(String configName) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   181
		String[] tokens = configName.split(SPACE_DISPLAY_TEXT);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   182
		String sdkIdToken = tokens[2];
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   183
		if (sdkIdToken.contains("_")){
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   184
			sdkIdToken = sdkIdToken.substring(1, sdkIdToken.length()-1);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   185
			String[] aliasTokens = sdkIdToken.split("_");
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   186
			return aliasTokens[0];
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   187
		} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   188
			return sdkIdToken.substring(1, sdkIdToken.length()-1);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   189
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   190
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   191
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   192
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   193
	public static String getSDKIDFromConfigName(String configName) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   194
		int indexBegin = configName.indexOf("[");  //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   195
		int indexEnd = configName.indexOf("]");  //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   196
		if (indexBegin > 0 && indexEnd > 0){
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   197
			return configName.substring(indexBegin+1, indexEnd);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   198
		} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   199
			return ""; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   200
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   201
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   202
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   203
	private static String getTargetFromBuildConfigName(String configName) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   204
		String[] tokens = configName.split(SPACE_DISPLAY_TEXT);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   205
		if (tokens[1].compareTo(DEBUG_DISPLAY_TEXT) == 0) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   206
			return ISymbianBuildContext.DEBUG_TARGET;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   207
		} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   208
			return ISymbianBuildContext.RELEASE_TARGET;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   209
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   210
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   211
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   212
	private static boolean isValidConfigName(String configName) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   213
		// <Phone | Emulator> <Target> (<Platform>) [<SDK ID>]
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   214
		if (configName != null && !configName.equals("")) { //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   215
			String[] tokens = configName.split(SPACE_DISPLAY_TEXT);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   216
			if (tokens.length >= 4) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   217
				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
   218
					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
   219
						if (tokens[2].matches("(.*)")) { //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   220
							if (tokens[3].matches("\\[.*")) { //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   221
								return true;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   222
							}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   223
						}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   224
					}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   225
				}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   226
			}
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
		return false;
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
	public String toString() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   232
		return getDisplayString();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   233
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   234
	
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   235
	private ISBSv1BuildInfo getBuildInfo() {
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   236
		ISBSv1BuildInfo buildInfo = (ISBSv1BuildInfo)getSDK().getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   237
		if (buildInfo == null) {
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   238
			buildInfo = new SBSv1BuildInfo(getSDK());
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   239
			((SymbianSDK)getSDK()).setBuildInfo(buildInfo, ISymbianBuilderID.SBSV1_BUILDER);
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   240
		}
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   241
		return buildInfo;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   242
	}
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   243
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
   244
	public String getDefaultDefFileDirectoryName() {
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   245
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   246
		String dirName = getDefFileDirectoryNameForPlatform(platform);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   247
		if (dirName == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   248
			// check BSF's
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   249
			IBSFCatalog catalog = getBuildInfo().getBSFCatalog();
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   250
			if (catalog != null) {
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   251
	    		for (IBSFPlatform plat : catalog.getPlatforms()) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   252
	    			if (plat.getName().compareToIgnoreCase(platform) == 0) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   253
	    				String mainPlatform = catalog.getReleasePlatform(platform);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   254
	    				if (mainPlatform != null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   255
	    					dirName = getDefFileDirectoryNameForPlatform(mainPlatform);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   256
	    					if (dirName == null || dirName.length() < 1) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   257
	    						// fallback - all BSF's should be EABI anyway
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   258
			    				return "EABI"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   259
	    					}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   260
	    				}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   261
	    			}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   262
	    		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   263
	    	}
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
		if (dirName == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   267
			// fallback for unknown cases
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   268
			dirName = platform;
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
		return dirName;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   272
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   273
	
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   274
	private String getDefFileDirectoryNameForPlatform(String platform) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   275
		if (platform.equals(EMULATOR_PLATFORM)) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   276
			return "BWINS"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   277
		} else if (platform.equals(ARMV5_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   278
					|| platform.equals(ARMV5_ABIV2_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   279
					|| platform.equals(ARMV6_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   280
					|| platform.equals(ARMV6_ABIV2_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   281
					|| platform.equals(GCCE_PLATFORM)) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   282
			return "EABI"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   283
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   284
		return null;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   285
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   286
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   287
	public IPath getCompilerPrefixFile() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   288
		if (platform.equals(GCCE_PLATFORM)) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   289
			return getGCCEPrefixFilePath();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   290
		} else if (platform.equals(ARMV5_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   291
					|| platform.equals(ARMV5_ABIV2_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   292
					|| platform.equals(ARMV6_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   293
					|| platform.equals(ARMV6_ABIV2_PLATFORM)) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   294
			return getRVCTPrefixFilePath();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   295
		} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   296
			// check BSF's
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   297
			IBSFCatalog catalog = getBuildInfo().getBSFCatalog();
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   298
	    	if (catalog != null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   299
	    		for (IBSFPlatform plat : catalog.getPlatforms()) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   300
	    			if (plat.getName().compareToIgnoreCase(platform) == 0) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   301
	    				String mainPlatform = catalog.getReleasePlatform(platform);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   302
	    				if (mainPlatform != null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   303
	    					if (mainPlatform.equals(GCCE_PLATFORM)) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   304
	    						return getGCCEPrefixFilePath();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   305
	    					} else if (mainPlatform.equals(ARMV5_PLATFORM) 
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   306
	    								|| mainPlatform.equals(ARMV5_ABIV2_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   307
	    								|| mainPlatform.equals(ARMV6_PLATFORM)
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   308
	    								|| mainPlatform.equals(ARMV6_ABIV2_PLATFORM)) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   309
	    						return getRVCTPrefixFilePath();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   310
	    					} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   311
	    						// fallback - all BSF's should be EABI anyway
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   312
	    						return getRVCTPrefixFilePath();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   313
	    					}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   314
	    				}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   315
	    			}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   316
	    		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   317
	    	}
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
		// fallback for WINSCW, MSVC, etc.
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   321
		return null;
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
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   324
	private IPath getIncludePath() {
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   325
		return getSDK().getIncludePath();
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   326
	}
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   327
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   328
	private IPath getGCCEPrefixFilePath() {
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   329
		return getIncludePath().append("gcce/gcce.h"); //$NON-NLS-1$
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   330
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   331
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   332
	private IPath getRVCTPrefixFilePath() {
1776
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1770
diff changeset
   333
		ISDKManager sdkManager = SDKCorePlugin.getSDKManager();
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1770
diff changeset
   334
		IRVCTToolChainInfo[] installedRVCTTools = ((SDKManager)sdkManager).getInstalledRVCTTools();
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   335
		// use default in case tools aren't installed
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   336
		String rvctFragment = "rvct2_2"; //$NON-NLS-1$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   337
		if (installedRVCTTools.length > 0) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   338
			rvctFragment = getRVCTFragment(installedRVCTTools[0]);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   339
		}
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   340
		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
   341
		if (prefixFilePath.toFile().exists()){
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   342
			return prefixFilePath;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   343
		} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   344
			// 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
   345
			// based on the default installation
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   346
			return getIncludePath().append("rvct").append("rvct" + ".h");
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   347
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   348
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   349
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   350
	private String getRVCTFragment(IRVCTToolChainInfo info) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   351
		int major = 0, minor = 0;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   352
		if (info != null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   353
			Version rvctToolsVersion = info.getRvctToolsVersion();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   354
			if (rvctToolsVersion != null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   355
				major = info.getRvctToolsVersion().getMajor();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   356
				minor = info.getRvctToolsVersion().getMinor();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   357
			}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   358
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   359
		return "rvct" + major + "_" + minor; //$NON-NLS-1$ //$NON-NLS-2$
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   360
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   361
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   362
	public List<IDefine> getVariantHRHDefines() {
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 getCachedData().getVariantHRHDefines();
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
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
   367
	public List<File> getVariantHRHIncludes() {
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   368
		return getCachedData().getPrefixFileIncludes();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   369
	}
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<IDefine> getCompilerPreincludeDefines() {
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   373
		// 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
   374
		// 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
   375
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   376
		IPath prefixFile = getCompilerPrefixFile();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   377
		if (prefixFile == null) {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   378
			return Collections.emptyList();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   379
		}
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
		return getCachedData().getCompilerMacros(prefixFile);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   382
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   383
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
	public String getBuildVariationName() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   386
		String varName = "";
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
		String[] tokens = getPlatformString().split("\\.");
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   389
		if (tokens.length == 2){
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   390
			varName = tokens[1];
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   391
		}
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
		return varName;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   394
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   395
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
   396
//	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
   397
//		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
   398
//			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
   399
//		} 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
   400
//			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
   401
//		}
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
//	}
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   403
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   404
	/**
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   405
	 * 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
   406
	 * A build context is subclassed by CarbideBuildConfiguration, which has multiple
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   407
	 * 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
   408
	 * @return cache, never <code>null</code>
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
	private SymbianBuildContextDataCache getCachedData() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   411
		return SymbianBuildContextDataCache.getCache(this);
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   412
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   413
	
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
	public String getBasePlatformForVariation() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   416
		String plat = "";
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
		String[] tokens = getPlatformString().split("\\.");
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   419
		if (tokens.length == 2){
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   420
			plat = tokens[0];
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   421
		} else {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   422
			return platform;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   423
		}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   424
		
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   425
		return plat;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   426
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   427
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
	 * Get the list of #include paths detected for this context.
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   431
	 * @return List or <code>null</code>
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
	public List<File> getCachedSystemIncludePaths() {
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   434
		return getCachedData().getSystemIncludePaths();
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   435
	}
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   436
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
   437
	@Override
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
   438
	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
   439
		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
   440
			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
   441
		}
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
	}
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
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
	@Override
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
	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
   446
		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
   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
	
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
	@Override
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
	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
   451
		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
   452
	}
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
	
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
	@Override
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
	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
   456
		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
   457
	}
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
	@SuppressWarnings("deprecation")
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
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
   568
	@Override
1764
df8e072f8f71 refactoring sbsv2 configuration specific data under ISBSv2BuildContext interfaces (fixes some glitches with prior attempt)
timkelly
parents: 1755
diff changeset
   569
	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
   570
		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
   571
	}
1770
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
	@Override
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   574
	/**
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   575
	 * 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
   576
	 * 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
   577
	 * @return
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   578
	 */
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   579
	public String getConfigurationID() {
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   580
		return getDisplayString();
fa990cb697f7 refactor out some items from ICarbideBuildConfiguration that should just be under ISymbianBuildContext
timkelly
parents: 1764
diff changeset
   581
	}
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
   582
	
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
	/**
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
	 * 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
   585
	 * @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
   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
	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
   588
		
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
		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
   590
			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
   591
		}
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
		
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
		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
   594
		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
   595
		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
   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
			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
   598
			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
   599
				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
   600
		}
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
		
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
		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
   603
		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
   604
		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
   605
			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
   606
			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
   607
			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
   608
			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
   609
			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
   610
			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
   611
				// 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
   612
				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
   613
				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
   614
					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
   615
				
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
				// 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
   617
				// 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
   618
				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
   619
				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
   620
					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
   621
					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
   622
					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
   623
					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
   624
					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
   625
				}
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
		} 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
   628
		}
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
		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
   631
	}
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
	
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
	@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
   634
	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
   635
		
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
		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
   637
		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
   638
		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
   639
		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
   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
			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
   642
			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
   643
				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
   644
		}
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
		
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
		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
   647
			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
   648
			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
   649
			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
   650
			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
   651
			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
   652
			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
   653
				// 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
   654
				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
   655
				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
   656
					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
   657
				
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
				// 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
   659
				// 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
   660
				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
   661
				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
   662
					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
   663
				} 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
   664
					// 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
   665
					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
   666
				}
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
		} 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
   669
		}
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
		
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
   671
		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
   672
	}
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
   673
	
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
   674
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents:
diff changeset
   675
}