author | timkelly |
Mon, 19 Apr 2010 11:38:03 -0500 | |
branch | RCL_2_4 |
changeset 1240 | be20b442a60b |
parent 1222 | 63523a35c9b2 |
child 1267 | f47181a17fe4 |
permissions | -rw-r--r-- |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
1 |
/* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
8 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
11 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
12 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
13 |
package com.nokia.carbide.cpp.internal.api.sdk; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
14 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
15 |
import java.io.File; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
16 |
import java.io.FileFilter; |
1240
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
17 |
import java.text.MessageFormat; |
787
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
18 |
import java.util.ArrayList; |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
19 |
import java.util.Collections; |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
20 |
import java.util.Comparator; |
1147 | 21 |
import java.util.HashMap; |
22 |
import java.util.Iterator; |
|
787
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
23 |
import java.util.List; |
1147 | 24 |
import java.util.Map; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
25 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
26 |
import javax.xml.parsers.DocumentBuilder; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
27 |
import javax.xml.parsers.DocumentBuilderFactory; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
28 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
29 |
import org.eclipse.cdt.utils.spawner.EnvironmentReader; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
30 |
import org.eclipse.core.filesystem.URIUtil; |
787
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
31 |
import org.eclipse.core.runtime.IPath; |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
32 |
import org.eclipse.core.runtime.Path; |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
33 |
import org.eclipse.core.runtime.Preferences; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
34 |
import org.osgi.framework.Version; |
787
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
35 |
import org.w3c.dom.Element; |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
36 |
import org.w3c.dom.Node; |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
37 |
import org.w3c.dom.NodeList; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
38 |
import org.xml.sax.InputSource; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
39 |
import org.xml.sax.helpers.DefaultHandler; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
40 |
|
787
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
41 |
import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
42 |
import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
43 |
import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; |
176 | 44 |
import com.nokia.cpp.internal.api.utils.core.FileUtils; |
45 |
import com.nokia.cpp.internal.api.utils.core.Logging; |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
46 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
47 |
/** |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
48 |
* Utility class for SBSv2 |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
49 |
* @since 2.0 |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
50 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
51 |
public class SBSv2Utils { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
52 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
53 |
private static final String SBSV2_FILTERED_CONFIGS_STORE = "sbsv2FilteredConfigs"; //$NON-NLS-1$ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
54 |
private static final String SBSV2_FILTERED_CONFIGS_DELIMETER = ";"; //$NON-NLS-1$ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
55 |
|
1240
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
56 |
/** Path, to and including the SBS script */ |
787
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
57 |
protected static IPath sbsPath; |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
58 |
|
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
59 |
private static boolean scannedSbsState = false; |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
60 |
private static final String sbsScriptName = "sbs.bat"; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
61 |
|
1147 | 62 |
/** Map of usable Raptor alias for -c parameter and base platform: <alias, base plat> */ |
63 |
private static Map<String, String> unfilteredSBSv2ConfigNames; |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
64 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
65 |
/** |
1240
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
66 |
* Get the path to the SBSv2 bin directory. not including the sbs executable. |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
67 |
* May or may not actually exist. |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
68 |
* @return absolute path to the bin directory, or null if sbs is not set |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
69 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
70 |
public static IPath getSBSBinDirectory() { |
1240
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
71 |
String pathValue = EnvironmentReader.getEnvVar("PATH"); //$NON-NLS-1$ |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
72 |
IPath sbs = HostOS.findProgramOnPath(sbsScriptName, pathValue); |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
73 |
if (sbs != null){ |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
74 |
sbs = sbs.removeLastSegments(1); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
75 |
} |
1240
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
76 |
return sbs; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
77 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
78 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
79 |
/** |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
80 |
* Get the build configurations supported by SBSv2 |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
81 |
* @param refreshList whether or not to parse the configuration xml files again |
1147 | 82 |
* @return A map of raptor aliases (key) to base build platform. Never null; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
83 |
*/ |
1147 | 84 |
public static Map<String, String> getUnfilteredSBSv2BuildConfigurations(boolean refreshList) { |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
85 |
|
1240
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
86 |
if (unfilteredSBSv2ConfigNames == null || refreshList || unfilteredSBSv2ConfigNames.size() == 0) { |
1147 | 87 |
unfilteredSBSv2ConfigNames = new HashMap<String, String>(); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
88 |
|
1240
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
89 |
// parse the xml files in <sbs-install>/lib/config/ to get SBSv2 configs |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
90 |
try { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
91 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
92 |
IPath configPath = getSBSBinDirectory(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
93 |
if (configPath != null) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
94 |
configPath = configPath.removeLastSegments(1).append("lib/config"); //$NON-NLS-1$ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
95 |
File configDir = configPath.toFile(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
96 |
if (configDir.exists() && configDir.isDirectory()) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
97 |
File[] configFiles = FileUtils.listFilesInTree(configDir, new FileFilter() { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
98 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
99 |
public boolean accept(File arg0) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
100 |
if (arg0.isDirectory()) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
101 |
return true; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
102 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
103 |
return arg0.getName().toLowerCase().endsWith("xml"); //$NON-NLS-1$ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
104 |
} |
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 |
}, false); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
107 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
108 |
for (File file : configFiles) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
109 |
getConfigsForFile(file); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
110 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
111 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
112 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
113 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
114 |
} catch (Exception e) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
115 |
e.printStackTrace(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
116 |
Logging.log(SDKCorePlugin.getDefault(), Logging.newStatus(SDKCorePlugin.getDefault(), e)); |
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 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
120 |
return unfilteredSBSv2ConfigNames; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
121 |
} |
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 |
* Given a list of SDKs, returns the list of the SDK's supported by SBSv2 |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
125 |
* @param sdks list of SDK's to check |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
126 |
* @return list of SBSv2 supported SDK's, may be empty |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
127 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
128 |
public static List<ISymbianSDK> getSupportedSDKs(List<ISymbianSDK> sdks) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
129 |
List<ISymbianSDK> supportedSDKs = new ArrayList<ISymbianSDK>(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
130 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
131 |
//TODO need a better way to do this from Symbian. |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
132 |
// For now, just filter out anything older than 9.4 |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
133 |
for (ISymbianSDK sdk : sdks) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
134 |
Version osVersion = sdk.getOSVersion(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
135 |
if (osVersion.getMajor() > 8 && osVersion.getMinor() > 3) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
136 |
supportedSDKs.add(sdk); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
137 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
138 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
139 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
140 |
return supportedSDKs; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
141 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
142 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
143 |
/** |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
144 |
* Returns the list of SBSv2 build configuration names that should |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
145 |
* be filtered out of any UI |
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 |
public static String[] getSBSv2ConfigurationsToFilter() { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
148 |
Preferences prefs = SDKCorePlugin.getDefault().getPluginPreferences(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
149 |
if (prefs != null) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
150 |
String configs = prefs.getString(SBSV2_FILTERED_CONFIGS_STORE); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
151 |
return configs.split(SBSV2_FILTERED_CONFIGS_DELIMETER); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
152 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
153 |
return new String[0]; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
154 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
155 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
156 |
/** |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
157 |
* Set the list of SBSv2 build configurations that should be filtered |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
158 |
* out of any UI |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
159 |
* @param configs configs to be filtered |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
160 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
161 |
public static void setSBSv2ConfigurationsToFilter(String[] configs) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
162 |
Preferences prefs = SDKCorePlugin.getDefault().getPluginPreferences(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
163 |
if (prefs != null) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
164 |
String store = ""; //$NON-NLS-1$ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
165 |
for (String config : configs) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
166 |
store = store + SBSV2_FILTERED_CONFIGS_DELIMETER + config; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
167 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
168 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
169 |
// remove the leading delimeter |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
170 |
if (store.length() > 0) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
171 |
store = store.substring(1); |
266
c7ecdd0b9f52
Fix bug 9310. Fix save problem with Platform Filter Prefs (sbsv2) and add Restore / Apply buttons.
timkelly
parents:
176
diff
changeset
|
172 |
} |
c7ecdd0b9f52
Fix bug 9310. Fix save problem with Platform Filter Prefs (sbsv2) and add Restore / Apply buttons.
timkelly
parents:
176
diff
changeset
|
173 |
if (store.length() >= 0){ |
c7ecdd0b9f52
Fix bug 9310. Fix save problem with Platform Filter Prefs (sbsv2) and add Restore / Apply buttons.
timkelly
parents:
176
diff
changeset
|
174 |
// lenght of zero means there are not configs to filter (or show them all) |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
175 |
prefs.setValue(SBSV2_FILTERED_CONFIGS_STORE, store); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
176 |
SDKCorePlugin.getDefault().savePluginPreferences(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
177 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
178 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
179 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
180 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
181 |
/** |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
182 |
* Gets the list of SBSv2 build contexts for the given SDK |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
183 |
* @param sdk the SDK to get the build contexts for |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
184 |
* @return the list of SBSv2 build contexts. the list may be empty |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
185 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
186 |
public static List<ISymbianBuildContext> getFilteredSBSv2BuildContexts(ISymbianSDK sdk) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
187 |
List<ISymbianBuildContext> contexts = new ArrayList<ISymbianBuildContext>(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
188 |
|
1147 | 189 |
Iterator it = getUnfilteredSBSv2BuildConfigurations(false).entrySet().iterator(); |
190 |
while (it.hasNext()){ |
|
191 |
Map.Entry buildConfigPair = (Map.Entry)it.next(); |
|
192 |
String alias = (String)buildConfigPair.getKey(); // The sbsv2 alias |
|
193 |
String basePlat = (String)buildConfigPair.getValue(); |
|
194 |
||
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
195 |
boolean addConfig = true; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
196 |
for (String filteredConfig : getSBSv2ConfigurationsToFilter()) { |
1147 | 197 |
if (filteredConfig.compareTo(alias) == 0) { |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
198 |
addConfig = false; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
199 |
break; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
200 |
} |
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 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
203 |
if (addConfig) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
204 |
// only support configs that fall into something we can make a build context |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
205 |
// out of. They must have a platform and a target. |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
206 |
String targetString = null; |
1147 | 207 |
String[] configTokens = alias.split("_"); // $//$NON-NLS-N$ |
208 |
// We presume that aliases have the second token as the "target". |
|
209 |
if (configTokens[1].toLowerCase().endsWith("deb")) { //$NON-NLS-1$ |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
210 |
targetString = ISymbianBuildContext.DEBUG_TARGET; |
1147 | 211 |
} else if (configTokens[1].toLowerCase().endsWith("rel")) { //$NON-NLS-1$ |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
212 |
targetString = ISymbianBuildContext.RELEASE_TARGET; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
213 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
214 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
215 |
if (targetString != null) { |
1147 | 216 |
|
217 |
SymbianBuildContext context = null; |
|
218 |
context = new SymbianBuildContext(sdk, basePlat, targetString, alias); |
|
219 |
if (context != null) |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
220 |
contexts.add(context); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
221 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
222 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
223 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
224 |
|
1147 | 225 |
return sortContexts(contexts); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
226 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
227 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
228 |
/** |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
229 |
* Whether or not to display SBSv2 builder UI |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
230 |
* @return true if SBSv2 is installed, false otherwise |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
231 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
232 |
public static boolean enableSBSv2Support() { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
233 |
IPath sbsBinPath = getSBSBinDirectory(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
234 |
if (sbsBinPath != null && sbsBinPath.toFile().exists()) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
235 |
return true; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
236 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
237 |
return false; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
238 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
239 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
240 |
private static void getConfigsForFile(File file) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
241 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
242 |
try { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
243 |
Element root = null; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
244 |
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
245 |
parser.setErrorHandler(new DefaultHandler()); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
246 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
247 |
InputSource source = new InputSource(URIUtil.toURI(file.getAbsolutePath()).getPath()); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
248 |
root = parser.parse(source).getDocumentElement(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
249 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
250 |
NodeList children = root.getChildNodes(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
251 |
for (int i=0; i< children.getLength(); i++) { |
1147 | 252 |
getConfigsForNode(children.item(i), root); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
253 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
254 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
255 |
} catch (Exception e) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
256 |
e.printStackTrace(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
257 |
Logging.log(SDKCorePlugin.getDefault(), Logging.newStatus(SDKCorePlugin.getDefault(), e)); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
258 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
259 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
260 |
|
1147 | 261 |
private static void getConfigsForNode(Node node, Node parentNode) { |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
262 |
if (node.getNodeName().equals("config")) { //$NON-NLS-1$ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
263 |
Node abstractNode = node.getAttributes().getNamedItem("abstract"); //$NON-NLS-1$ |
1147 | 264 |
Node namedNode = node.getAttributes().getNamedItem("name"); //$NON-NLS-1$ |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
265 |
if (abstractNode == null || abstractNode.getNodeValue().equals("false")) { //$NON-NLS-1$ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
266 |
if (namedNode != null) { |
1147 | 267 |
|
268 |
// Get the parent base build platform |
|
269 |
String baseBuildPlatform = null; |
|
270 |
if (parentNode != null){ |
|
1181 | 271 |
baseBuildPlatform = parentNode.getAttributes().getNamedItem("name").getNodeValue(); |
272 |
if (baseBuildPlatform.split("_").length > 1){ |
|
273 |
baseBuildPlatform = baseBuildPlatform.split("_")[0]; |
|
274 |
} |
|
1147 | 275 |
} |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
276 |
// only support configs that fall into something we can make a build context |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
277 |
// out of. They must have a platform and a target. |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
278 |
String configName = namedNode.getNodeValue(); |
1147 | 279 |
String[] configTokens = configName.split("_"); |
280 |
if (configTokens.length >= 2) { //$NON-NLS-1$ |
|
281 |
String target = configTokens[1]; |
|
282 |
if (target.endsWith("deb") || target.endsWith("rel")){ //$NON-NLS-1$ |
|
283 |
if (baseBuildPlatform == null){ |
|
284 |
baseBuildPlatform = "unknown"; |
|
285 |
} |
|
286 |
unfilteredSBSv2ConfigNames.put(configName, baseBuildPlatform); |
|
287 |
} |
|
288 |
} |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
289 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
290 |
} |
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 |
NodeList children = node.getChildNodes(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
293 |
for (int i=0; i< children.getLength(); i++) { |
1147 | 294 |
getConfigsForNode(children.item(i), node); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
295 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
296 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
297 |
} |
787
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
298 |
|
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
299 |
/** |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
300 |
* (Re-)scan the SBSv2 / Raptor configuration |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
301 |
* @return message if error, else null |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
302 |
**/ |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
303 |
public static String scanSBSv2() { |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
304 |
// do some basic checks |
1240
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
305 |
if (sbsPath != null){ |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
306 |
return null; |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
307 |
} |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
308 |
IPath expectedPath = getSBSBinDirectory(); |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
309 |
if (expectedPath != null) { |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
310 |
expectedPath = expectedPath.append(sbsScriptName); |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
311 |
if (expectedPath.toFile().exists()) { |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
312 |
sbsPath = expectedPath; |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
313 |
} |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
314 |
} |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
315 |
if (sbsPath == null) { |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
316 |
return MessageFormat.format(Messages |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
317 |
.getString("SBSv2Utils.CannotFindSBSScriptError"), //$NON-NLS-1$ |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
318 |
sbsScriptName); |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
319 |
} |
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
320 |
|
787
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
321 |
return null; |
1240
be20b442a60b
Fix bug 11022. Get rid of dependency on SBS_HOME.
timkelly
parents:
1222
diff
changeset
|
322 |
} |
787
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
323 |
|
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
324 |
/** |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
325 |
* Get the path to SBSv2 (sbs.bat or sbs) |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
326 |
**/ |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
327 |
public static IPath getSBSPath() { |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
328 |
if (!scannedSbsState) { |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
329 |
scanSBSv2(); |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
330 |
scannedSbsState = true; |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
331 |
} |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
332 |
return sbsPath != null ? sbsPath : new Path(sbsScriptName); |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
333 |
} |
f90a80bff752
Fix bug 10467. Raptor startup issues when raptor crashes or hangs.
timkelly
parents:
266
diff
changeset
|
334 |
|
1147 | 335 |
private static List<ISymbianBuildContext> sortContexts(List<ISymbianBuildContext> contexts){ |
336 |
||
337 |
// 3 sorting stages to handle long Raptor aliases, and multiple aliases that have a similar platform and target prefix (e.g. armv5_urel) |
|
338 |
||
339 |
Collections.sort(contexts, new Comparator<ISymbianBuildContext>() { |
|
340 |
||
341 |
// First sort the target name (Debug / Release) and push Emulation to the top |
|
342 |
public int compare(ISymbianBuildContext o1, ISymbianBuildContext o2) { |
|
343 |
String sbsAlias1 = o1.getSBSv2Alias(); |
|
344 |
String sbsAlias2 = o2.getSBSv2Alias(); |
|
345 |
||
346 |
if (o1.getPlatformString().equals(o2.getPlatformString())) { |
|
347 |
if (o1.getSBSv2Alias().split("_").length == 2 && o2.getSBSv2Alias().split("_").length == 2) |
|
348 |
return o1.getTargetString().compareTo(o2.getTargetString()); |
|
349 |
else if (sbsAlias1.split("_").length >= 3 && sbsAlias1.split("_").length >= 3) |
|
350 |
return 1; |
|
351 |
} else { |
|
352 |
if (sbsAlias1.toUpperCase().startsWith(ISymbianBuildContext.EMULATOR_PLATFORM)) { |
|
353 |
return -1; |
|
354 |
}else if (sbsAlias2.toUpperCase().startsWith(ISymbianBuildContext.EMULATOR_PLATFORM)) { |
|
355 |
return 1; |
|
356 |
} |
|
357 |
} |
|
358 |
return sbsAlias1.compareTo(sbsAlias2); |
|
359 |
||
360 |
} |
|
361 |
||
362 |
}); |
|
363 |
||
364 |
// Sort long alias names |
|
365 |
Collections.sort(contexts, new Comparator<ISymbianBuildContext>() { |
|
366 |
||
367 |
public int compare(ISymbianBuildContext o1, ISymbianBuildContext o2) { |
|
368 |
String sbsAlias1 = o1.getSBSv2Alias(); |
|
369 |
String sbsAlias2 = o2.getSBSv2Alias(); |
|
370 |
||
371 |
if (sbsAlias1.split("_").length >= 3 && sbsAlias1.split("_").length >= 3 && !sbsAlias1.equals(sbsAlias2)){ |
|
372 |
String temp1[] = sbsAlias1.split("_"); |
|
373 |
String temp2[] = sbsAlias2.split("_"); |
|
374 |
String suffix1 = ""; |
|
375 |
String suffix2 = ""; |
|
376 |
for (int i = 2; i < temp1.length; i++){ |
|
377 |
suffix1 += temp1[i] + "_"; |
|
378 |
} |
|
379 |
||
380 |
for (int i = 2; i < temp2.length; i++){ |
|
381 |
suffix2 += temp2[i] + "_"; |
|
382 |
} |
|
383 |
||
384 |
return suffix1.compareTo(suffix2); |
|
385 |
} |
|
386 |
||
387 |
return 0; |
|
388 |
} |
|
389 |
}); |
|
390 |
||
391 |
// Sort the target string for long aliases |
|
392 |
Collections.sort(contexts, new Comparator<ISymbianBuildContext>() { |
|
393 |
||
394 |
public int compare(ISymbianBuildContext o1, ISymbianBuildContext o2) { |
|
395 |
String sbsAlias1 = o1.getSBSv2Alias(); |
|
396 |
String sbsAlias2 = o2.getSBSv2Alias(); |
|
397 |
String temp1[] = sbsAlias1.split("_"); |
|
398 |
String temp2[] = sbsAlias2.split("_"); |
|
399 |
String suffix1 = ""; |
|
400 |
String suffix2 = ""; |
|
401 |
for (int i = 2; i < temp1.length; i++){ |
|
402 |
suffix1 += temp1[i] + "_"; |
|
403 |
} |
|
404 |
||
405 |
for (int i = 2; i < temp2.length; i++){ |
|
406 |
suffix2 += temp2[i] + "_"; |
|
407 |
} |
|
408 |
||
409 |
if (sbsAlias1.split("_").length >= 3 && sbsAlias1.split("_").length >= 3 && suffix1.equals(suffix2)){ |
|
410 |
return o1.getTargetString().compareTo(o2.getTargetString()); |
|
411 |
} |
|
412 |
||
413 |
return 0; |
|
414 |
} |
|
415 |
}); |
|
416 |
||
417 |
return contexts; |
|
418 |
} |
|
419 |
||
1222
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
420 |
/** |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
421 |
* If a variant is defined and it changes the output directory, return the directory name. |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
422 |
* For example, armv5_udeb.phone1 would return '.phone1'. If not variant that changes the release tree, then null |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
423 |
* NOTE: This method deals with variant text applied to the end of a build alias, specifically testing for |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
424 |
* variant text defined in the SBSv2 Build Configuration tab. |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
425 |
* @return null if not a variant or the value to append to the platform release tree directory |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
426 |
* @see com.nokia.carbide.cdt.internal.builder.ui#SBSv2BuildConfigTab |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
427 |
*/ |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
428 |
public static String getVariantOutputDirModifier(String variantText) { |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
429 |
|
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
430 |
String[] ignoredVariants = { "generic", "tracecompiler", "trace", "test", "savespace", |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
431 |
"bfc", "smp", "rvct2_2", "rvct4_0", "rvct3_1", "gcce4_3_2", "remove_freeze" }; |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
432 |
|
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
433 |
String newOutputDir = null; |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
434 |
if (variantText != null && variantText.length() > 1){ |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
435 |
String[] variantTok = variantText.split("\\."); |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
436 |
if (variantTok.length > 1){ |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
437 |
for (String ignore : ignoredVariants){ |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
438 |
if (variantTok[1].toLowerCase().equals(ignore)) |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
439 |
return null; |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
440 |
} |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
441 |
newOutputDir = "." + variantTok[1]; |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
442 |
} |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
443 |
} |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
444 |
return newOutputDir; |
63523a35c9b2
fix bug 11068. make sbsv2 variant appender configuration specific
timkelly
parents:
1181
diff
changeset
|
445 |
} |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
446 |
} |