core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/AbstractSDKManager.java
author stechong
Mon, 30 Aug 2010 16:39:11 -0500
changeset 1919 5c9cbbdfb5c2
parent 1897 48a778886355
child 1947 f0e22d4f5863
permissions -rw-r--r--
Fix for Bug 11934 [C3 SDK - If devices.xml has a drive a rescan will created a second instance].
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);
1919
5c9cbbdfb5c2 Fix for Bug 11934 [C3 SDK - If devices.xml has a drive a rescan will created a second instance].
stechong
parents: 1897
diff changeset
   321
				if (isInSDKList(sdk)) {
5c9cbbdfb5c2 Fix for Bug 11934 [C3 SDK - If devices.xml has a drive a rescan will created a second instance].
stechong
parents: 1897
diff changeset
   322
					continue;
5c9cbbdfb5c2 Fix for Bug 11934 [C3 SDK - If devices.xml has a drive a rescan will created a second instance].
stechong
parents: 1897
diff changeset
   323
				}
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   324
				((SymbianSDK)sdk).setEnabled(entry.isEnabled());
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   325
				synchronized (sdkList) {
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   326
					sdkList.add(sdk);
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   327
				}
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   328
			} else {
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   329
				((SymbianSDK)sdk).setEnabled(entry.isEnabled());
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   330
			}
1474
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   331
		}
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   332
	}
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   333
	
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
   334
	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
   335
		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
   336
			return;
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   337
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   338
		clearSDKCache();
1421
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   339
		synchronized(sdkList)
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   340
		{
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   341
			for (ISymbianSDK currSDK: sdkList) {
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   342
				SDKManagerCacheEntry entry = new SDKManagerCacheEntry();
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   343
				entry.setId(currSDK.getUniqueId());
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   344
				entry.setEpocRoot(currSDK.getEPOCROOT());
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   345
				entry.setOsVersion(currSDK.getOSVersion().toString());
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   346
				entry.setEnabled(currSDK.isEnabled());
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   347
				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
   348
			}
1862
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   349
			flushSDKCache();
1421
587da7cb64b7 New SDK preference page and SDK scanning mechanism; fix for Bug 10634.
stechong
parents: 1077
diff changeset
   350
		}
1474
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   351
	}
f7fe29684b34 Fixed SDK scanning issues at startup; also fixed Bug 11470.
stechong
parents: 1462
diff changeset
   352
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
   353
	/**
1919
5c9cbbdfb5c2 Fix for Bug 11934 [C3 SDK - If devices.xml has a drive a rescan will created a second instance].
stechong
parents: 1897
diff changeset
   354
	 * Check whether an SDK already exist in SDK list.
5c9cbbdfb5c2 Fix for Bug 11934 [C3 SDK - If devices.xml has a drive a rescan will created a second instance].
stechong
parents: 1897
diff changeset
   355
	 * @param sdk - SDK to be checked
5c9cbbdfb5c2 Fix for Bug 11934 [C3 SDK - If devices.xml has a drive a rescan will created a second instance].
stechong
parents: 1897
diff changeset
   356
	 * @return true if SDK already exist in SDK list, false otherwise
5c9cbbdfb5c2 Fix for Bug 11934 [C3 SDK - If devices.xml has a drive a rescan will created a second instance].
stechong
parents: 1897
diff changeset
   357
	 */
5c9cbbdfb5c2 Fix for Bug 11934 [C3 SDK - If devices.xml has a drive a rescan will created a second instance].
stechong
parents: 1897
diff changeset
   358
	abstract protected boolean isInSDKList(ISymbianSDK sdk);
5c9cbbdfb5c2 Fix for Bug 11934 [C3 SDK - If devices.xml has a drive a rescan will created a second instance].
stechong
parents: 1897
diff changeset
   359
5c9cbbdfb5c2 Fix for Bug 11934 [C3 SDK - If devices.xml has a drive a rescan will created a second instance].
stechong
parents: 1897
diff changeset
   360
	/**
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
   361
	 * 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
   362
	 * @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
   363
	 */
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   364
	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
   365
1776
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   366
	/**
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   367
	 * Get whether or not the UI has enabled BSF scanning.
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   368
	 * @return true if BSF scanning is enabled.
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   369
	 */
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
   370
	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
   371
		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
   372
	}
d2a651a847a5 Initial 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
	
