core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java
author timkelly
Thu, 26 Aug 2010 16:06:13 -0500
changeset 1897 48a778886355
parent 1894 0909e3336f6d
child 1919 5c9cbbdfb5c2
permissions -rw-r--r--
make sure to remove cache from disk when deleting an sdk or it will show up on refresh
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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:
diff changeset
     1
/*
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     8
*
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    11
*
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    12
*/
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    13
package com.nokia.carbide.cpp.internal.sdk.core.model;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    14
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    15
import java.io.BufferedReader;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    16
import java.io.IOException;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    17
import java.io.InputStreamReader;
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
    18
import java.io.Serializable;
745
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
    19
import java.text.MessageFormat;
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:
diff changeset
    20
import java.util.ArrayList;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    21
import java.util.HashMap;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    22
import java.util.Iterator;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    23
import java.util.List;
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
    24
import java.util.Map;
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:
diff changeset
    25
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    26
import org.eclipse.core.resources.ResourcesPlugin;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    27
import org.eclipse.core.runtime.CoreException;
945
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
    28
import org.eclipse.core.runtime.IConfigurationElement;
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
    29
import org.eclipse.core.runtime.IExtension;
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
    30
import org.eclipse.core.runtime.IExtensionPoint;
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
    31
import org.eclipse.core.runtime.IExtensionRegistry;
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:
diff changeset
    32
import org.eclipse.core.runtime.IPath;
1421
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
    33
import org.eclipse.core.runtime.IProgressMonitor;
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:
diff changeset
    34
import org.eclipse.core.runtime.IStatus;
1496
955e25610999 Prevent duplicate SDKs from getting removed during SDK rescanning; also changed SDK scanning during startup to prevent deadlock.
stechong
parents: 1494
diff changeset
    35
import org.eclipse.core.runtime.NullProgressMonitor;
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:
diff changeset
    36
import org.eclipse.core.runtime.Platform;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    37
import org.eclipse.core.runtime.Status;
1488
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
    38
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
1421
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
    39
import org.eclipse.core.runtime.jobs.IJobChangeListener;
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
    40
import org.eclipse.core.runtime.jobs.Job;
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:
diff changeset
    41
import org.osgi.framework.Version;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    42
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    43
import com.nokia.carbide.cpp.internal.api.sdk.BuildPlat;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    44
import com.nokia.carbide.cpp.internal.api.sdk.ICarbideDevicesXMLChangeListener;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    45
import com.nokia.carbide.cpp.internal.api.sdk.ISDKManagerInternal;
945
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
    46
import com.nokia.carbide.cpp.internal.api.sdk.ISDKManagerLoadedHook;
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:
diff changeset
    47
import com.nokia.carbide.cpp.internal.api.sdk.SBSv2Utils;
1808
88695467fd04 Removed SDKCacheUtils type from public API.
stechong
parents: 1781
diff changeset
    48
import com.nokia.carbide.cpp.internal.api.sdk.SDKCacheUtils;
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:
diff changeset
    49
import com.nokia.carbide.cpp.internal.api.sdk.SDKManagerInternalAPI;
743
78fd666a897a Fix filesystem caching performance as in bug #10318
Ed Swartz <ed.swartz@nokia.com>
parents: 684
diff changeset
    50
import com.nokia.carbide.cpp.internal.api.sdk.SymbianBuildContextDataCache;
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:
diff changeset
    51
import com.nokia.carbide.cpp.internal.api.sdk.SymbianMacroStore;
1568
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1496
diff changeset
    52
import com.nokia.carbide.cpp.internal.api.sdk.sbsv2.SBSv2QueryUtils;
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:
diff changeset
    53
import com.nokia.carbide.cpp.sdk.core.ICarbideInstalledSDKChangeListener;
1421
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
    54
import com.nokia.carbide.cpp.sdk.core.ICarbideInstalledSDKChangeListener.SDKChangeEventType;
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:
diff changeset
    55
import com.nokia.carbide.cpp.sdk.core.IRVCTToolChainInfo;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    56
import com.nokia.carbide.cpp.sdk.core.ISDKManager;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    57
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
1484
273affe128cc Updated SDK manager to attempt removing SDK from devicex.xml only when the SDK is originally defined in the file.
stechong
parents: 1480
diff changeset
    58
import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures;
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:
diff changeset
    59
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
1474
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
    60
import com.nokia.carbide.cpp.sdk.core.SymbianSDKFactory;
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:
diff changeset
    61
import com.nokia.cpp.internal.api.utils.core.ListenerList;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    62
import com.nokia.cpp.internal.api.utils.core.Logging;
684
8e7900690341 Extract path-manipulation utilities into PathUtils, to correspond with the same classes in EDC.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
    63
import com.nokia.cpp.internal.api.utils.core.PathUtils;
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:
diff changeset
    64
