carbidesdk/com.nokia.carbide.cpp.sdk.doc.user/html/tasks/sdk_getinfmmpinfo.htm
author fturovic <frank.turovich@nokia.com>
Tue, 27 Jul 2010 15:28:19 -0500
changeset 1704 24ac5a5cf80c
parent 0 fb279309251b
permissions -rw-r--r--
updated copyright dates and fixed some css issues
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1704
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     2
<html xmlns="http://www.w3.org/1999/xhtml">
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     3
<head>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     4
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     5
<title>Retrieving INF/MMP Project Information</title>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     6
<link rel="StyleSheet" href="../../book.css" type="text/css"/>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     7
</head>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     8
<body bgcolor="#FFFFFF">
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     9
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    10
<h2>Retrieving INF/MMP Project Information</h2>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    11
<p>All Carbide build stages, with the exception of the post-link SIS Builder   stage get their data from INF and MMP files. So naturally Carbide needs a way to   retrieve and store this data for doing things like setting up the source indexer   and displaying the visual INF and MMP editors. The com.nokia.carbide.cdt.builder.<STRONG>EpocEngineHelper</STRONG> class is a good first stop to retrieve this information. For example, if you want   to get all the source files in the first MMP file:</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    12
<p class="listing">// ...assumes ICarbideProjectInformation (cpi) is known.<br>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    13
  List&lt;IPath&gt; mmpPaths = EpocEngineHelper.getMMPFilesForProject(cpi);<br>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    14
// array length check omitted for brevity....<br>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    15
List&lt;IPath&gt; srcFilesTest = EpocEngineHelper.getSourceFilesForConfiguration(defultConfig, mmpPaths.get(0));</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    16
<h3>SDK Management</h3>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    17
<p>Each SDK entry in devices.xml is analogous to a   com.nokia.carbide.cpp.sdk.core.<STRONG>ISymbianSDK</STRONG> object. If you want to get the entire list of ISymbianSDK   objects (same list and properties from the SDK Preferences page) you   simply invoke:</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    18
<p class="listing">ISDKManager sdkMgr = SDKCorePlugin.getSDKManager();<br>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    19
List&lt;ISymbianSDK&gt; sdkList = sdkMgr.getSDKList();</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    20
<p>Now you can iterate the list and get whatever information you want out of the   installed SDKs. For example, using Java 5 iterators we can get the EPOCROOT   values of all the SDKs:</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    21
<p class="listing">for (ISymbianSDK currSDK : sdkList){
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    22
   <br>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    23
  &nbsp;&nbsp;&nbsp;&nbsp;String epocRootStr = currSDK.getEPOCROOT();<br>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    24
}</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    25
<h3>Reading MMP Statements with the EpocEngine and IMMPData</h3>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    26
<p>This topic demonstrates how you can read the MMP data for any build   configuration (ICarbideBuildConfiguration). The main interface for retrieving   MMP data is <strong>com.nokia.carbide.cpp.epoc.engine.model.mmp.IMMPData</strong>. Once you get   access to this interface you can learn anything you want about a particular MMP file.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    27
<p><strong>Prerequisite:</strong> All MMP and bld.inf parsing requires a dependency to the plugin   <strong>com.nokia.carbide.cpp.epoc.engine</strong>.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    28
<p>Typically most keywords of interest are either single string settings   (TARGETTYPE, TARGET, EPOCSTACKSIZE) or list of settings (MACRO, CAPABILITY,   LANG). Other types can be directly retrieved from IMMPData routines. Check the   API documentation for specifics.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    29
<p>The example provided simply iterates through all the MMP files of a   particular build configuration and grabs a list value and single item setting.   You'll need to get the particular MMP file you are interested in. Play around   with the IMMPData object in the run method and you can quickly get the idea.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    30
<PRE class="listing">// Assumes buildConfig (ICarbideBuildConfiguration) is known
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    31
for (IPath mmpPath : EpocEngineHelper.getMMPFilesForBuildConfiguration(buildConfig)) {
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    32
     Object data = EpocEnginePlugin.runWithMMPData(mmpPath,  new
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    33
                              DefaultMMPViewConfiguration(buildConfig.getCarbideProject().getProject(),
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    34
                              buildConfig, new AcceptedNodesViewFilter()),  new MMPDataRunnableAdapter() {
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    35
                        public Object run(IMMPData mmpData) {
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    36
                          // Example, getting a keyword as a list of strings
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    37
                          List macros = mmpData.getListArgumentSettings().get(EMMPStatement.MACRO);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    38
                          // The real return value, getting a single argument setting
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    39
                         return mmpData.getSingleArgumentSettings().get(EMMPStatement.TARGETTYPE);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    40
		  	                }   
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    41
      });
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    42
// Make sure to test for and cast to proper Object type!
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    43
String mmpStatement = (String)data;  // Now we should have the TARGETTYPE
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    44
}</PRE>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    45
<div id="footer">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div></div>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    46
</body>
0
fb279309251b DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff changeset
    47
</html>