core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/sdk/core/model/SymbianSDK.java
author timkelly
Thu, 26 Aug 2010 09:57:08 -0500
changeset 1892 2009dcd074b0
parent 1871 4d38e1ac1cff
child 1984 0dc4caef98fa
permissions -rw-r--r--
fix bug 11939
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     1
/*
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     3
* All rights reserved.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     8
*
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    11
*
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    12
*/
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    13
package com.nokia.carbide.cpp.internal.sdk.core.model;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    14
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    15
import java.io.File;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    16
import java.io.FileReader;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    17
import java.io.IOException;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    18
import java.io.Reader;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    19
import java.util.HashMap;
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    20
import java.util.HashSet;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    21
import java.util.Map;
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    22
import java.util.Set;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    23
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    24
import javax.xml.XMLConstants;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    25
import javax.xml.parsers.DocumentBuilder;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    26
import javax.xml.parsers.DocumentBuilderFactory;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    27
import javax.xml.parsers.ParserConfigurationException;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    28
import javax.xml.transform.Source;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    29
import javax.xml.transform.TransformerException;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    30
import javax.xml.transform.stream.StreamSource;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    31
import javax.xml.validation.Schema;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    32
import javax.xml.validation.SchemaFactory;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    33
import javax.xml.validation.Validator;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    34
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    35
import org.eclipse.core.resources.ResourcesPlugin;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    36
import org.eclipse.core.runtime.IPath;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    37
import org.eclipse.core.runtime.IStatus;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    38
import org.eclipse.core.runtime.Path;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    39
import org.eclipse.core.runtime.Status;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    40
import org.osgi.framework.Version;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    41
import org.w3c.dom.Document;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    42
import org.w3c.dom.NamedNodeMap;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    43
import org.w3c.dom.Node;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    44
import org.w3c.dom.traversal.NodeIterator;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    45
import org.xml.sax.SAXException;
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    46
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    47
import com.nokia.carbide.cpp.internal.api.sdk.ISBSv1BuildInfo;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    48
import com.nokia.carbide.cpp.internal.api.sdk.ISymbianSDKModifier;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    49
import com.nokia.carbide.cpp.internal.sdk.core.gen.Devices.DeviceType;
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    50
import com.nokia.carbide.cpp.sdk.core.ISDKBuildInfo;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    51
import com.nokia.carbide.cpp.sdk.core.ISymbianBuilderID;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    52
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK;
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    53
import com.nokia.carbide.cpp.sdk.core.ISymbianSDKFeatures;
1418
8ca7cf978139 first pass refactoring ICarbideBuildConfiguration, removing implementation of ISymbianBuildContext.
timkelly
parents: 1410
diff changeset
    54
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    55
import com.sun.org.apache.xpath.internal.XPathAPI;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    56
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    57
public class SymbianSDK implements ISymbianSDK, ISymbianSDKModifier {
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    58
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    59
	public static final String MANIFEST_XML_LOCATION = "/epoc32/kit/manifest.xml"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    60
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    61
	// manifest.xml attributes
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    62
	private static final String PATH_ID_INCLUDEDIR = "includeDir"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    63
	private static final String PATH_ID_TOOLSDIR = "toolsDir"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    64
	private static final String PATH_ID_SRCDIR = "srcDir"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    65
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    66
	private static final String RELEASE = "release"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    67
	private static final String BUILD_INFO_TXT_FILE = "epoc32/data/buildinfo.txt"; //$NON-NLS-1$
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    68
	private static final String BUILD_INFO_KEYWORD = "ManufacturerSoftwareBuild";
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    69
	
610
bfb3ab3f70f2 Initial round of Unix portability fixes (using HostOS class), and fixes to EPOC engine unit tests.
Ed Swartz <ed.swartz@nokia.com>
parents: 343
diff changeset
    70
	private static final String WINSCW_UREL_DIR = "epoc32/release/winscw/urel";
1666
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
    71
	private static final String WINSCW_UDEB_DIR = "epoc32/release/winscw/udeb";
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
    72
	private static final String ARMV5_UDEB_DIR = "epoc32/release/armv5/udeb";
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    73
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    74
	protected DeviceType deviceEntry = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    75
	private boolean enabled = true;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    76
	private Version osVersion;
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
    77
	private Map<String, ISDKBuildInfo> buildInfoMap = new HashMap<String, ISDKBuildInfo>();
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
    78
	private Map<String, File> prefixFileMap = new HashMap<String, File>();
1666
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
    79
	private Set<Object> sdkFeatures = new HashSet<Object>();
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    80
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    81
	public SymbianSDK(DeviceType device) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    82
		deviceEntry = device;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    83
		scanSDK();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    84
	}
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
    85
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
    86
	public void addSupportedFeature(Object feature) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
    87
		sdkFeatures.add(feature);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    88
	}
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
    89
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
    90
	public ISDKBuildInfo getBuildInfo(String builderId) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
    91
		ISDKBuildInfo buildInfo = buildInfoMap.get(builderId);
