core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SBSv2Utils.java
author timkelly
Wed, 15 Sep 2010 17:34:04 -0500
changeset 2014 caea34d3ba13
parent 1871 4d38e1ac1cff
child 2050 0d6ae58214f3
permissions -rw-r--r--
fix bug 12011
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     1
/*
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     3
* All rights reserved.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     8
*
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    11
*
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    12
*/
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    13
package com.nokia.carbide.cpp.internal.api.sdk;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    14
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    15
import java.io.File;
693
2d475d296af4 Look for sbs or sbs.bat under SBS_HOME/bin first, instead of only looking at the PATH.
Ed Swartz <ed.swartz@nokia.com>
parents: 629
diff changeset
    16
import java.text.MessageFormat;
1134
081b99cb271a bug 10674. Add support for long alias names from Carbide.xml (initial support)
timkelly
parents: 693
diff changeset
    17
import java.util.ArrayList;
081b99cb271a bug 10674. Add support for long alias names from Carbide.xml (initial support)
timkelly
parents: 693
diff changeset
    18
import java.util.Collections;
081b99cb271a bug 10674. Add support for long alias names from Carbide.xml (initial support)
timkelly
parents: 693
diff changeset
    19
import java.util.Comparator;
081b99cb271a bug 10674. Add support for long alias names from Carbide.xml (initial support)
timkelly
parents: 693
diff changeset
    20
import java.util.List;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    21
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    22
import org.eclipse.cdt.utils.spawner.EnvironmentReader;
1134
081b99cb271a bug 10674. Add support for long alias names from Carbide.xml (initial support)
timkelly
parents: 693
diff changeset
    23
import org.eclipse.core.runtime.IPath;
081b99cb271a bug 10674. Add support for long alias names from Carbide.xml (initial support)
timkelly
parents: 693
diff changeset
    24
import org.eclipse.core.runtime.Path;
629
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
    25
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
    26
import org.eclipse.core.runtime.preferences.InstanceScope;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    27
import org.osgi.framework.Version;
629
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
    28
import org.osgi.service.prefs.BackingStoreException;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    29
1288
7f5308d16da0 Fix for Bug 11073 (Remove SBSv1 as a builder option).
stechong
parents: 1270
diff changeset
    30
import com.nokia.carbide.cpp.sdk.core.ISDKManager;
1134
081b99cb271a bug 10674. Add support for long alias names from Carbide.xml (initial support)
timkelly
parents: 693
diff changeset
    31
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext;
081b99cb271a bug 10674. Add support for long alias names from Carbide.xml (initial support)
timkelly
parents: 693
diff changeset
    32
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
081b99cb271a bug 10674. Add support for long alias names from Carbide.xml (initial support)
timkelly
parents: 693
diff changeset
    33
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
608
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
    34
import com.nokia.cpp.internal.api.utils.core.HostOS;
176
11eeeeeb1733 clean up imports
timkelly
parents: 0
diff changeset
    35