1776
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   374
	/**
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   375
	 * 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
   376
	 * @param enabled - When true, add BSF platforms.
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   377
	 */
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
   378
	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
   379
		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
   380
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   381
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   382
	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
   383
		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
   384
	}
d2a651a847a5 Initial 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
	
d2a651a847a5 Initial 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
	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
   387
		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
   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
1776
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   390
	/**
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   391
	 * Returns toolchain info for all detected RVCT tools.
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   392
	 * @return Array of toolchain information objects.
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   393
	 */
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
   394
	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
   395
		// 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
   396
		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
   397
			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
   398
		}
d2a651a847a5 Initial 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
		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
   400
	}
d2a651a847a5 Initial 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
	/**
d2a651a847a5 Initial 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
	 * 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
   404
	 */
d2a651a847a5 Initial 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
	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
   406
		
d2a651a847a5 Initial 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
		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
   408
		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
   409
		
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
   410
		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
   411
		
d2a651a847a5 Initial 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
		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
   413
			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
   414
				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
   415
				
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   416
				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
   417
				
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   418
				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
   419
				
d2a651a847a5 Initial 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
				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
   421
				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
   422
d2a651a847a5 Initial 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
				// 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
   424
				// 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
   425
				// 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
   426
				// 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
   427
				// 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
   428
				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
   429
				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
   430
				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
   431
					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
   432
						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
   433
					} 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
   434
						// 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
   435
					}
d2a651a847a5 Initial 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
					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
   437
						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
   438
							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
   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
						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
   441
					}
d2a651a847a5 Initial 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
					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
   443
				}
d2a651a847a5 Initial 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
				
d2a651a847a5 Initial 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
				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
   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
				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
   448
					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
   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
						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
   451
							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
   452
							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
   453
							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
   454
							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
   455
							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
   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
					}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   458
				}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   459
			}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   460
			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
   461
				// 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
   462
			}
d2a651a847a5 Initial 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
		}
d2a651a847a5 Initial 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
				
d2a651a847a5 Initial 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
		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
   466
	}
d2a651a847a5 Initial 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
	
1682
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   468
    public void addMissingSdk(ISymbianSDK sdk) {
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   469
		missingSdkMap.put(sdk.getUniqueId(), sdk);
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   470
    }
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   471
    
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
   472
    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
   473
		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
   474
		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
   475
			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
   476
			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
   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
    	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
   479
    }
d2a651a847a5 Initial 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
    
1682
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   481
    public void removeMissingSdk(ISymbianSDK sdk) {
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   482
    	missingSdkMap.remove(sdk.getUniqueId());
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   483
    }
2ee63cbf206a Updated support for adding/removing missing SDK.
stechong
parents: 1667
diff changeset
   484
    
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
   485
    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
   486
    	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
   487
    }
d2a651a847a5 Initial 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
    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
   490
    	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
   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 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
   494
		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
   495
		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
   496
			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
   497
				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
   498
			}
d2a651a847a5 Initial 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
		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
   501
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   502
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   503
	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
   504
		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
   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
	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
   508
		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
   509
	}
d2a651a847a5 Initial 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
	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
   512
		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
   513
		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
   514
			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
   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
	}
d2a651a847a5 Initial 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
	
d2a651a847a5 Initial 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
	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
   519
		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
   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
	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
   523
		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
   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 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
   527
		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
   528
			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
   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
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   531
	
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   532
	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
   533
		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
   534
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   535
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   536
	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
   537
		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
   538
			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
   539
			
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   540
			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
   541
			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
   542
			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
   543
			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
   544
				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
   545
			} 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
   546
				// 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
   547
				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
   548
						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
   549
						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
   550
							"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
   551
							sbsPath), e));
1847
5a696c4ef747 more Linux related fixes
timkelly
parents: 1808
diff changeset
   552
			} 
745
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   553
			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
   554
				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
   555
				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
   556
				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
   557
				try {
926
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   558
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   559
					// 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
   560
					int maxTries = 20;
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   561
					int numTries = 0;
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   562
					while (numTries < maxTries) {
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   563
						try {
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   564
							Thread.sleep(500);
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   565
						} catch (InterruptedException e) {
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   566
							// ignore
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   567
						}
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   568
						if (br.ready()) {
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   569
							while ((stdErrLine = br.readLine()) != null) {
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   570
								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
   571
								numTries = maxTries;
926
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   572
							}
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
   573
							
926
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   574
						}
c6a84ca946e6 Timout SBSv2 version check if sbs hangs (bug 10467)
timkelly
parents: 745
diff changeset
   575
						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
   576
					}
51d63d83aad1 Don't log exception to console when sbs[.bat] cannot be found.
Ed Swartz <ed.swartz@nokia.com>
parents: 743
diff changeset
   577
				} 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
   578
					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
   579
				}
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
   580
				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
   581
				{
d2a651a847a5 Initial 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
					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
   583
					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
   584
						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
   585
							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
   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
					}
