Fix bug 11324. Prefer *.flm over *.mk/*.meta for the actual extension makefile driver files RCL_2_4
authorEd Swartz <ed.swartz@nokia.com>
Fri, 02 Jul 2010 09:32:59 -0500
branchRCL_2_4
changeset 1571 b1641b8ccefb
parent 1566 ab85ee3ba586
child 1573 660c89efde83
Fix bug 11324. Prefer *.flm over *.mk/*.meta for the actual extension makefile driver files
builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java
project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/views/SPNViewContentProvider.java
--- a/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java	Thu Jul 01 13:28:31 2010 -0500
+++ b/builder/com.nokia.carbide.cdt.builder/src/com/nokia/carbide/cdt/builder/EpocEngineHelper.java	Fri Jul 02 09:32:59 2010 -0500
@@ -199,14 +199,26 @@
 							BldInfViewPathHelper helper = new BldInfViewPathHelper(data, context);
 							for (IExtension extension : data.getExtensions()) {
 								IPath extensionMakefileBase = helper.convertExtensionTemplateToFilesystem(extension.getTemplatePath());
-								normalFiles.add(extensionMakefileBase.addFileExtension("mk")); //$NON-NLS-1$
+								IPath makefile = getControllingFile(extensionMakefileBase);
+								normalFiles.add(makefile);
 							}
 							for (IExtension extension : data.getTestExtensions()) {
 								IPath extensionMakefileBase = helper.convertExtensionTemplateToFilesystem(extension.getTemplatePath());
-								testFiles.add(extensionMakefileBase.addFileExtension("mk")); //$NON-NLS-1$
+								IPath makefile = getControllingFile(extensionMakefileBase);
+								normalFiles.add(makefile);
 							}
 							return null;
 						}
+						private IPath getControllingFile(IPath extensionMakefileBase) {
+							IPath candidate = extensionMakefileBase.addFileExtension("mk"); //$NON-NLS-1$
+							if (candidate.toFile().exists())
+								return candidate;
+							if ("export".equals(extensionMakefileBase.getFileExtension())) //$NON-NLS-1$
+								candidate = extensionMakefileBase.removeFileExtension().addFileExtension("flm"); //$NON-NLS-1$
+							else
+								candidate = extensionMakefileBase.addFileExtension("flm"); //$NON-NLS-1$
+							return candidate;
+						}
 				});
 
 			monitor.worked(1);
--- a/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/views/SPNViewContentProvider.java	Thu Jul 01 13:28:31 2010 -0500
+++ b/project/com.nokia.carbide.cpp.project.ui/src/com/nokia/carbide/cpp/internal/project/ui/views/SPNViewContentProvider.java	Fri Jul 02 09:32:59 2010 -0500
@@ -867,12 +867,24 @@
 									visitedPaths.add(baseExtensionMakefilePath);
 									
 									IPath extensionMakefilePath = baseExtensionMakefilePath.addFileExtension("mk");
-									IPath extensionMetaPath = baseExtensionMakefilePath.addFileExtension("meta");
-
-									addBldInfExtensionMakefile(objects, project, cpi, view,
-											extensionMakefilePath);
-									addBldInfExtensionMakefile(objects, project, cpi, view,
-											extensionMetaPath);
+									
+									if (extensionMakefilePath.toFile().exists()) {
+										// old-style
+										IPath extensionMetaPath = baseExtensionMakefilePath.addFileExtension("meta");
+										addBldInfExtensionMakefile(objects, project, cpi, view,
+												extensionMakefilePath);
+										addBldInfExtensionMakefile(objects, project, cpi, view,
+												extensionMetaPath);
+									} else {
+										// new-style (default for the future)
+										IPath flmMakefilePath;
+										if ("export".equals(baseExtensionMakefilePath.getFileExtension()))
+											flmMakefilePath = baseExtensionMakefilePath.removeFileExtension().addFileExtension("flm");
+										else
+											flmMakefilePath = baseExtensionMakefilePath.addFileExtension("flm");
+										addBldInfExtensionMakefile(objects, project, cpi, view,
+												flmMakefilePath);
+									}
 								}
 								return null;
 							}