import com.nokia.cpp.internal.api.utils.core.Logging;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    36
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    37
/**
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    38
 * Utility class for SBSv2
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    39
 * @since 2.0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    40
 */
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    41
public class SBSv2Utils {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    42
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
    43
	//private static final String SBSV2_FILTERED_CONFIGS_STORE = "sbsv2FilteredConfigs"; //$NON-NLS-1$
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
    44
	private static final String SBSV2_FILTERED_CONFIGS_STORE_V2 = "sbsv2FilteredConfigs_V2"; //$NON-NLS-1$
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
    45
	//private static final String SBSV2_FILTERED_CONFIGS_STORE_INITED = "sbsv2FilteredConfigsInited"; //$NON-NLS-1$
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
    46
	private static final String SBSV2_FILTERED_CONFIGS_STORE_INITED_V2 = "sbsv2FilteredConfigsInited_V2"; //$NON-NLS-1$
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    47
	private static final String SBSV2_FILTERED_CONFIGS_DELIMETER = ";"; //$NON-NLS-1$
1288
7f5308d16da0 Fix for Bug 11073 (Remove SBSv1 as a builder option).
stechong
parents: 1270
diff changeset
    48
	private static final long VALID_ABLD_SIZE = 1024;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    49
1134
081b99cb271a bug 10674. Add support for long alias names from Carbide.xml (initial support)
timkelly
parents: 693
diff changeset
    50
	/**
081b99cb271a bug 10674. Add support for long alias names from Carbide.xml (initial support)
timkelly
parents: 693
diff changeset
    51
	 * Map of usable Raptor alias for -c parameter and base platform: <alise, base plat>
081b99cb271a bug 10674. Add support for long alias names from Carbide.xml (initial support)
timkelly
parents: 693
diff changeset
    52
	 */
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
    53
//	private static Map<String, String> unfilteredSBSv2ConfigNames;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    54
1239
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
    55
	/** Path, to and including the SBS script */
608
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
    56
	protected static IPath sbsPath;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
    57
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
    58
	private static boolean scannedSbsState = false;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
    59
	private static final String sbsScriptName = HostOS.IS_WIN32 ? "sbs.bat" : "sbs"; 
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    60
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    61
	/**
1239
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
    62
     * Get the path to the SBSv2 bin directory, not including the sbs executable.  
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
    63
     * May or may not actually exist.
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
    64
     * @return absolute path to the bin directory, or null if sbs is not found
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    65
     */
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    66
    public static IPath getSBSBinDirectory() {
1239
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
    67
    	String pathValue = EnvironmentReader.getEnvVar("PATH"); //$NON-NLS-1$
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
    68
    	IPath sbs = HostOS.findProgramOnPath(sbsScriptName, pathValue);
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
    69
    	if (sbs != null){
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
    70
    		sbs = sbs.removeLastSegments(1);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    71
    	}
1239
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
    72
    	return sbs;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    73
    }
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    74
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    75
    /**
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    76
     * Given a list of SDKs, returns the list of the SDK's supported by SBSv2
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    77
     * @param sdks list of SDK's to check
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    78
     * @return list of SBSv2 supported SDK's, may be empty
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    79
     */
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    80
    public static List<ISymbianSDK> getSupportedSDKs(List<ISymbianSDK> sdks) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    81
    	List<ISymbianSDK> supportedSDKs = new ArrayList<ISymbianSDK>();
629
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
    82
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
    83
    	// If there is no SBSv1 builder, then assume all SDKs are SBSv2 capable
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
    84
    	if (!enableSBSv1Support()) {
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
    85
    		supportedSDKs.addAll(sdks);
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
    86
    	} else {
1779
73303c546665 clean up some TODO comments
timkelly
parents: 1522
diff changeset
    87
	    	// Filter out anything older than 9.4
629
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
    88
	    	for (ISymbianSDK sdk : sdks) {
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
    89
	    		Version osVersion = sdk.getOSVersion();
2014
caea34d3ba13 fix bug 12011
timkelly
parents: 1871
diff changeset
    90
	    		if (osVersion.compareTo(new Version("9.4.0")) >= 0) {
629
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
    91
	    			supportedSDKs.add(sdk);
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
    92
	    		}
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
    93
	    	}
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    94
    	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    95
    	return supportedSDKs;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    96
    }
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    97
    
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    98
	/**
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    99
	 * Returns the list of SBSv2 build configuration names that should
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   100
	 * INCLUDED in any UI. Only configs to be displayed are saved
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   101
	 */
1478
69015f2143b2 Fix some problems displaying broken configs and broken SDKs in the SDK/Config Tree for SBSv2
timkelly
parents: 1476
diff changeset
   102
	public static List<String> getSBSv2FilteredConfigPreferences() {
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   103
		List<String> buildAliasList = new ArrayList<String>();
629
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
   104
		IEclipsePreferences prefs = new InstanceScope().getNode(SDKCorePlugin.PLUGIN_ID);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   105
		if (prefs != null) {
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   106
			String configs = prefs.get(SBSV2_FILTERED_CONFIGS_STORE_V2, "");
1522
58667ad9656d Clean up APIs/Tests around SBSv2 query mechanism (got rid of most all the original test API now that it's been moved into BuildContextSBSv2.
timkelly
parents: 1478
diff changeset
   107
			if (configs.length() == 0){
58667ad9656d Clean up APIs/Tests around SBSv2 query mechanism (got rid of most all the original test API now that it's been moved into BuildContextSBSv2.
timkelly
parents: 1478
diff changeset
   108
				initDefaultConfigsToFilter();
58667ad9656d Clean up APIs/Tests around SBSv2 query mechanism (got rid of most all the original test API now that it's been moved into BuildContextSBSv2.
timkelly
parents: 1478
diff changeset
   109
				configs = prefs.get(SBSV2_FILTERED_CONFIGS_STORE_V2, "");
58667ad9656d Clean up APIs/Tests around SBSv2 query mechanism (got rid of most all the original test API now that it's been moved into BuildContextSBSv2.
timkelly
parents: 1478
diff changeset
   110
			}
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   111
			String aliasesToInclude[] = configs.split(SBSV2_FILTERED_CONFIGS_DELIMETER);
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   112
			for (String alias : aliasesToInclude){
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   113
				buildAliasList.add(alias);
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   114
			}
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   115
		}
1522
58667ad9656d Clean up APIs/Tests around SBSv2 query mechanism (got rid of most all the original test API now that it's been moved into BuildContextSBSv2.
timkelly
parents: 1478
diff changeset
   116
		
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   117
		return buildAliasList;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   118
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   119
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   120
	/**
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   121
	 * Set the list of SBSv2 build configurations that should be included in a build config list
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   122
	 * All others will be filtered out
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   123
	 * @param configs configs to be filtered
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   124
	 */
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   125
	public static void setSBSv2FilteredConfigs(String[] configs) {
629
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
   126
		IEclipsePreferences prefs = new InstanceScope().getNode(SDKCorePlugin.PLUGIN_ID);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   127
		if (prefs != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   128
			String store = ""; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   129
			for (String config : configs) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   130
				store = store + SBSV2_FILTERED_CONFIGS_DELIMETER + config;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   131
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   132
			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   133
			// remove the leading delimeter
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   134
			if (store.length() > 0) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   135
				store = store.substring(1);
266
c7ecdd0b9f52 Fix bug 9310. Fix save problem with Platform Filter Prefs (sbsv2) and add Restore / Apply buttons.
timkelly
parents: 176
diff changeset
   136
			}
c7ecdd0b9f52 Fix bug 9310. Fix save problem with Platform Filter Prefs (sbsv2) and add Restore / Apply buttons.
timkelly
parents: 176
diff changeset
   137
			if (store.length() >= 0){
c7ecdd0b9f52 Fix bug 9310. Fix save problem with Platform Filter Prefs (sbsv2) and add Restore / Apply buttons.
timkelly
parents: 176
diff changeset
   138
				// lenght of zero means there are not configs to filter (or show them all)
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   139
				prefs.put(SBSV2_FILTERED_CONFIGS_STORE_V2, store);
629
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
   140
				try {
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
   141
					prefs.flush();
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
   142
				} catch (BackingStoreException e) {
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
   143
					Logging.log(SDKCorePlugin.getDefault(),
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
   144
							Logging.newStatus(SDKCorePlugin.getDefault(), e));
c24c517fe8c2 Fix SBSv2 SDK filtering.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
   145
				}
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   146
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   147
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   148
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   149
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   150
	/**
1270
ad41cb5ef65f fix bug 11077 and bug 11033
timkelly
parents: 1239
diff changeset
   151
	 * There are many build aliases presented by default from Raptor
ad41cb5ef65f fix bug 11077 and bug 11033
timkelly
parents: 1239
diff changeset
   152
	 * Filter out those that are less commonly used on new workspace creation.
ad41cb5ef65f fix bug 11077 and bug 11033
timkelly
parents: 1239
diff changeset
   153
	 */
ad41cb5ef65f fix bug 11077 and bug 11033
timkelly
parents: 1239
diff changeset
   154
	public static void initDefaultConfigsToFilter() {
ad41cb5ef65f fix bug 11077 and bug 11033
timkelly
parents: 1239
diff changeset
   155
		IEclipsePreferences prefs = new InstanceScope().getNode(SDKCorePlugin.getPluginId());
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   156
		String inited = prefs.get(SBSV2_FILTERED_CONFIGS_STORE_INITED_V2, "");
1270
ad41cb5ef65f fix bug 11077 and bug 11033
timkelly
parents: 1239
diff changeset
   157
		if (inited == null || inited.length() == 0){
ad41cb5ef65f fix bug 11077 and bug 11033
timkelly
parents: 1239
diff changeset
   158
			List<String> defaultConfigsToFilter = new ArrayList<String>();
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   159
			
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   160
			defaultConfigsToFilter.add("armv5_udeb");
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   161
			defaultConfigsToFilter.add("armv5_urel");
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   162
			defaultConfigsToFilter.add("armv5_udeb_gcce");
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   163
			defaultConfigsToFilter.add("armv5_urel_gcce");
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   164
			defaultConfigsToFilter.add("winscw_urel");
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   165
			defaultConfigsToFilter.add("winscw_udeb");
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   166
			
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   167
			prefs.put(SBSV2_FILTERED_CONFIGS_STORE_INITED_V2, "true");
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   168
			setSBSv2FilteredConfigs(defaultConfigsToFilter.toArray(new String[defaultConfigsToFilter.size()]));
1270
ad41cb5ef65f fix bug 11077 and bug 11033
timkelly
parents: 1239
diff changeset
   169
			
ad41cb5ef65f fix bug 11077 and bug 11033
timkelly
parents: 1239
diff changeset
   170
		}
ad41cb5ef65f fix bug 11077 and bug 11033
timkelly
parents: 1239
diff changeset
   171
	}
ad41cb5ef65f fix bug 11077 and bug 11033
timkelly
parents: 1239
diff changeset
   172
ad41cb5ef65f fix bug 11077 and bug 11033
timkelly
parents: 1239
diff changeset
   173
	/**
608
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   174
	 * Whether or not to display SBSv1 builder UI
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   175
	 * @return true if SBSv1 is available, false otherwise
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   176
	 */
1352
2953a4d4c5d9 Add SDKCorePlugin.SUPPORTS_SBSV1_BUILDER to enable/disable SBSv1 builder support
timkelly
parents: 1350
diff changeset
   177
	
608
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   178
	public static boolean enableSBSv1Support() {
1352
2953a4d4c5d9 Add SDKCorePlugin.SUPPORTS_SBSV1_BUILDER to enable/disable SBSv1 builder support
timkelly
parents: 1350
diff changeset
   179
		
1820
5c955fcfdc3d fix npe, clear sbsv2 query cache data in memory when rebuilding sbsv2 cache from pref, other code clean-up
timkelly
parents: 1779
diff changeset
   180
		// hard-coded shut off
1352
2953a4d4c5d9 Add SDKCorePlugin.SUPPORTS_SBSV1_BUILDER to enable/disable SBSv1 builder support
timkelly
parents: 1350
diff changeset
   181
		if (!SDKCorePlugin.SUPPORTS_SBSV1_BUILDER)
2953a4d4c5d9 Add SDKCorePlugin.SUPPORTS_SBSV1_BUILDER to enable/disable SBSv1 builder support
timkelly
parents: 1350
diff changeset
   182
			return false;
2953a4d4c5d9 Add SDKCorePlugin.SUPPORTS_SBSV1_BUILDER to enable/disable SBSv1 builder support
timkelly
parents: 1350
diff changeset
   183
		
1820
5c955fcfdc3d fix npe, clear sbsv2 query cache data in memory when rebuilding sbsv2 cache from pref, other code clean-up
timkelly
parents: 1779
diff changeset
   184
		// check perl script
5c955fcfdc3d fix npe, clear sbsv2 query cache data in memory when rebuilding sbsv2 cache from pref, other code clean-up
timkelly
parents: 1779
diff changeset
   185
		else if (isSBSv1Supported()) 
1352
2953a4d4c5d9 Add SDKCorePlugin.SUPPORTS_SBSV1_BUILDER to enable/disable SBSv1 builder support
timkelly
parents: 1350
diff changeset
   186
			return true;
1288
7f5308d16da0 Fix for Bug 11073 (Remove SBSv1 as a builder option).
stechong
parents: 1270
diff changeset
   187
		
608
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   188
		return false;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   189
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   190
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   191
	/**
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   192
	 * Whether or not to display SBSv2 builder UI
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   193
	 * @return true if SBSv2 is installed, false otherwise
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   194
	 */
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   195
	public static boolean enableSBSv2Support() {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   196
		IPath sbsBinPath = getSBSBinDirectory();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   197
		if (sbsBinPath != null && sbsBinPath.toFile().exists()) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   198
			return true;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   199
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   200
		return false;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   201
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   202
608
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   203
	/**
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   204
	 * (Re-)scan the SBSv2 / Raptor configuration
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   205
	 * @return message if error, else null
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   206
	 */
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   207
	public static String scanSBSv2() {
1239
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
   208
		if (sbsPath != null){
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
   209
			return null;
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
   210
		}
608
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   211
		// do some basic checks
1239
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
   212
		IPath expectedPath = getSBSBinDirectory();
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
   213
		if (expectedPath != null) {
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
   214
			expectedPath = expectedPath.append(sbsScriptName);
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
   215
			if (expectedPath.toFile().exists()) {
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
   216
				sbsPath = expectedPath;
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
   217
			}
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
   218
		} 
608
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   219
		
1239
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
   220
		if (sbsPath == null) {
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
   221
			return MessageFormat.format(Messages
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
   222
					.getString("SBSv2Utils.CannotFindSBSScriptError"), //$NON-NLS-1$
668d819e9f59 Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents: 1221
diff changeset
   223
					sbsScriptName);
608
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   224
		}
693
2d475d296af4 Look for sbs or sbs.bat under SBS_HOME/bin first, instead of only looking at the PATH.
Ed Swartz <ed.swartz@nokia.com>
parents: 629
diff changeset
   225
		
608
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   226
		return null;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   227
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   228
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   229
    /**
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   230
     * Get the path to SBSv2 (sbs.bat or sbs)
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   231
     */
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   232
	public static IPath getSBSPath() {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   233
		if (!scannedSbsState) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   234
			scanSBSv2();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   235
			scannedSbsState = true;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   236
		}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   237
		return sbsPath != null ? sbsPath : new Path(sbsScriptName);  // dummy
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents: 266
diff changeset
   238
	}
1138
352c0236f181 bug 10674. Sort sbsv2 configuration names with same platform_target alias prefix. ensure gcce error parser is used for sbsv2 GCCE4 build configs, add a project specific (sbsv2 only) edit box that allows user to append whatever they want to the -c parameter (the build alias). Also, fixed SDK support for TB kits now that TB92SF appears as a prefix rather than a suffix in the buildinfo.txt file.
timkelly
parents: 1134
diff changeset
   239
	
1270
ad41cb5ef65f fix bug 11077 and bug 11033
timkelly
parents: 1239
diff changeset
   240
	private static List<ISymbianBuildContext> sortContexts(List<ISymbianBuildContext> contexts){ 
1138
352c0236f181 bug 10674. Sort sbsv2 configuration names with same platform_target alias prefix. ensure gcce error parser is used for sbsv2 GCCE4 build configs, add a project specific (sbsv2 only) edit box that allows user to append whatever they want to the -c parameter (the build alias). Also, fixed SDK support for TB kits now that TB92SF appears as a prefix rather than a suffix in the buildinfo.txt file.
timkelly
parents: 1134
diff changeset
   241
		Collections.sort(contexts, new Comparator<ISymbianBuildContext>() {
352c0236f181 bug 10674. Sort sbsv2 configuration names with same platform_target alias prefix. ensure gcce error parser is used for sbsv2 GCCE4 build configs, add a project specific (sbsv2 only) edit box that allows user to append whatever they want to the -c parameter (the build alias). Also, fixed SDK support for TB kits now that TB92SF appears as a prefix rather than a suffix in the buildinfo.txt file.
timkelly
parents: 1134
diff changeset
   242
			public int compare(ISymbianBuildContext o1, ISymbianBuildContext o2) {
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   243
				return o2.getDisplayString().compareTo(o1.getDisplayString());
1138
352c0236f181 bug 10674. Sort sbsv2 configuration names with same platform_target alias prefix. ensure gcce error parser is used for sbsv2 GCCE4 build configs, add a project specific (sbsv2 only) edit box that allows user to append whatever they want to the -c parameter (the build alias). Also, fixed SDK support for TB kits now that TB92SF appears as a prefix rather than a suffix in the buildinfo.txt file.
timkelly
parents: 1134
diff changeset
   244
			}
352c0236f181 bug 10674. Sort sbsv2 configuration names with same platform_target alias prefix. ensure gcce error parser is used for sbsv2 GCCE4 build configs, add a project specific (sbsv2 only) edit box that allows user to append whatever they want to the -c parameter (the build alias). Also, fixed SDK support for TB kits now that TB92SF appears as a prefix rather than a suffix in the buildinfo.txt file.
timkelly
parents: 1134
diff changeset
   245
		});
352c0236f181 bug 10674. Sort sbsv2 configuration names with same platform_target alias prefix. ensure gcce error parser is used for sbsv2 GCCE4 build configs, add a project specific (sbsv2 only) edit box that allows user to append whatever they want to the -c parameter (the build alias). Also, fixed SDK support for TB kits now that TB92SF appears as a prefix rather than a suffix in the buildinfo.txt file.
timkelly
parents: 1134
diff changeset
   246
		
1476
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   247
		return contexts; 
09e768e53db5 first pass on implementing Raptor query mechanism to construct SBSv2 contexts. Will likely introduce some instability for SBSv2, but should have no impact on SBSv1: WIP.
timkelly
parents: 1459
diff changeset
   248
	}
1221
f41fa762c65f Fix bug 11068 (part 2). Add dynamic text to dispaly -c command and release tree when variant is applied.
timkelly
parents: 1183
diff changeset
   249
	
1288
7f5308d16da0 Fix for Bug 11073 (Remove SBSv1 as a builder option).
stechong
parents: 1270
diff changeset
   250
	private static boolean isSBSv1Supported() {
1842
f6d3febbf42c more Linux fixes. Couple issues found: 1) Rescanning SDKs causes deadlock. 2) SDK cache is not working for Linux 3) Can't import when SBS is not installed (and there's not error msg)
timkelly
parents: 1820
diff changeset
   251
		if (HostOS.IS_UNIX){
f6d3febbf42c more Linux fixes. Couple issues found: 1) Rescanning SDKs causes deadlock. 2) SDK cache is not working for Linux 3) Can't import when SBS is not installed (and there's not error msg)
timkelly
parents: 1820
diff changeset
   252
			return false;
f6d3febbf42c more Linux fixes. Couple issues found: 1) Rescanning SDKs causes deadlock. 2) SDK cache is not working for Linux 3) Can't import when SBS is not installed (and there's not error msg)
timkelly
parents: 1820
diff changeset
   253
		}