import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    65
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    66
public abstract class AbstractSDKManager implements ISDKManager, ISDKManagerInternal {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    67
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    68
	protected static List<ISymbianSDK> sdkList = new ArrayList<ISymbianSDK>();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    69
	protected HashMap<String,ISymbianSDK> missingSdkMap = new HashMap<String,ISymbianSDK>();
1421
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
    70
	protected Job scanJob;
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:
diff changeset
    71
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
    72
	public static final String SDK_MANAGER_CACHE_KEY = "sdk_manager_cache";
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:
diff changeset
    73
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    74
	protected static final String EMPTY_STRING = "";
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    75
	protected static boolean enableBSFScanner;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    76
	protected static List<BuildPlat> platList = new ArrayList<BuildPlat>();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    77
	protected static SymbianMacroStore macroStore;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    78
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    79
	protected static final String[] knownRVCTVersions = {"3.1", "3.0", "2.2", "2.1"};
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    80
	protected Version sbsV2Version;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    81
	
945
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
    82
	static boolean sdkHookExtenstionsNotified;
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
    83
	public static final String SDK_MANAGER_LOADED_HOOK = SDKCorePlugin.PLUGIN_ID
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
    84
	+ ".sdkManagerLoadedHook"; //$NON-NLS-1$
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
    85
	
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
    86
	
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:
diff changeset
    87
	/**
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    88
	 * Minimum SBSv2 version supported with Carbide
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    89
	 */
1494
d0b573bc9608 fix minimum raptor version
timkelly
parents: 1488
diff changeset
    90
	public static final Version MINIMUM_RAPTOR_VERSION = new Version(2, 15, 0);
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:
diff changeset
    91
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    92
	static boolean hasScannedSDKs = false; // make sure we only scan SDKs when needed
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    93
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    94
	protected static List<IRVCTToolChainInfo> rvctInfoList = 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:
diff changeset
    95
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    96
	/**
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    97
	 * Implement listener so other class that use this can listen to SDK 
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    98
	 * change event (e.g. validate project config description)
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    99
	 */
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   100
	protected static ListenerList<ICarbideInstalledSDKChangeListener> listeners = new ListenerList<ICarbideInstalledSDKChangeListener>();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   101
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   102
	/*
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   103
	 * Implement listener so other class that use this can listen for when a change to the devices.xml
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   104
	 * has been modified outside of Carbide
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   105
	 */
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   106
	protected static ListenerList<ICarbideDevicesXMLChangeListener> devicesXMLListeners = new ListenerList<ICarbideDevicesXMLChangeListener>();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   107
	
1488
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   108
	IJobChangeListener scanJobListener = new IJobChangeListener() {
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   109
		public void sleeping(IJobChangeEvent event) {}
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   110
		public void scheduled(IJobChangeEvent event) {}
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   111
		public void running(IJobChangeEvent event) {}
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   112
		public void awake(IJobChangeEvent event) {}
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   113
		public void aboutToRun(IJobChangeEvent event) {}
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   114
		public void done(IJobChangeEvent event) {
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   115
			fireInstalledSdkChanged(SDKChangeEventType.eSDKScanned);
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   116
		}
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   117
	};
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   118
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   119
		
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:
diff changeset
   120
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   121
	public AbstractSDKManager() {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   122
		macroStore = SymbianMacroStore.getInstance();
1496
955e25610999 Prevent duplicate SDKs from getting removed during SDK rescanning; also changed SDK scanning during startup to prevent deadlock.
stechong
parents: 1494
diff changeset
   123
		scanJob = new Job ("Scan for installed SDKs") {
1474
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   124
			@Override
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   125
			protected IStatus run(IProgressMonitor monitor) {
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   126
				return handleScan(monitor);
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   127
			}
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   128
		};
1488
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   129
		
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   130
		addScanJobListner(scanJobListener);
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:
diff changeset
   131
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   132
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   133
	public SymbianMacroStore getSymbianMacroStore(){
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   134
		return macroStore;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   135
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   136
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   137
	public void scanSDKs() {
1568
508bfdb3a934 Added caching of Raptor query data for aliases, products and configs.
stechong
parents: 1496
diff changeset
   138
		SBSv2QueryUtils.removeAllCachedQueries();
1474
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   139
		// do the real sdk scanning in a job.
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   140
		if (scanJob.getState() == Job.NONE) {
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   141
			scanJob.schedule();
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   142
		}
1455
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   143
	}
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   144
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   145
	private IStatus handleScan(IProgressMonitor monitor) {
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   146
		synchronized (sdkList)
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   147
		{
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   148
			ArrayList<ISymbianSDK> oldSDKList = new ArrayList<ISymbianSDK>(sdkList);
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   149
			
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   150
			getSBSv2Version(true);
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   151
			
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   152
			if (sdkList != null){
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   153
				sdkList.clear();
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   154
			}
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   155
		
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   156
			if (!doScanSDKs(monitor))
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   157
				return Status.OK_STATUS;;
1496
955e25610999 Prevent duplicate SDKs from getting removed during SDK rescanning; also changed SDK scanning during startup to prevent deadlock.
stechong
parents: 1494
diff changeset
   158
1455
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   159
			// now these SDK's are newly added, remove from internal list
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   160
			for (ISymbianSDK sdk : sdkList) {
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   161
				if (SDKManagerInternalAPI.getMissingSdk(sdk.getUniqueId()) != null) {
1682
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   162
					SDKManagerInternalAPI.removeMissingSdk(sdk);
1455
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   163
				}
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   164
			}
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   165
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   166
			// now these SDK's are removed from the old list, add to
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   167
			// internal list
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   168
			for (ISymbianSDK oldSdk : oldSDKList) {
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   169
				boolean found = false;
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   170
				for (ISymbianSDK sdk : sdkList) {
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   171
					if (sdk.getUniqueId().equals(oldSdk.getUniqueId())) {
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   172
						found = true;
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   173
						break;
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   174
					}
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   175
				}
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   176
				if (found == false) {
1682
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   177
					SDKManagerInternalAPI.addMissingSdk(oldSdk);
1455
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   178
					// flush cache
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   179
					SymbianBuildContextDataCache.refreshForSDKs(new ISymbianSDK[] { oldSdk });
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   180
				}
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   181
			}
1424
f27f3399e676 Updated SDK manager to make sure scan job is not already running before scheduling it; also default OS version to 9.5 if buildinfo.txt is missing from an SDK.
stechong
parents: 1421
diff changeset
   182
		}
1455
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   183
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   184
		// make sure we don't rescan over and over again
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   185
		hasScannedSDKs = true;
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   186
		
1474
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   187
		updateCarbideSDKCache();
1455
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   188
		
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   189
		// Notify any plugins that want to know if the SDKManager has scanned plugins.
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   190
		if (!sdkHookExtenstionsNotified) {
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   191
			notifySDKManagerLoaded();
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   192
			sdkHookExtenstionsNotified = true;
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   193
		}
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   194
		if (monitor.isCanceled()) {
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   195
			return Status.CANCEL_STATUS;
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   196
		}
fb33806f2865 Moved scanning job back to invoking thread for now.
stechong
parents: 1434
diff changeset
   197
		return Status.OK_STATUS;
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:
diff changeset
   198
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   199
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   200
	/**
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   201
	 * Actually scan the SDKs available and populate sdkList.   
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   202
	 * @param oldSDkList old list of SDKs available for reference, e.g., detecting
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   203
	 * when SDKs are newly missing
743
78fd666a897a Fix filesystem caching performance as in bug #10318
Ed Swartz <ed.swartz@nokia.com>
parents: 684
diff changeset
   204
	 * @return true if scan succeeded
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:
diff changeset
   205
	 */
1421
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   206
	abstract protected boolean doScanSDKs(IProgressMonitor monitor);
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:
diff changeset
   207
	
1421
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   208
	public void addScanJobListner(IJobChangeListener listener) {
1488
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   209
		if (scanJob != null && listener != null) {
1421
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   210
			scanJob.addJobChangeListener(listener);
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   211
		}
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   212
	}
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   213
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   214
	public void removeScanJobLisner(IJobChangeListener listener) {
1488
f1eec65aaede add back in accidental merge-out of scanjob listener
timkelly
parents: 1485
diff changeset
   215
		if (scanJob != null && listener != null) {
1421
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   216
			scanJob.removeJobChangeListener(listener);
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   217
		}
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
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:
diff changeset
   219
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   220
	protected void ensureScannedSDKs() {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   221
		if (!hasScannedSDKs) {
1496
955e25610999 Prevent duplicate SDKs from getting removed during SDK rescanning; also changed SDK scanning during startup to prevent deadlock.
stechong
parents: 1494
diff changeset
   222
			handleScan(new NullProgressMonitor());
955e25610999 Prevent duplicate SDKs from getting removed during SDK rescanning; also changed SDK scanning during startup to prevent deadlock.
stechong
parents: 1494
diff changeset
   223
			fireInstalledSdkChanged(SDKChangeEventType.eSDKScanned);
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:
diff changeset
   224
		}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   225
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   226
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   227
	public List<ISymbianSDK> getSDKList() {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
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:
diff changeset
   229
		synchronized(sdkList)
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   230
		{
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   231
			if (sdkList.size() < 1) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   232
				ensureScannedSDKs();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   233
			}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   234
			List<ISymbianSDK> listCopy = new ArrayList<ISymbianSDK>(sdkList);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   235
			return listCopy;			
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
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:
diff changeset
   237
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   238
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   239
	public ISymbianSDK getSDK(String sdkId, boolean scanIfNecessary) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   240
		if (scanIfNecessary) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   241
			getSDKList();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   242
		}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   243
		synchronized(sdkList)
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   244
		{
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   245
			for (Iterator iter = sdkList.iterator(); iter.hasNext();) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   246
				ISymbianSDK sdk = (ISymbianSDK)iter.next();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   247
				if (sdk.getUniqueId().compareTo(sdkId) == 0) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   248
					return sdk;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   249
				}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   250
			}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   251
		}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   252
		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:
diff changeset
   253
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   254
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   255
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   256
	public void addSDK(ISymbianSDK sdk) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   257
		synchronized(sdkList)
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   258
		{
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   259
			try {
1474
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   260
				sdkList.add(sdk);
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:
diff changeset
   261
				updateSDK(sdk);
1682
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   262
				SDKManagerInternalAPI.removeMissingSdk(sdk);
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:
diff changeset
   263
				// tell others about it
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   264
				fireInstalledSdkChanged(SDKChangeEventType.eSDKAdded);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   265
			}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   266
			catch (Exception e) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   267
				logError("Could not add SDK", e);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   268
				String message = "Could not add this SDK. Your devices.xml file may be corrupt. If you remove the file from its current location and then rescan SDKs, Carbide will offer to create a new one.";
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   269
				Logging.showErrorDialog(WorkbenchUtils.getSafeShell(), null, message, Logging.newSimpleStatus(1, e));
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   270
			}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   271
		}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   272
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   273
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   274
	public boolean removeSDK(String sdkId) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   275
		synchronized (sdkList)
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   276
		{
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   277
			if (sdkList != 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:
diff changeset
   278
				for (ISymbianSDK currSDK : sdkList){
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   279
					if (currSDK.getUniqueId().equals(sdkId)){
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   280
						sdkList.remove(currSDK);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   281
						
1682
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   282
						SDKManagerInternalAPI.addMissingSdk(currSDK);
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:
diff changeset
   283
						
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   284
						// tell others about it
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   285
						fireInstalledSdkChanged(SDKChangeEventType.eSDKRemoved);
1484
273affe128cc Updated SDK manager to attempt removing SDK from devicex.xml only when the SDK is originally defined in the file.
stechong
parents: 1480
diff changeset
   286
273affe128cc Updated SDK manager to attempt removing SDK from devicex.xml only when the SDK is originally defined in the file.
stechong
parents: 1480
diff changeset
   287
						// only remove sdk from devices.xml if the sdk is defined in it
273affe128cc Updated SDK manager to attempt removing SDK from devicex.xml only when the SDK is originally defined in the file.
stechong
parents: 1480
diff changeset
   288
						if (((SymbianSDK)currSDK).getSupportedFeatures().contains(ISymbianSDKFeatures.IS_FROM_DEVICES_XML)) {
273affe128cc Updated SDK manager to attempt removing SDK from devicex.xml only when the SDK is originally defined in the file.
stechong
parents: 1480
diff changeset
   289
							doRemoveSDK(sdkId);
273affe128cc Updated SDK manager to attempt removing SDK from devicex.xml only when the SDK is originally defined in the file.
stechong
parents: 1480
diff changeset
   290
						}
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:
diff changeset
   291
						
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   292
						break;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   293
					}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   294
				}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   295
				
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   296
				updateCarbideSDKCache();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   297
				
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   298
			} else {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   299
				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:
diff changeset
   300
			}			
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   301
		}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   302
		return 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:
diff changeset
   303
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   304
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   305
	abstract protected boolean doRemoveSDK(String sdkId);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   306
1496
955e25610999 Prevent duplicate SDKs from getting removed during SDK rescanning; also changed SDK scanning during startup to prevent deadlock.
stechong
parents: 1494
diff changeset
   307
	protected void scanCarbideSDKCache(){
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   308
		List<String> idList = getSDKCacheIdList();
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   309
		for (Iterator<String> itr = idList.iterator(); itr.hasNext();) {
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   310
			String id = itr.next();
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   311
			SDKManagerCacheEntry entry = getSDKCacheEntry(id);
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   312
			ISymbianSDK sdk = getSDK(id, false);
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   313
			if (sdk == null) {
1732
c408456e415f Make sure OS version is never set to 0 when loading SDK from cache.
stechong
parents: 1717
diff changeset
   314
				Version osVersion = new Version(entry.getOsVersion());
c408456e415f Make sure OS version is never set to 0 when loading SDK from cache.
stechong
parents: 1717
diff changeset
   315
				if (osVersion.getMajor() == 0) {
c408456e415f Make sure OS version is never set to 0 when loading SDK from cache.
stechong
parents: 1717
diff changeset
   316
					osVersion = new Version("9.5");
c408456e415f Make sure OS version is never set to 0 when loading SDK from cache.
stechong
parents: 1717
diff changeset
   317
				}
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   318
				sdk = SymbianSDKFactory.createInstance(id, 
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   319
						   entry.getEpocRoot(),
1732
c408456e415f Make sure OS version is never set to 0 when loading SDK from cache.
stechong
parents: 1717
diff changeset
   320
						   osVersion);
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   321
				((SymbianSDK)sdk).setEnabled(entry.isEnabled());
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   322
				synchronized (sdkList) {
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   323
					sdkList.add(sdk);
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   324
				}
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   325
			} else {
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   326
				((SymbianSDK)sdk).setEnabled(entry.isEnabled());
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   327
			}
1474
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   328
		}
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   329
	}
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   330
	
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:
diff changeset
   331
	public void updateCarbideSDKCache() {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   332
		if (!Platform.isRunning())
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   333
			return;
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   334
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   335
		clearSDKCache();
1421
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   336
		synchronized(sdkList)
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   337
		{
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   338
			for (ISymbianSDK currSDK: sdkList) {
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   339
				SDKManagerCacheEntry entry = new SDKManagerCacheEntry();
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   340
				entry.setId(currSDK.getUniqueId());
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   341
				entry.setEpocRoot(currSDK.getEPOCROOT());
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   342
				entry.setOsVersion(currSDK.getOSVersion().toString());
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   343
				entry.setEnabled(currSDK.isEnabled());
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   344
				setSDKCacheEntry(entry);
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:
diff changeset
   345
			}
1862
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   346
			flushSDKCache();
1421
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   347
		}
1474
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   348
	}
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   349
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:
diff changeset
   350
	/**
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   351
	 * Tell whether EPOCROOT can be changed for a given ISymbianSDK
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   352
	 * @return flag
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   353
	 */
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   354
	abstract protected boolean isEPOCRootFixed();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   355
1776
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   356
	/**
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   357
	 * Get whether or not the UI has enabled BSF scanning.
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   358
	 * @return true if BSF scanning is enabled.
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   359
	 */
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:
diff changeset
   360
	public boolean getBSFScannerEnabled(){
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   361
		return enableBSFScanner;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   362
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   363
	
1776
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   364
	/**
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   365
	 * Set whether or not build platforms should be added for SDKs that contain .bsf extensions.
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   366
	 * @param enabled - When true, add BSF platforms.
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   367
	 */
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:
diff changeset
   368
	public void enableBSFScanner(boolean enabled){
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   369
		enableBSFScanner = enabled;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   370
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   371
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   372
	public void setPlatformList(List<BuildPlat> inPlatList){
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   373
		platList = inPlatList;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   374
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   375
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   376
	public List<BuildPlat> getPlatformList(){
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   377
		return platList;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   378
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   379
1776
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   380
	/**
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   381
	 * Returns toolchain info for all detected RVCT tools.
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   382
	 * @return Array of toolchain information objects.
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   383
	 */
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:
diff changeset
   384
	public synchronized IRVCTToolChainInfo[] getInstalledRVCTTools() {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   385
		// the path wn't change inside one invocation so cache the results
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   386
		if (rvctInfoList == 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:
diff changeset
   387
			rvctInfoList = scanForInstalledRVCTCompilers();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   388
		}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   389
		return (IRVCTToolChainInfo[]) rvctInfoList.toArray(new IRVCTToolChainInfo[rvctInfoList.size()]);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   390
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   391
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   392
	/**
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   393
	 * Get a list of IRVCTToolChainInfo objects for all RVCT installations detected on the PATH env var.
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   394
	 */
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   395
	protected static List<IRVCTToolChainInfo> scanForInstalledRVCTCompilers() {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   396
		
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   397
		Runtime rt=Runtime.getRuntime();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   398
		List<IRVCTToolChainInfo> rvctToolList = new ArrayList<IRVCTToolChainInfo>();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   399
		
684
8e7900690341 Extract path-manipulation utilities into PathUtils, to correspond with the same classes in EDC.
Ed Swartz <ed.swartz@nokia.com>
parents: 608
diff changeset
   400
		IPath[] pathEntries = PathUtils.getPathEntries(null);
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:
diff changeset
   401
		
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   402
		for(IPath path : pathEntries) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   403
			try {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   404
				String command = path.append("armcc").toOSString() + " --vsn";
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   405
				
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   406
				Process p = rt.exec(command);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   407
				
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   408
				BufferedReader br = new BufferedReader(new InputStreamReader(p.getErrorStream()));
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   409
				
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   410
				String overallOutput = 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:
diff changeset
   411
				String stdErrLine = 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:
diff changeset
   412
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   413
				// RVCT waits for like 4 minutes trying to find a license when the computer is
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   414
				// not connected to the network.  in such cases, the call to br.readline doesn't
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   415
				// return for 4 minutes which is unacceptable here.  Instead we'll poll at 1/2 second
1717
c652b45338b6 only wait 5 seconds for rvct version info. If not found, default to rvct2_2. (This is for abld only)
timkelly
parents: 1715
diff changeset
   416
				// intervals for 5 seconds and see if we get a response. On the first response we break out
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:
diff changeset
   417
				// of the loop and read the output. So in most normal circumstances it will take 1/2 to 1 seconds.
1717
c652b45338b6 only wait 5 seconds for rvct version info. If not found, default to rvct2_2. (This is for abld only)
timkelly
parents: 1715
diff changeset
   418
				int maxTries = 10;
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:
diff changeset
   419
				int numTries = 0;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   420
				while (numTries < maxTries) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   421
					try {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   422
						Thread.sleep(500);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   423
					} catch (InterruptedException e) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   424
						// ignore
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   425
					}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   426
					if (br.ready()) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   427
						while ((stdErrLine = br.readLine()) != 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:
diff changeset
   428
							overallOutput += stdErrLine;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   429
						}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   430
						break;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   431
					}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   432
					numTries++;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   433
				}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   434
				
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   435
				p.destroy();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   436
				
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   437
				if (overallOutput != null && overallOutput.length() > 0){
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   438
					for (String currVersion : knownRVCTVersions) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   439
						
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   440
						if(overallOutput.contains(currVersion)) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   441
							RVCTToolChainInfo rvctInfo = new RVCTToolChainInfo();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   442
							rvctInfo.setRvctToolBinariesDirectory(path.toOSString());
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   443
							rvctInfo.setRvctToolsVersion(new Version(currVersion));
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   444
							rvctToolList.add(rvctInfo);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   445
							break; // tool successfully added
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   446
						}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   447
					}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   448
				}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   449
			}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   450
			catch (IOException e) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   451
				// armcc isn't in this directory, ignore....
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   452
			}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   453
		}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   454
				
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   455
		return rvctToolList;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   456
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   457
	
1682
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   458
    public void addMissingSdk(ISymbianSDK sdk) {
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   459
		missingSdkMap.put(sdk.getUniqueId(), sdk);
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   460
    }
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   461
    
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:
diff changeset
   462
    public ISymbianSDK addMissingSdk(String uid) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   463
		ISymbianSDK sdk = getMissingSdk(uid);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   464
		if (sdk == 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:
diff changeset
   465
			sdk = SymbianMissingSDKFactory.createInstance(uid);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   466
			missingSdkMap.put(uid, sdk);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   467
		}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   468
    	return sdk;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   469
    }
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   470
    
1682
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   471
    public void removeMissingSdk(ISymbianSDK sdk) {
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   472
    	missingSdkMap.remove(sdk.getUniqueId());
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   473
    }
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   474
    
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:
diff changeset
   475
    public void removeMissingSdk(String uid) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   476
    	missingSdkMap.remove(uid);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   477
    }
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   478
    
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   479
    public ISymbianSDK getMissingSdk(String uid) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   480
    	return missingSdkMap.get(uid);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   481
    }
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   482
    
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   483
	public List<ISymbianSDK> getMissingSDKList() {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   484
		List<ISymbianSDK> listCopy = new ArrayList<ISymbianSDK>();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   485
		synchronized(missingSdkMap) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   486
			for (ISymbianSDK sdk : missingSdkMap.values()) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   487
				listCopy.add(sdk);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   488
			}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   489
		}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   490
		return listCopy;			
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   491
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   492
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   493
	public void addInstalledSdkChangeListener(ICarbideInstalledSDKChangeListener listener) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   494
		listeners.add(listener);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   495
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   496
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   497
	public void removeInstalledSdkChangeListener(ICarbideInstalledSDKChangeListener listener) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   498
		listeners.remove(listener);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   499
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   500
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   501
	public void fireInstalledSdkChanged(SDKChangeEventType eventType) {
1894
0909e3336f6d Fix for Bug 11908 [SDK - Add/delete/re-scan an sdk the filtering configurations are not updated automatically].
stechong
parents: 1862
diff changeset
   502
		ListenerList<ICarbideInstalledSDKChangeListener> lList = listeners;
0909e3336f6d Fix for Bug 11908 [SDK - Add/delete/re-scan an sdk the filtering configurations are not updated automatically].
stechong
parents: 1862
diff changeset
   503
		for (ICarbideInstalledSDKChangeListener l : lList) {
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:
diff changeset
   504
			l.installedSdkChanged(eventType);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   505
		}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   506
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   507
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   508
	public void addDevicesXMLChangeListener(ICarbideDevicesXMLChangeListener listener) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   509
		devicesXMLListeners.add(listener);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   510
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   511
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   512
	public void removeDevicesXMLChangeListener(ICarbideDevicesXMLChangeListener listener) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   513
		devicesXMLListeners.remove(listener);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   514
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   515
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   516
	public void fireDevicesXMLChanged() {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   517
		for (ICarbideDevicesXMLChangeListener l : devicesXMLListeners) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   518
			l.devicesXMLOutOfSync();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   519
		}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   520
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   521
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   522
	protected void logError(String message, Throwable t) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   523
		SDKCorePlugin.getDefault().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.getPluginId(), message, t));		
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   524
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   525
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   526
	public Version getSBSv2Version(boolean forceScan) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   527
		if (sbsV2Version == null || forceScan){
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   528
			sbsV2Version = new Version(0, 0, 0);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   529
			
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   530
			Runtime rt=Runtime.getRuntime();
745
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   531
			IPath sbsPath = SBSv2Utils.getSBSPath();
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   532
			Process p = null;
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:
diff changeset
   533
			try {
745
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   534
				p = rt.exec(new String[] { sbsPath.toOSString(), "-v" });
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   535
			} catch (IOException e) {
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   536
				// no such process, SBSv2 not available
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   537
				Logging.log(SDKCorePlugin.getDefault(), Logging.newSimpleStatus(
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   538
						0, IStatus.WARNING, 
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   539
						MessageFormat.format(
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   540
							"Could not find or launch Raptor script ''{0}''; SBSv2 support will not be available",
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   541
							sbsPath), e));
1847
5a696c4ef747 more Linux related fixes
timkelly
parents: 1808
diff changeset
   542
			} 
745
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   543
			if (p != null) {
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:
diff changeset
   544
				BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
1077
7bde62318913 Fix bug 10835. Also fix issue with null String check where elcipse 3.6 complier removes code, assuming it's dead.
timkelly
parents: 945
diff changeset
   545
				String overallOutput = "";
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:
diff changeset
   546
				String stdErrLine = null;
745
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   547
				try {
926
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   548
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   549
					// Only try for 10 seconds then bail in case Raptor hangs
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   550
					int maxTries = 20;
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   551
					int numTries = 0;
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   552
					while (numTries < maxTries) {
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   553
						try {
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   554
							Thread.sleep(500);
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   555
						} catch (InterruptedException e) {
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   556
							// ignore
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   557
						}
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   558
						if (br.ready()) {
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   559
							while ((stdErrLine = br.readLine()) != null) {
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   560
								overallOutput += stdErrLine;
1077
7bde62318913 Fix bug 10835. Also fix issue with null String check where elcipse 3.6 complier removes code, assuming it's dead.
timkelly
parents: 945
diff changeset
   561
								numTries = maxTries;
926
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   562
							}
1077
7bde62318913 Fix bug 10835. Also fix issue with null String check where elcipse 3.6 complier removes code, assuming it's dead.
timkelly
parents: 945
diff changeset
   563
							
926
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   564
						}
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   565
						numTries++;
745
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   566
					}
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   567
				} catch (IOException e) {
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   568
					e.printStackTrace();
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:
diff changeset
   569
				}
1077
7bde62318913 Fix bug 10835. Also fix issue with null String check where elcipse 3.6 complier removes code, assuming it's dead.
timkelly
parents: 945
diff changeset
   570
				if (overallOutput.length() > 0) {
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:
diff changeset
   571
				{
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   572
					String[] tokens = overallOutput.split(" ");
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   573
					if (tokens.length >= 3) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   574
						if (tokens[2].split("\\.").length == 3) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   575
							sbsV2Version = Version.parseVersion(tokens[2]);
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   576
						}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   577
					}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   578
						if (sbsV2Version.compareTo(MINIMUM_RAPTOR_VERSION) < 0 && sbsV2Version.getMajor() > 0) {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   579
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   580
							String incorrectRaptorVersionStr = "SBSv2 version detected: "
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   581
									+ sbsV2Version.toString()
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   582
									+ ". The minimum version suggested for Carbide is: "
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   583
									+ MINIMUM_RAPTOR_VERSION.getMajor()
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   584
									+ "."
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   585
									+ MINIMUM_RAPTOR_VERSION.getMinor()
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   586
									+ "."
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   587
									+ MINIMUM_RAPTOR_VERSION.getMicro();
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   588
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   589
							ResourcesPlugin.getPlugin().getLog().log(
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   590
									new Status(IStatus.WARNING,
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   591
											SDKCorePlugin.PLUGIN_ID,
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   592
											IStatus.WARNING,
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   593
											incorrectRaptorVersionStr, 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:
diff changeset
   594
						}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   595
					
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   596
					p.destroy();
745
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   597
					}
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:
diff changeset
   598
				}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   599
			}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   600
		}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   601
		return sbsV2Version;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   602
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   603
1776
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   604
	/**
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   605
	 * Retrieve the minimum supported version of SBSv2 for Carbide.c++
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   606
	 * @return Version
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   607
	 * @since 2.3
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   608
	 */
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:
diff changeset
   609
	public Version getMinimumSupportedSBSv2Version() {
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   610
		return MINIMUM_RAPTOR_VERSION;
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   611
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   612
	
945
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   613
	/**
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   614
	 * Find clients of the 'sdkManagerLoadedHook' extension point so their plug-ins can be loaded
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   615
	 */
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   616
	private void notifySDKManagerLoaded() {
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   617
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   618
		ISDKManagerLoadedHook sdkHook = null;
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   619
		IExtensionRegistry er = Platform.getExtensionRegistry();
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   620
		IExtensionPoint ep = er.getExtensionPoint(SDK_MANAGER_LOADED_HOOK);
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   621
		IExtension[] extensions = ep.getExtensions();
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   622
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   623
		for (int i = 0; i < extensions.length; i++) {
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   624
			IExtension extension = extensions[i];
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   625
			IConfigurationElement[] ces = extension.getConfigurationElements();
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   626
			if (ces != null && ces.length >= 1) {
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   627
				IConfigurationElement providerElement = ces[0];
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   628
				String name = providerElement.getAttribute("name"); //$NON-NLS-1$
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   629
				if (name != null) {
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   630
					if (providerElement.getAttribute("class") != null) { //$NON-NLS-1$
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   631
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   632
						try {
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   633
							sdkHook = (ISDKManagerLoadedHook) providerElement
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   634
									.createExecutableExtension("class"); //$NON-NLS-1$
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   635
							sdkHook.symbianSDKManagerLoaded();
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   636
						} catch (CoreException e) {
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   637
							// ignore
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   638
							// e.printStackTrace();
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   639
						}
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   640
					}
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   641
				}
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   642
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   643
			}
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   644
		}
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   645
		return;
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   646
67437bfc7c6f Add ISymbianManagerLoadedHook - currently used to notify com.nokia.qt plugins that need to ensure that Qt SDKs have been scanned and added to the Qt preferences and that ICarbideBuildConfiguration listeners are added so the proper Qt-SDK can be set with build config changes. Scanned Qt SDKs are wrapped in a Job and added SDKs are reported to the Error log as Info.
timkelly
parents: 926
diff changeset
   647
	}
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   648
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   649
	protected void clearSDKCache() {
1897
48a778886355 make sure to remove cache from disk when deleting an sdk or it will show up on refresh
timkelly
parents: 1894
diff changeset
   650
		SDKCacheUtils.getCache().removeCache(SDK_MANAGER_CACHE_KEY, true);
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   651
	}
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   652
1862
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   653
	protected void flushSDKCache() {
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   654
		try {
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   655
			SDKCacheUtils.getCache().flushCache(SDK_MANAGER_CACHE_KEY);
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   656
		} catch (Exception e) {
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   657
			e.printStackTrace();
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   658
		}
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   659
	}
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   660
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   661
	@SuppressWarnings("unchecked")
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   662
	protected List<String> getSDKCacheIdList() {
1808
88695467fd04 Removed SDKCacheUtils type from public API.
stechong
parents: 1781
diff changeset
   663
		Map<String, SDKManagerCacheEntry> cacheMap = SDKCacheUtils.getCache().getCachedData(SDK_MANAGER_CACHE_KEY, Map.class, 0);
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   664
		List<String> idList = new ArrayList<String>();
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   665
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   666
		if (cacheMap != null) {
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   667
			idList.addAll(cacheMap.keySet()); 
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   668
		}
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   669
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   670
		return idList;
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   671
	}
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   672
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   673
	@SuppressWarnings("unchecked")
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   674
	protected SDKManagerCacheEntry getSDKCacheEntry(String id) {
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   675
		SDKManagerCacheEntry entry = null;
1808
88695467fd04 Removed SDKCacheUtils type from public API.
stechong
parents: 1781
diff changeset
   676
		Map<String, SDKManagerCacheEntry> cacheMap = SDKCacheUtils.getCache().getCachedData(SDK_MANAGER_CACHE_KEY, Map.class, 0);
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   677
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   678
		if (cacheMap != null) {
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   679
			entry = cacheMap.get(id);
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   680
		}
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   681
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   682
		return entry;
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   683
	}
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   684
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   685
	@SuppressWarnings("unchecked")
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   686
	protected void setSDKCacheEntry(SDKManagerCacheEntry entry) {
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   687
		String id = entry.getId();
1808
88695467fd04 Removed SDKCacheUtils type from public API.
stechong
parents: 1781
diff changeset
   688
		Map<String, SDKManagerCacheEntry> cacheMap = SDKCacheUtils.getCache().getCachedData(SDK_MANAGER_CACHE_KEY, Map.class, 0);
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   689
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   690
		if (cacheMap == null) {
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   691
			cacheMap = new HashMap<String, SDKManagerCacheEntry>();
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   692
		}
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   693
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   694
		cacheMap.put(id, entry);
1808
88695467fd04 Removed SDKCacheUtils type from public API.
stechong
parents: 1781
diff changeset
   695
		SDKCacheUtils.getCache().putCachedData(SDK_MANAGER_CACHE_KEY, (Serializable)cacheMap, 0);
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   696
	}
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   697
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:
diff changeset
   698
}