1695
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
    92
		if (buildInfo == null) {
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
    93
			if (builderId.equals(ISymbianBuilderID.SBSV1_BUILDER)) {
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
    94
				buildInfo = createSBSv1BuildInfo();
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
    95
			} else if (builderId.equals(ISymbianBuilderID.SBSV2_BUILDER)) {
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
    96
				buildInfo = createSBSv2BuildInfo();
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
    97
			}
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
    98
		}
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
    99
		return buildInfo;
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   100
	}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   101
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   102
	public String getEPOCROOT() {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   103
		if (deviceEntry != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   104
			String epocRoot = deviceEntry.getEpocroot();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   105
			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   106
			if (epocRoot.length() > 2 && epocRoot.substring(1, 2).equals(":")){
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   107
				// make sure it's a full windows path...
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   108
				File resolvedEPOCROOT = new File(epocRoot);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   109
				try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   110
					// canonicalize the path so the case is correct
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   111
					// for URI lookups (e.g. for prebuilt indexes)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   112
					resolvedEPOCROOT = resolvedEPOCROOT.getCanonicalFile();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   113
					epocRoot = resolvedEPOCROOT.toString();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   114
				} catch (IOException e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   115
					// ignored...
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   116
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   117
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   118
			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   119
			int len = epocRoot.length();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   120
			if (len > 0 && epocRoot.charAt(len-1) != '\\' && epocRoot.charAt(len-1) != '/'){
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   121
				epocRoot += File.separator;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   122
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   123
			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   124
			return epocRoot;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   125
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   126
		return "";
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   127
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   128
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   129
	public IPath getIncludePath() {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   130
		String epocRoot = getEPOCROOT();
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   131
		if (epocRoot.length() > 0) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   132
			IPath epoc32IncPath = new Path(epocRoot).append("epoc32/include");
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   133
			// try to canonicalize it so it matches actual file system case
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   134
			try {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   135
				epoc32IncPath = new Path(epoc32IncPath.toFile().getCanonicalPath());
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   136
			} catch (IOException e) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   137
			}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   138
			return epoc32IncPath;
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   139
		}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   140
		return null;
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   141
	}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   142
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   143
	public Version getOSVersion() {		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   144
		if (osVersion == null){
1675
3af0516cfce5 make default OS version 9.5 if not found in SDK
timkelly
parents: 1667
diff changeset
   145
			return new Version("9.5");
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   146
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   147
		return osVersion;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   148
	}
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   149
1771
bd45dfd2e7ee Remove ISymbianSDK#getPrefixFile. You can get this from ISDKBuildInfo#getPrefixFromVariantCfg().
timkelly
parents: 1736
diff changeset
   150
//	public File getPrefixFile(String builderId) {
bd45dfd2e7ee Remove ISymbianSDK#getPrefixFile. You can get this from ISDKBuildInfo#getPrefixFromVariantCfg().
timkelly
parents: 1736
diff changeset
   151
//		File prefixFile = prefixFileMap.get(builderId);
bd45dfd2e7ee Remove ISymbianSDK#getPrefixFile. You can get this from ISDKBuildInfo#getPrefixFromVariantCfg().
timkelly
parents: 1736
diff changeset
   152
//		if (prefixFile == null) {
bd45dfd2e7ee Remove ISymbianSDK#getPrefixFile. You can get this from ISDKBuildInfo#getPrefixFromVariantCfg().
timkelly
parents: 1736
diff changeset
   153
//			ISDKBuildInfo buildInfo = getBuildInfo(builderId);
bd45dfd2e7ee Remove ISymbianSDK#getPrefixFile. You can get this from ISDKBuildInfo#getPrefixFromVariantCfg().
timkelly
parents: 1736
diff changeset
   154
//			if (buildInfo != null) {
bd45dfd2e7ee Remove ISymbianSDK#getPrefixFile. You can get this from ISDKBuildInfo#getPrefixFromVariantCfg().
timkelly
parents: 1736
diff changeset
   155
//				IPath prefixFilePath = buildInfo.getPrefixFromVariantCfg();
bd45dfd2e7ee Remove ISymbianSDK#getPrefixFile. You can get this from ISDKBuildInfo#getPrefixFromVariantCfg().
timkelly
parents: 1736
diff changeset
   156
//				if (prefixFilePath != null) {
bd45dfd2e7ee Remove ISymbianSDK#getPrefixFile. You can get this from ISDKBuildInfo#getPrefixFromVariantCfg().
timkelly
parents: 1736
diff changeset
   157
//					prefixFile = prefixFilePath.toFile();
bd45dfd2e7ee Remove ISymbianSDK#getPrefixFile. You can get this from ISDKBuildInfo#getPrefixFromVariantCfg().
timkelly
parents: 1736
diff changeset
   158
//					setPrefixFile(prefixFilePath, builderId);
bd45dfd2e7ee Remove ISymbianSDK#getPrefixFile. You can get this from ISDKBuildInfo#getPrefixFromVariantCfg().
timkelly
parents: 1736
diff changeset
   159
//				}
bd45dfd2e7ee Remove ISymbianSDK#getPrefixFile. You can get this from ISDKBuildInfo#getPrefixFromVariantCfg().
timkelly
parents: 1736
diff changeset
   160
//			}
bd45dfd2e7ee Remove ISymbianSDK#getPrefixFile. You can get this from ISDKBuildInfo#getPrefixFromVariantCfg().
timkelly
parents: 1736
diff changeset
   161
//		}
bd45dfd2e7ee Remove ISymbianSDK#getPrefixFile. You can get this from ISDKBuildInfo#getPrefixFromVariantCfg().
timkelly
parents: 1736
diff changeset
   162
//		return prefixFile;
bd45dfd2e7ee Remove ISymbianSDK#getPrefixFile. You can get this from ISDKBuildInfo#getPrefixFromVariantCfg().
timkelly
parents: 1736
diff changeset
   163
//	}
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   164
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   165
	public IPath getReleaseRoot() {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   166
		String epocRoot = getEPOCROOT();
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   167
		if (epocRoot.length() > 0) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   168
			IPath epoc32RelPath = new Path(epocRoot).append("epoc32/release");
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   169
			// try to canonicalize it so it matches actual file system case
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   170
			try {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   171
				epoc32RelPath = new Path(epoc32RelPath.toFile().getCanonicalPath());
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   172
			} catch (IOException e) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   173
			}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   174
			return epoc32RelPath;
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   175
		}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   176
		return null;
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   177
	}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   178
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   179
	@SuppressWarnings("rawtypes")
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   180
	public Set getSupportedFeatures() {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   181
		return sdkFeatures;
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   182
	}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   183
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   184
	public IPath getToolsPath() {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   185
		String epocRoot = getEPOCROOT();
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   186
		if (epocRoot.length() > 0) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   187
			IPath epoc32ToolsPath = new Path(epocRoot).append("epoc32/tools");
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   188
			// try to canonicalize it so it matches actual file system case
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   189
			try {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   190
				epoc32ToolsPath = new Path(epoc32ToolsPath.toFile().getCanonicalPath());
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   191
			} catch (IOException e) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   192
			}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   193
			return epoc32ToolsPath;
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   194
		}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   195
		return null;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   196
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   197
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   198
	public String getUniqueId() {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   199
		if (deviceEntry != null) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   200
			return deviceEntry.getId();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   201
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   202
		return "";
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   203
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   204
1736
ba74c19c6de3 fix bug 11762. Fix targettypes for MMP editor to retrieve properly depending on whether build config is SBsv1 or SBSv2.
timkelly
parents: 1710
diff changeset
   205
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   206
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   207
	public boolean isEnabled() {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   208
		if (!SDKCorePlugin.SUPPORTS_SBSV1_BUILDER && 
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   209
			(getOSVersion().getMajor() < 9 ||
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   210
			(getOSVersion().getMajor() == 9 && getOSVersion().getMinor() <= 4))){
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   211
			return false;
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   212
		}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   213
		return enabled;
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   214
	}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   215
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   216
	/**
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   217
	 * Remove single line C-style comments, multi-line C++-style comments and blank lines
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   218
	 */
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   219
	public static String removeComments(String aIntermediateContent) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   220
		// Strip out comments. There are uncovered cases here where this regex approach fails
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   221
		// when combining cpp and c style comments.
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   222
		String lNewline = "(\\r\\n|\\r|\\n)";
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   223
		
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   224
		// Note: we used to use the regex below for cpp comments (from  http://ostermiller.org/findcomment.html )
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   225
		//    String lCppStyleComments = "/\\*(?:.|[\\n\\r])*?\\*/"; 
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   226
		// but it throws StackOverFlowExceptions for large inputs
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   227
		//    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5050507
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   228
		// suggests that regex OR is the cause - therefore use dotall mode: (?s) instead
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   229
		
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   230
		String lCStyleComments = "(?m)//(.*)$";
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   231
		String lCppStyleComments = "(?s)/\\*.*?\\*/"; 
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   232
		String lBlankLines = "(?m)(^(\\s)*$"+lNewline+")+";
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   233
		aIntermediateContent = aIntermediateContent.replaceAll(lCStyleComments, "");
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   234
		aIntermediateContent = aIntermediateContent.replaceAll(lCppStyleComments, "");
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   235
		aIntermediateContent = aIntermediateContent.replaceAll(lBlankLines,"");
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   236
		return aIntermediateContent;
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   237
	}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   238
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   239
	public void scanSDK(){
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   240
		ISBSv1BuildInfo sbsv1BuildInfo = (ISBSv1BuildInfo)getBuildInfo(ISymbianBuilderID.SBSV1_BUILDER);
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   241
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   242
		sbsv1BuildInfo.clearPlatformMacros();
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   243
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   244
		if (!setDataFromManifestXML()){
1695
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
   245
			//need to scan SDK files for OS version
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   246
			scanSDKForVersionInfo();
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   247
		}
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   248
		
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   249
		setSupportFeatures();
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   250
	}
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   251
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   252
	public void setBuildInfo(ISDKBuildInfo buildInfo, String builderId) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   253
		buildInfoMap.put(builderId, buildInfo);
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   254
	}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   255
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   256
	public void setEnabled(boolean enable) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   257
		enabled = enable;
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   258
	}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   259
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   260
	public void setEPOCROOT(String epocRoot) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   261
		deviceEntry.setEpocroot(epocRoot);	
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   262
	}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   263
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   264
	public void setName(String name) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   265
		if (deviceEntry != null) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   266
			deviceEntry.setName(name);
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   267
		}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   268
	}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   269
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   270
	public void setOSVersion(Version osVer) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   271
		this.osVersion = osVer;
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   272
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   273
	
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   274
	public void setPrefixFile(IPath prefixFile, String builderId) {
1463
c435b58e283f fix NPE for finding variant.cfg when EPOCROOT does not exist
timkelly
parents: 1462
diff changeset
   275
		if (prefixFile == null)
c435b58e283f fix NPE for finding variant.cfg when EPOCROOT does not exist
timkelly
parents: 1462
diff changeset
   276
			return;
1695
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
   277
		File file = prefixFile.toFile();
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   278
		prefixFileMap.put(builderId, file);
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   279
	}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   280
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   281
	public void setUniqueId(String id) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   282
		deviceEntry.setId(id);
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   283
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   284
	
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   285
	/* (non-Javadoc)
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   286
	 * @see java.lang.Object#toString()
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   287
	 */
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   288
	@Override
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   289
	public String toString() {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   290
		return getUniqueId();
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   291
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   292
	
1695
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
   293
	private SBSv1BuildInfo createSBSv1BuildInfo() {
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
   294
		SBSv1BuildInfo buildInfo = new SBSv1BuildInfo(this);
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
   295
		setBuildInfo(buildInfo, ISymbianBuilderID.SBSV1_BUILDER);
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
   296
		return buildInfo;
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
   297
	}
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
   298
	
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
   299
	private SBSv2BuildInfo createSBSv2BuildInfo() {
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
   300
		SBSv2BuildInfo buildInfo = new SBSv2BuildInfo(this);
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
   301
		setBuildInfo(buildInfo, ISymbianBuilderID.SBSV2_BUILDER);
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
   302
		return buildInfo;
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
   303
	}
176858b7f249 Create buildinfo and prefix file on demand to improve performance.
stechong
parents: 1675
diff changeset
   304
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   305
	private boolean hasManifestXML(){
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   306
		File manifestXML = new File(deviceEntry.getEpocroot(), MANIFEST_XML_LOCATION);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   307
		if (manifestXML.exists()){
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   308
			return true;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   309
		} else {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   310
			return false;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   311
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   312
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   313
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   314
	/**
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   315
	 * Parses the epoc32\kit\manifest.xml file and add the relavant SDK information 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   316
	 * For a manifest to be properly mapped you need at minimum: epocRoot, id, and label filled out.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   317
	 */
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   318
	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   319
	private boolean processManifest(File manifestFile){
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   320
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   321
		boolean hasParseError = false;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   322
		Document doc = null;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   323
		// XML Valiation code from: http://java.sun.com/developer/technicalArticles/xml/validationxpath/
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   324
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   325
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   326
            // Parse an XML document into a DOM tree.
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   327
            DocumentBuilder parser =
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   328
                DocumentBuilderFactory.newInstance().newDocumentBuilder();
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   329
            doc = parser.parse(manifestFile);
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   330
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   331
            // Create a SchemaFactory capable of understanding WXS schemas.
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   332
            SchemaFactory factory =
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   333
                SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   334
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   335
            // Load a WXS schema, represented by a Schema instance.
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   336
            String tempStr = manifestFile.getAbsolutePath();
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   337
            int index = tempStr.lastIndexOf(File.separator);
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   338
            tempStr = tempStr.substring(0, index);
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   339
            tempStr += File.separator + "sdkManifest.xsd";
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   340
            Source schemaFile = new StreamSource(new File(tempStr));
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   341
            Schema schema = factory.newSchema(schemaFile);
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   342
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   343
            // Create a Validator object, which can be used to validate
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   344
            // an instance document.
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   345
            Validator validator = schema.newValidator();
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   346
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   347
            // Validate the DOM tree.
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   348
            // Don't use new DOMSource(doc) for manifest, that requires namespace 
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   349
            // and some (e.g. S60) manifest.xml says xsi:noNamespaceSchemaLocation.
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   350
            // Failure will show in Java 6
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   351
            // see detail in XERCESJ-1163 boog report
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   352
            // http://issues.apache.org/jira/browse/XERCESJ-1163?page=all 
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   353
            validator.validate(new StreamSource(manifestFile));
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   354
	
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   355
        } catch (ParserConfigurationException e) {
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   356
        	ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.getPluginId(), IStatus.ERROR, "SDK Manifest could not be parsed correctly.", e));
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   357
        	hasParseError = true;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   358
        } catch (SAXException e) {
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   359
        	ResourcesPlugin.getPlugin().getLog().log(new Status(IStatus.ERROR, SDKCorePlugin.getPluginId(), IStatus.ERROR, "SDK Manifest failed schema validation.", e));
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   360
        	hasParseError = true;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   361
        	// exception handling - document not valid!
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   362
        } catch (IOException e) {
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   363
        	// This SDK has not manifest, don't post error
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   364
        	hasParseError = true;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   365
        }       
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   366
			
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   367
		// if there were any parse errors, throw an exception so that suitable defaults
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   368
		// can be calculated from the devices.xml entry.
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   369
		if (hasParseError) {
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   370
			return false;
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   371
		}
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   372
		
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   373
		try {
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   374
			
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   375
			Node node = XPathAPI.selectSingleNode(doc, "sdk/paths");
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   376
			for (NodeIterator nodeIter = XPathAPI.selectNodeIterator(doc, "sdk"); (node = nodeIter.nextNode()) != null;) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   377
				NamedNodeMap attribs = node.getAttributes();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   378
				
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   379
				node = XPathAPI.selectSingleNode(doc, "sdk/paths/@root");
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   380
				String path = node == null ? null : node.getNodeValue();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   381
				if (null != path) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   382
					// make sure EPOCROOT is terminated with a path delimiter
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   383
					if (!path.endsWith(File.separator)) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   384
						path += File.separator;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   385
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   386
					// EPOCROOT is currently ignored.
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   387
					
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   388
					for (NodeIterator pathsNodeIter = XPathAPI.selectNodeIterator(doc, "sdk/paths/root"); (node = pathsNodeIter.nextNode()) != null;) 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   389
					{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   390
						// Loop through the sdk:paths:root elements and pick out check all the 'id' attriutes for matches...
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   391
						attribs = node.getAttributes();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   392
						String rootType = attribs.getNamedItem("id").getNodeValue();
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   393
						if (rootType.equals(PATH_ID_INCLUDEDIR)) {
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   394
							node = attribs.getNamedItem("path");
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   395
							/*if (null!=node){
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   396
								setIncludePath(new Path(path + node.getNodeName()));
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   397
							}*/
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   398
						} else if (rootType.equals(RELEASE)) {
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   399
							node = attribs.getNamedItem("path");
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   400
							/*if (null!=node){
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   401
								setReleaseRoot(new Path(path + node.getNodeName()));
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   402
							}*/
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   403
						} else if (rootType.equals(PATH_ID_TOOLSDIR)) {
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   404
							node = attribs.getNamedItem("path");
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   405
							/*if (null!=node){
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   406
								setToolsPath(new Path(path + node.getNodeName()));
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   407
							}*/
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   408
						} else if (rootType.equals(PATH_ID_SRCDIR)) {
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   409
							node = attribs.getNamedItem("path");
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   410
							/*if (null!=node){
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   411
								setSourcePath(new Path(path + node.getNodeName()));
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   412
							}*/
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   413
						}
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   414
					}
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   415
				}
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   416
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   417
				// Get the osInfo
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   418
				node = XPathAPI.selectSingleNode(doc, "sdk/osInfo");
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   419
				if (null != node){
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   420
					attribs = node.getAttributes();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   421
					node = attribs.getNamedItem("version");
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   422
					if (null != node)
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   423
					{
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   424
						try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   425
							setOSVersion(new Version(node.getNodeValue()));
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   426
						}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   427
						catch (IllegalArgumentException e){	
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   428
							// ignored...improper format
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   429
						}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   430
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   431
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   432
				
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   433
				//  Get the SDK Version...
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   434
				node = XPathAPI.selectSingleNode(doc, "sdk/sdkVersion");
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   435
				if (null != node) {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   436
					try {
1667
352fb86872dd remove ISymbianSDK: getSDKVersion(), getName() and related methods.
timkelly
parents: 1666
diff changeset
   437
						// ignored
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   438
					}
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   439
					catch (IllegalArgumentException e){	
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   440
						// ignored...improper format
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   441
					} 
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   442
				}				
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   443
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   444
		} catch (TransformerException e){
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   445
			e.printStackTrace();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   446
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   447
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   448
		return true;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   449
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   450
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   451
	/**
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   452
	 * Scans the SDK's epoc32\data\buildinfo.txt file and tries to build the Version
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   453
	 * and branch identifiers. This should not be called when a manifest.xml file exits
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   454
	 *
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   455
	 */
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   456
	private void scanSDKForVersionInfo(){
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   457
		File epocRoot = new File(getEPOCROOT());
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   458
		File bldInfoFile = new File(epocRoot, BUILD_INFO_TXT_FILE);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   459
		if (!bldInfoFile.exists())
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   460
			return;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   461
		
1410
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   462
		if (getOSVersion().getMajor() == 0)
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   463
			setOSVersion(new Version("9.5.0"));  // Set a default version that will work with all EKA2
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   464
		
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   465
		try {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   466
			char[] cbuf = new char[(int) bldInfoFile.length()];
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   467
			Reader reader = new FileReader(bldInfoFile);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   468
			reader.read(cbuf);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   469
			reader.close();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   470
			String[] lines = new String(cbuf).split("\r|\r\n|\n");
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   471
			for (int i = 0; i < lines.length; i++) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   472
				// skip comments and blank lines
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   473
				String line = removeComments(lines[i]);
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   474
				if (line.matches("\\s*#.*") || line.trim().length() == 0) 
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   475
					continue;
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   476
				
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   477
				line = line.trim();
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   478
				if (line.startsWith(BUILD_INFO_KEYWORD)){
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   479
					String[] versionTokens = line.split(" ");
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   480
					if (versionTokens.length == 3){
1410
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   481
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   482
						if (versionTokens[2].toUpperCase().contains("TB92SF")){
1138
352c0236f181 bug 10674. Sort sbsv2 configuration names with same platform_target alias prefix. ensure gcce error parser is used for sbsv2 GCCE4 build configs, add a project specific (sbsv2 only) edit box that allows user to append whatever they want to the -c parameter (the build alias). Also, fixed SDK support for TB kits now that TB92SF appears as a prefix rather than a suffix in the buildinfo.txt file.
timkelly
parents: 874
diff changeset
   483
							setOSVersion(new Version("9.5.0"));
352c0236f181 bug 10674. Sort sbsv2 configuration names with same platform_target alias prefix. ensure gcce error parser is used for sbsv2 GCCE4 build configs, add a project specific (sbsv2 only) edit box that allows user to append whatever they want to the -c parameter (the build alias). Also, fixed SDK support for TB kits now that TB92SF appears as a prefix rather than a suffix in the buildinfo.txt file.
timkelly
parents: 874
diff changeset
   484
							break;
1410
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   485
						} else if (versionTokens[2].toUpperCase().contains("TB101SF")){
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   486
							setOSVersion(new Version("9.6.0"));
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   487
							break;
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   488
						} else if (versionTokens[2].toUpperCase().contains("TB102SF")){
1138
352c0236f181 bug 10674. Sort sbsv2 configuration names with same platform_target alias prefix. ensure gcce error parser is used for sbsv2 GCCE4 build configs, add a project specific (sbsv2 only) edit box that allows user to append whatever they want to the -c parameter (the build alias). Also, fixed SDK support for TB kits now that TB92SF appears as a prefix rather than a suffix in the buildinfo.txt file.
timkelly
parents: 874
diff changeset
   489
							setOSVersion(new Version("9.6.0"));
352c0236f181 bug 10674. Sort sbsv2 configuration names with same platform_target alias prefix. ensure gcce error parser is used for sbsv2 GCCE4 build configs, add a project specific (sbsv2 only) edit box that allows user to append whatever they want to the -c parameter (the build alias). Also, fixed SDK support for TB kits now that TB92SF appears as a prefix rather than a suffix in the buildinfo.txt file.
timkelly
parents: 874
diff changeset
   490
							break;
352c0236f181 bug 10674. Sort sbsv2 configuration names with same platform_target alias prefix. ensure gcce error parser is used for sbsv2 GCCE4 build configs, add a project specific (sbsv2 only) edit box that allows user to append whatever they want to the -c parameter (the build alias). Also, fixed SDK support for TB kits now that TB92SF appears as a prefix rather than a suffix in the buildinfo.txt file.
timkelly
parents: 874
diff changeset
   491
						}
352c0236f181 bug 10674. Sort sbsv2 configuration names with same platform_target alias prefix. ensure gcce error parser is used for sbsv2 GCCE4 build configs, add a project specific (sbsv2 only) edit box that allows user to append whatever they want to the -c parameter (the build alias). Also, fixed SDK support for TB kits now that TB92SF appears as a prefix rather than a suffix in the buildinfo.txt file.
timkelly
parents: 874
diff changeset
   492
						else if (versionTokens[2].lastIndexOf("v") > 0){
352c0236f181 bug 10674. Sort sbsv2 configuration names with same platform_target alias prefix. ensure gcce error parser is used for sbsv2 GCCE4 build configs, add a project specific (sbsv2 only) edit box that allows user to append whatever they want to the -c parameter (the build alias). Also, fixed SDK support for TB kits now that TB92SF appears as a prefix rather than a suffix in the buildinfo.txt file.
timkelly
parents: 874
diff changeset
   493
							int index = versionTokens[2].lastIndexOf("v");
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   494
							String osVersionString = versionTokens[2].substring(index+1, versionTokens[2].length());
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   495
							
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   496
							// Set the version, split on alphanumeric to get rid of any junk at the end
1410
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   497
							String[] tempStr = osVersionString.split("[a-zA-Z_]");
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   498
							if (tempStr.length != 0){
1410
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   499
								try {
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   500
									setOSVersion(Version.parseVersion(tempStr[0]));
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   501
								} catch (Exception e) {
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   502
									// ignore, default version already set
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   503
									// just catch exception so we move along to the next SDK
575de035cb1e fix bug 11353 (uncaught exception when parsing version info from buildinfo.txt)
timkelly
parents: 1371
diff changeset
   504
								}
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   505
							}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   506
						}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   507
					}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   508
				}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   509
			}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   510
		} catch (IOException e) {
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   511
		}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   512
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   513
		
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   514
	}
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   515
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   516
	private boolean setDataFromManifestXML(){
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   517
		if (hasManifestXML()){
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   518
			
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   519
			if (processManifest(new File(deviceEntry.getEpocroot(), MANIFEST_XML_LOCATION))){
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   520
				return true;
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   521
			} else {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   522
				return false;
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   523
			}
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   524
			
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   525
		} else {
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   526
			return false;
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   527
		}
231
4885a40e8b9b fix bug 9032. Only scan SDKs for plugins once for an IDE configuration lifetime.
timkelly
parents: 189
diff changeset
   528
	}
4885a40e8b9b fix bug 9032. Only scan SDKs for plugins once for an IDE configuration lifetime.
timkelly
parents: 189
diff changeset
   529
	
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   530
	private void setSupportFeatures() {
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   531
		scanForWINSCW_UREL();
1861
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   532
		scanForWINSCW_UDEB();
1666
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   533
		scanForAvkon();
1462
b38491fd06da More ISymbianSDK refactoring.
stechong
parents: 1434
diff changeset
   534
		sdkFeatures.add(ISymbianSDKFeatures.IS_EKA2);
1434
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   535
	}
79471fd1fd69 First pass refactoring ISymbianSDK.
stechong
parents: 1418
diff changeset
   536
1666
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   537
	/**
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   538
	 * Check if avkon is a supported feature.
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   539
	 */
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   540
	private void scanForAvkon() {
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   541
		String armv5UDEBFullPathStr = getEPOCROOT();
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   542
		armv5UDEBFullPathStr += ARMV5_UDEB_DIR;
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   543
		IPath armv5UDEBPath = new Path(armv5UDEBFullPathStr);
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   544
		if (armv5UDEBPath != null && armv5UDEBPath.toFile().exists()){
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   545
			if (armv5UDEBPath.append("avkon.dll").toFile().exists()){
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   546
				sdkFeatures.add(ISymbianSDKFeatures.IS_AVKON_SUPPORTED);
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   547
				return;
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   548
			}
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   549
			// not there, check winscw
1892
2009dcd074b0 fix bug 11939
timkelly
parents: 1871
diff changeset
   550
			String winscwUDEBFullPathStr = getEPOCROOT();
2009dcd074b0 fix bug 11939
timkelly
parents: 1871
diff changeset
   551
			winscwUDEBFullPathStr += WINSCW_UDEB_DIR;
2009dcd074b0 fix bug 11939
timkelly
parents: 1871
diff changeset
   552
			IPath winscwURELPath = new Path(winscwUDEBFullPathStr);
1666
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   553
			if (winscwURELPath != null && winscwURELPath.toFile().exists()){
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   554
				if (winscwURELPath.append("avkon.dll").toFile().exists()){
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   555
					sdkFeatures.add(ISymbianSDKFeatures.IS_AVKON_SUPPORTED);
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   556
					return;
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   557
				}
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   558
			}
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   559
		}
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   560
	}
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   561
	
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   562
	/**
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   563
	 * Check to see whether or not we should support WINSCW UREL
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   564
	 */
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   565
	private void scanForWINSCW_UREL(){
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   566
		String winscwURELFullPathStr = getEPOCROOT();
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   567
		winscwURELFullPathStr += WINSCW_UREL_DIR;
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   568
		IPath winscwURELPath = new Path(winscwURELFullPathStr);
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   569
		if (winscwURELPath != null && winscwURELPath.toFile().exists()){
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   570
			if (winscwURELPath.append("epoc.exe").toFile().exists()){
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   571
				if (winscwURELPath.append("euser.dll").toFile().exists()){
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   572
					sdkFeatures.add(ISymbianSDKFeatures.IS_WINSCW_UREL_SUPPORTED);
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   573
				}
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   574
			}
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   575
		}
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   576
	}
5243d04d3917 fix 11553. For project template filtering, use feature fags. No longer us OS/SDK version or name attribute.
timkelly
parents: 1621
diff changeset
   577
1861
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   578
	/**
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   579
	 * Check to see whether or not we should support WINSCW UDEB
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   580
	 */
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   581
	private void scanForWINSCW_UDEB(){
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   582
		String winscwURELFullPathStr = getEPOCROOT();
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   583
		winscwURELFullPathStr += WINSCW_UDEB_DIR;
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   584
		IPath winscwURELPath = new Path(winscwURELFullPathStr);
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   585
		if (winscwURELPath != null && winscwURELPath.toFile().exists()){
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   586
			if (winscwURELPath.append("epoc.exe").toFile().exists()){
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   587
				if (winscwURELPath.append("euser.dll").toFile().exists()){
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   588
					sdkFeatures.add(ISymbianSDKFeatures.IS_WINSCW_UDEB_SUPPORTED);
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   589
				}
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   590
			}
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   591
		}
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   592
	}
b068cf1b44ee Added ISymbianSDKFeatures#IS_WINSCW_UDEB_SUPPORTED.
stechong
parents: 1779
diff changeset
   593
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
   594
}