f6d3febbf42c more Linux fixes. Couple issues found: 1) Rescanning SDKs causes deadlock. 2) SDK cache is not working for Linux 3) Can't import when SBS is not installed (and there's not error msg)
timkelly
parents: 1820
diff changeset
   254
		
1288
7f5308d16da0 Fix for Bug 11073 (Remove SBSv1 as a builder option).
stechong
parents: 1270
diff changeset
   255
		ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();
7f5308d16da0 Fix for Bug 11073 (Remove SBSv1 as a builder option).
stechong
parents: 1270
diff changeset
   256
		for (ISymbianSDK sdk : sdkMgr.getSDKList()) {
7f5308d16da0 Fix for Bug 11073 (Remove SBSv1 as a builder option).
stechong
parents: 1270
diff changeset
   257
			File abld = new File(sdk.getEPOCROOT(), "epoc32/tools/abld.pl"); //$NON-NLS-1$
7f5308d16da0 Fix for Bug 11073 (Remove SBSv1 as a builder option).
stechong
parents: 1270
diff changeset
   258
			if (abld.exists()) {
7f5308d16da0 Fix for Bug 11073 (Remove SBSv1 as a builder option).
stechong
parents: 1270
diff changeset
   259
				long size = abld.length();
7f5308d16da0 Fix for Bug 11073 (Remove SBSv1 as a builder option).
stechong
parents: 1270
diff changeset
   260
				if (size >= VALID_ABLD_SIZE)
7f5308d16da0 Fix for Bug 11073 (Remove SBSv1 as a builder option).
stechong
parents: 1270
diff changeset
   261
					return true;
7f5308d16da0 Fix for Bug 11073 (Remove SBSv1 as a builder option).
stechong
parents: 1270
diff changeset
   262
			}
7f5308d16da0 Fix for Bug 11073 (Remove SBSv1 as a builder option).
stechong
parents: 1270
diff changeset
   263
		}
7f5308d16da0 Fix for Bug 11073 (Remove SBSv1 as a builder option).
stechong
parents: 1270
diff changeset
   264
		return false;
7f5308d16da0 Fix for Bug 11073 (Remove SBSv1 as a builder option).
stechong
parents: 1270
diff changeset
   265
	}
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   266
}