d2a651a847a5 Initial 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
						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
   589
d2a651a847a5 Initial 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
							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
   591
									+ 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
   592
									+ ". 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
   593
									+ 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
   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
									+ 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
   596
									+ "."
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   597
									+ 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
   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
							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
   600
									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
   601
											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
   602
											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
   603
											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
   604
						}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   605
					
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   606
					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
   607
					}
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
   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
			}
d2a651a847a5 Initial 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
		}
d2a651a847a5 Initial 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
		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
   612
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   613
1776
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   614
	/**
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   615
	 * Retrieve the minimum supported version of SBSv2 for Carbide.c++
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   616
	 * @return Version
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   617
	 * @since 2.3
ad19bba5eef8 refactoring ISDKManager - removing unnecessary API
timkelly
parents: 1732
diff changeset
   618
	 */
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
   619
	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
   620
		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
   621
	}
d2a651a847a5 Initial work to support an ISDKManager implementation that only understands SBSv2 (meaning, no devices.xml support).
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   622
	
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
   623
	/**
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
	 * 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
   625
	 */
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
	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
   627
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
		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
   629
		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
   630
		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
   631
		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
   632
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
		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
   634
			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
   635
			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
   636
			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
   637
				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
   638
				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
   639
				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
   640
					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
   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
						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
   643
							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
   644
									.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
   645
							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
   646
						} 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
   647
							// 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
   648
							// 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
   649
						}
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
   650
					}
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
   651
				}
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
   652
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
   653
			}
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
   654
		}
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
   655
		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
   656
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
   657
	}
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   658
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   659
	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
   660
		SDKCacheUtils.getCache().removeCache(SDK_MANAGER_CACHE_KEY, true);
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   661
	}
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   662
1862
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   663
	protected void flushSDKCache() {
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   664
		try {
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   665
			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
   666
		} catch (Exception e) {
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   667
			e.printStackTrace();
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   668
		}
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   669
	}
e3bac873e5c8 Updated SDK manager to write SDK cache to disk whenever SDK list gets updated.
stechong
parents: 1857
diff changeset
   670
1715
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   671
	@SuppressWarnings("unchecked")
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   672
	protected List<String> getSDKCacheIdList() {
1808
88695467fd04 Removed SDKCacheUtils type from public API.
stechong
parents: 1781
diff changeset
   673
		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
   674
		List<String> idList = new ArrayList<String>();
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   675
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   676
		if (cacheMap != null) {
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   677
			idList.addAll(cacheMap.keySet()); 
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   678
		}
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   679
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   680
		return idList;
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
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   683
	@SuppressWarnings("unchecked")
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   684
	protected SDKManagerCacheEntry getSDKCacheEntry(String id) {
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   685
		SDKManagerCacheEntry entry = null;
1808
88695467fd04 Removed SDKCacheUtils type from public API.
stechong
parents: 1781
diff changeset
   686
		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
   687
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   688
		if (cacheMap != null) {
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   689
			entry = cacheMap.get(id);
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   690
		}
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   691
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   692
		return entry;
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
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   695
	@SuppressWarnings("unchecked")
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   696
	protected void setSDKCacheEntry(SDKManagerCacheEntry entry) {
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   697
		String id = entry.getId();
1808
88695467fd04 Removed SDKCacheUtils type from public API.
stechong
parents: 1781
diff changeset
   698
		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
   699
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   700
		if (cacheMap == null) {
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   701
			cacheMap = new HashMap<String, SDKManagerCacheEntry>();
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   702
		}
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   703
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   704
		cacheMap.put(id, entry);
1808
88695467fd04 Removed SDKCacheUtils type from public API.
stechong
parents: 1781
diff changeset
   705
		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
   706
	}
ff0db4bbc189 Updated SDKManager to use SDKCacheUtils for caching SDK info.
stechong
parents: 1699
diff changeset
   707
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
   708
}