# HG changeset patch # User wpaul # Date 1274708807 18000 # Node ID ce1819266def84d915869eff9813f646c5f56ab9 # Parent f19bf50481c7a376ac033edc0551e8a951dc2989 removed the old project updater. diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/META-INF/MANIFEST.MF --- a/project/com.nokia.carbide.cpp.project.core/META-INF/MANIFEST.MF Mon May 24 08:44:13 2010 -0500 +++ b/project/com.nokia.carbide.cpp.project.core/META-INF/MANIFEST.MF Mon May 24 08:46:47 2010 -0500 @@ -16,7 +16,6 @@ com.nokia.carbide.cpp.epoc.engine, com.nokia.carbide.cpp.sdk.core, com.nokia.carbide.templatewizard, - com.nokia.carbide.updater, org.eclipse.cdt.managedbuilder.core, org.eclipse.jface, org.eclipse.core.filesystem, diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/plugin.xml --- a/project/com.nokia.carbide.cpp.project.core/plugin.xml Mon May 24 08:44:13 2010 -0500 +++ b/project/com.nokia.carbide.cpp.project.core/plugin.xml Mon May 24 08:46:47 2010 -0500 @@ -45,35 +45,6 @@ - - - - - - - - - - - - - - - - - - - - - diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/AbstractUpdateTrigger.java --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/AbstractUpdateTrigger.java Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -package com.nokia.carbide.cpp.internal.project.core.updater; - -import com.nokia.carbide.cpp.project.core.ProjectCorePlugin; -import com.nokia.carbide.updater.extension.IUpdateTrigger.UpdateType; - -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.QualifiedName; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; - -public abstract class AbstractUpdateTrigger { - - private static final String INTRO_VIEW = "org.eclipse.ui.internal.introview"; //$NON-NLS-1$ - protected static final String CARBIDE_PERSPECTIVE_ID = "com.nokia.carbide.cpp.CarbideCppPerspective"; //$NON-NLS-1$ - - private QualifiedName key; - - protected abstract String getLocalKey(); - protected abstract String getTriggerProperty(); - protected abstract void postTriggerAction(); - - public void writeProperty() { - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - try { - if (key == null) - key = new QualifiedName(ProjectCorePlugin.PLUGIN_ID, getLocalKey()); - workspaceRoot.setPersistentProperty(key, getTriggerProperty()); - } - catch (CoreException e) { - System.out.println(e.getMessage()); - } - } - - public boolean workspaceNeedsUpdate(UpdateType type) { - if (type == UpdateType.FILE) - return false; - - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - try { - if (key == null) - key = new QualifiedName(ProjectCorePlugin.PLUGIN_ID, getLocalKey()); - String string = workspaceRoot.getPersistentProperty(key); - if (string != null && string.equals(getTriggerProperty())) { - return false; - } - } - catch (CoreException e) { - System.out.println(e.getMessage()); - } - return true; - } - - public void postTrigger(UpdateType type, boolean triggered) { - if (triggered && type == UpdateType.PROJECT) { - writeProperty(); - postTriggerAction(); - } - } - - - protected boolean isIntroViewActive(IWorkbenchPage page) { - IWorkbenchPart activePart = page.getActivePart(); - String id = activePart.getSite().getId(); - return INTRO_VIEW.equals(id); - } - -} diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/NonshareableDemo.xml --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/NonshareableDemo.xml Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/ProjectUpdater.java --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/ProjectUpdater.java Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1726 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -package com.nokia.carbide.cpp.internal.project.core.updater; - -import com.nokia.carbide.cdt.builder.*; -import com.nokia.carbide.cpp.epoc.engine.*; -import com.nokia.carbide.cpp.epoc.engine.image.IMultiImageSource; -import com.nokia.carbide.cpp.epoc.engine.model.EGeneratedHeaderFlags; -import com.nokia.carbide.cpp.epoc.engine.model.bldinf.*; -import com.nokia.carbide.cpp.epoc.engine.model.bldinf.IMakefileReference.EMakeEngine; -import com.nokia.carbide.cpp.epoc.engine.model.makefile.image.IImageMakefileView; -import com.nokia.carbide.cpp.epoc.engine.model.mmp.*; -import com.nokia.carbide.cpp.epoc.engine.preprocessor.AllNodesViewFilter; -import com.nokia.carbide.cpp.internal.api.project.core.ProjectCorePluginUtility; -import com.nokia.carbide.cpp.internal.project.core.Messages; -import com.nokia.carbide.cpp.project.core.ProjectCorePlugin; -import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; -import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; -import com.nokia.carbide.internal.api.cpp.epoc.engine.image.*; -import com.nokia.carbide.updater.extension.IProjectUpdater; -import com.nokia.cpp.internal.api.utils.core.*; - -import org.eclipse.cdt.core.*; -import org.eclipse.cdt.core.model.*; -import org.eclipse.cdt.core.settings.model.ICProjectDescription; -import org.eclipse.cdt.make.core.makefile.ICommand; -import org.eclipse.cdt.make.core.makefile.ITargetRule; -import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; -import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature; -import org.eclipse.core.resources.*; -import org.eclipse.core.runtime.*; -import org.eclipse.swt.widgets.Display; -import org.osgi.framework.Bundle; -import org.osgi.framework.Version; - -import java.io.*; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.text.MessageFormat; -import java.util.*; - -/** - * Class implementing the com.nokia.carbide.updater.projectUpdater extension point - */ -public class ProjectUpdater implements IProjectUpdater { - - private class UpdateBldInfViewRunnable implements IBldInfViewRunnable { - private IPath path; - private EpocEnginePathHelper helper; - - private UpdateBldInfViewRunnable(IPath path) { - this.helper = new EpocEnginePathHelper(project); - this.path = path; - } - - public Object failedLoad(CoreException exception) { - if (exception != null) - return exception.getStatus(); - return genericErrorStatus(new Exception(Messages.getString("ProjectUpdater.InfNotExistError"))); //$NON-NLS-1$ - } - - public Object run(IBldInfView view) { - while (true) { - IStatus status = updateBldInfView(view); - if (!status.isOK()) - return status; - - try { - view.commit(); - break; - } - catch (IllegalStateException e) { - view.revert(); - } - } - return Status.OK_STATUS; - } - - private IStatus updateBldInfView(IBldInfView view) { - - updateMakMakeReferences(view); - - removeDeadProjectExports(view); - - IStatus status = updateMIFDEFs(view); - if (!status.isOK()) - return status; - - updatePlatforms(view); - - return Status.OK_STATUS; - } - - /** - * Remove any makmake references to files that don't exist. - * These will make bldmake bldfiles stop dead. - */ - private void updateMakMakeReferences(IBldInfView view) { - List references = view.getMakMakeReferences(); - // remove dead MMPs and makefiles, which cause bldmake bldfiles to fail - IMakMakeReference existingMMPRef = null; - for (Iterator iter = references.iterator(); iter.hasNext();) { - IMakMakeReference ref = (IMakMakeReference) iter.next(); - IPath refPath = helper.convertToWorkspace(ref.getPath()); - if (refPath == null || ResourcesPlugin.getWorkspace().getRoot().findMember(refPath) == null) { - iter.remove(); - } else if (refPath != null && refPath.removeFirstSegments(1).toOSString().equalsIgnoreCase(path.toOSString())) { - existingMMPRef = ref; - } - } - - // add a ref to the converted MMP if it's not already there - // (we want to keep any existing flags set on the line) - if (existingMMPRef == null) { - IMMPReference mmpRef = view.createMMPReference(); - mmpRef.setPath(path); - references.add(mmpRef); - } - } - - /** - * Remove PRJ_EXPORTS entries that don't exist. - * These will make bldmake bldfiles stop dead. - */ - private void removeDeadProjectExports(IBldInfView view) { - List exports = view.getExports(); - for (Iterator iter = exports.iterator(); iter.hasNext();) { - IExport export = (IExport) iter.next(); - IPath path = helper.convertToWorkspace(export.getSourcePath()); - if (path == null || ResourcesPlugin.getWorkspace().getRoot().findMember(path) == null) { - iter.remove(); - } - } - } - } - - private class UpdateMMPViewRunnable implements IMMPViewRunnable { - - public Object failedLoad(CoreException exception) { - if (exception != null) - return exception.getStatus(); - return genericErrorStatus(new Exception(Messages.getString("ProjectUpdater.MMPNotExistError"))); //$NON-NLS-1$ - } - - public Object run(IMMPView view) { - while (true) { - IStatus status = updateMMPView(view); - if (!status.isOK()) - return status; - - try { - view.commit(); - break; - } - catch (IllegalStateException e) { - view.revert(); - } - } - - return Status.OK_STATUS; - } - - } - - private class FindIconMakefileViewRunnable implements IImageMakefileViewRunnable { - - public Object failedLoad(CoreException exception) { - return Status.CANCEL_STATUS; // flag this one doesn't load! - } - - public Object run(IImageMakefileView view) { - List multiImageSources = view.getMultiImageSources(); - if (multiImageSources != null && !multiImageSources.isEmpty()) - return Status.OK_STATUS; // flag to use this one - - return null; // flag to ignore this one - } - - } - - private class AddSourceToIconMakefileViewRunnable implements IImageMakefileViewRunnable { - - private static final String IMAGE_MAKEFILE_DEFAULT_TARGET = "RESOURCE"; //$NON-NLS-1$ - private static final String IMAGE_MAKEFILE_RELEASEABLES_TARGET = "RELEASABLES"; //$NON-NLS-1$ - - private final List sources; - - public AddSourceToIconMakefileViewRunnable(List sources) { - this.sources = sources; - } - - public Object failedLoad(CoreException exception) { - if (exception != null) - return exception.getStatus(); - return genericErrorStatus(new Exception(Messages.getString("ProjectUpdater.MKNotExistError"))); //$NON-NLS-1$ - } - - public Object run(IImageMakefileView view) { - while (true){ - - for (IMultiImageSource mis : sources) { - updateMultiImageSource(view, mis); - } - - // ensure mifconv rules end up under RESOURCE: - view.setDefaultImageTarget(IMAGE_MAKEFILE_DEFAULT_TARGET); - - // add the filenames to the RELEASABLES rule - ITargetRule releaseRule = view.findRuleForTarget(IMAGE_MAKEFILE_RELEASEABLES_TARGET, true); - ICommand[] releaseCommands = releaseRule.getCommands(); - - for (ICommand cmd : releaseCommands) { - if (cmd.toString().contains("echo")) { //$NON-NLS-1$ - StringBuilder newCommand = new StringBuilder(); - newCommand.append("\t@echo "); //$NON-NLS-1$ - for (IMultiImageSource mis : sources) { - newCommand.append(view.getUnexpandedMultiImageSourceTargetPath(mis)); - newCommand.append(' '); - } - newCommand.append('\n'); - view.replaceDirective(cmd, newCommand.toString()); - break; - } - } - - try { - view.commit(); - break; - } - catch (IllegalStateException e) { - if (!view.merge()) { - view.revert(); - } - } - } - - return Status.OK_STATUS; - } - - /** - * @param mis - */ - private void updateMultiImageSource(IImageMakefileView view, IMultiImageSource source) { - List multiImageSources = view.getMultiImageSources(); - for (IMultiImageSource existing : multiImageSources) { - if (existing.getTargetFile().equalsIgnoreCase(source.getTargetFile())) { - multiImageSources.remove(existing); - break; - } - } - - multiImageSources.add(source); - } - - } - - private static final String DEFAULT_ICON_MK_FILE_NAME = "Icons_scalable_dc.mk"; //$NON-NLS-1$ - private static final String ICON_FILE_NOCASE = "(?i).*icon.*"; //$NON-NLS-1$ - - private static final String SYMBIAN_NATURE_ID = "com.symbian.cdt.core.symbiannature"; //$NON-NLS-1$ - private static final String SDT_SYMBIAN_BUNDLE_ID = "com.nokia.sdt.symbian"; //$NON-NLS-1$ - private static final String SYMBIAN_LANGUAGE_UTILS_CLASS = - "com.nokia.sdt.symbian.workspace.SymbianLanguageUtils"; //$NON-NLS-1$ - private static final String GET_DESIGN_LANGAUGES_METHOD_NAME = "getDesignLanguages"; //$NON-NLS-1$ - - - private static final String DEFAULT_PRJ_PLATFORM = "DEFAULT"; //$NON-NLS-1$ - private static final String COMMENT_DELIM = "//"; //$NON-NLS-1$ - private static final String DEFAULT_PRJ_PLATFORM_COMMENT = Messages.getString("ProjectUpdater.PlatformsNotAvailableWithAllSDKsComment"); //$NON-NLS-1$ - - private static final String CUR_DIR = "."; //$NON-NLS-1$ - private static final String EPOC32_INC = File.separator +"epoc32" + File.separator + "include"; //$NON-NLS-1$ //$NON-NLS-2$ - - private static final String[] IMPLICIT_LIB_PREFIXES = { - "dfpaeabi", //$NON-NLS-1$ - "dfprvct", //$NON-NLS-1$ - "drtaeabi", //$NON-NLS-1$ - "drtrvct", //$NON-NLS-1$ - "scppnwdl", //$NON-NLS-1$ - "usrt" //$NON-NLS-1$ - }; - - private static final String[] IMPLICIT_LIBS = { - "EDLLSTUB.LIB", //$NON-NLS-1$ - "EGCC.LIB", //$NON-NLS-1$ - "EEXE.LIB", //$NON-NLS-1$ - "EDLL.LIB" //$NON-NLS-1$ - }; - - private static class ImplicitStaticLibSpec extends Pair { - private final static int FAMILY = 0; - private final static int FROM_VERS = 1; - private final static int TO_VERS = 2; - - public static Tuple createSDKSpec(String sdkFamily, Version fromVersion, Version toVersion) { - return new Tuple(sdkFamily, fromVersion, toVersion); - } - - public ImplicitStaticLibSpec(Tuple first, String second) { - super(first, second); - } - - public boolean matchesSDK(ISymbianSDK symbianSDK) { - String family = (String) first.get(FAMILY); - if (!family.equalsIgnoreCase(symbianSDK.getFamily())) - return false; - - Version sdkVers = symbianSDK.getSDKVersion(); - Version fromVers = (Version) first.get(FROM_VERS); - if (sdkVers.compareTo(fromVers) < 0) - return false; - - Version toVers = (Version) first.get(TO_VERS); - if (sdkVers.compareTo(toVers) > 0) - return false; - - return true; - } - - public String getLibrary() { - return second; - } - } - - private static final ImplicitStaticLibSpec[] IMPLICIT_STATIC_LIBS = { - new ImplicitStaticLibSpec( - ImplicitStaticLibSpec.createSDKSpec( - ISymbianSDK.UIQ_FAMILY_ID, new Version(3,0,0), new Version(3,0,0)), - "QikAlloc.lib") //$NON-NLS-1$ - }; - - private static final String CDT_SETTINGS_MBS_PREFS_FILE_NAME = ".settings/org.eclipse.cdt.managedbuilder.core.prefs"; //$NON-NLS-1$ - - // property on project resource with default configuration id value - private static final QualifiedName DEFAULT_CONFIG_KEY = - new QualifiedName("org.eclipse.cdt.managedbuilder.core", "defaultConfig"); //$NON-NLS-1$ //$NON-NLS-2$ - - private SymbianProjectInfo projectInfo; - private SymbianBuildParser parser; - private IProject project; - private IProgressMonitor monitor; - - private static final boolean DUMP = false; - - public ProjectUpdater() { - super(); - } - - private void addMultiImageSources(IMakefileReference iconMakefile, List multiImageSources) throws CoreException { - IPath path = project.getFullPath().append(iconMakefile.getPath()); - IStatus status = (IStatus) EpocEnginePlugin.runWithImageMakefileView(path, - new DefaultImageMakefileViewConfiguration(project, null, new AllNodesViewFilter()), - new AddSourceToIconMakefileViewRunnable(multiImageSources)); - if (!status.isOK()) - throw new CoreException(status); - } - - private IMakefileReference createNewIconMakefile(IBldInfView view) throws CoreException { - EpocEnginePathHelper pathHelper = new EpocEnginePathHelper(project); - IPath makefilePath = projectInfo.getGroupFolderPath().append(DEFAULT_ICON_MK_FILE_NAME); - makefilePath = pathHelper.convertFilesystemToWorkspace(makefilePath); - IWorkspaceRoot root = project.getWorkspace().getRoot(); - IFile file = root.getFile(makefilePath); - if (!file.exists()) { - String contents = getCanonicalIconMakeFileContents(project.getName()); - file.create(new ByteArrayInputStream(contents.getBytes()), true, monitor); - } - IMakefileReference reference = view.createMakefileReference(); - reference.setPath(makefilePath.removeFirstSegments(1)); - reference.setMakeEngine(EMakeEngine.GNUMAKEFILE); - List makMakeReferences = view.getMakMakeReferences(); - boolean hasReference = false; - for (IMakMakeReference makMakeReference : makMakeReferences) { - if (makMakeReference.getPath().toString().equalsIgnoreCase(reference.getPath().toString())) { - hasReference = true; - break; - } - } - if (!hasReference) - makMakeReferences.add(0, reference); - - return reference; - } - - private IMakefileReference findIconMakefile(IMakefileReference[] makefileReferences) { - if (makefileReferences == null) - return null; - - List loadableMakefiles = new ArrayList(); - // look for icons in the file - for (int i = 0; i < makefileReferences.length; i++) { - IMakefileReference reference = makefileReferences[i]; - IPath path = project.getFullPath().append(reference.getPath()); - IStatus status = (IStatus) EpocEnginePlugin.runWithImageMakefileView(path, - new DefaultImageMakefileViewConfiguration(project, null, new AllNodesViewFilter()), - new FindIconMakefileViewRunnable()); - if (status == null) - loadableMakefiles.add(reference); - else if (status.isOK()) - return reference; - } - - // see if a file name has the word icon in it - for (IMakefileReference reference : loadableMakefiles) { - IPath path = reference.getPath(); - String filename = path.lastSegment(); - if (filename.matches(ICON_FILE_NOCASE)) - return reference; - } - - return null; - } - - public String getDocumentation() { - return - "

" + //$NON-NLS-1$ - Messages.getString("ProjectUpdater.Doc1") + //$NON-NLS-1$ - Messages.getString("ProjectUpdater.Doc2") + //$NON-NLS-1$ - "

" + //$NON-NLS-1$ - "

" + //$NON-NLS-1$ - Messages.getString("ProjectUpdater.Doc3") + //$NON-NLS-1$ - Messages.getString("ProjectUpdater.Doc4") + //$NON-NLS-1$ - Messages.getString("ProjectUpdater.Doc4b") + //$NON-NLS-1$ - " " + //$NON-NLS-1$ - Messages.getString("ProjectUpdater.Doc5") + //$NON-NLS-1$ - "

" + //$NON-NLS-1$ - "

" + //$NON-NLS-1$ - Messages.getString("ProjectUpdater.Doc6") + //$NON-NLS-1$ - Messages.getString("ProjectUpdater.Doc7") + //$NON-NLS-1$ - Messages.getString("ProjectUpdater.Doc8") + //$NON-NLS-1$ - "

" //$NON-NLS-1$ - -// + "

After projects are updated any projects using the UI Designer will be checked for required " -// + "file updates. You will be able to preview those changes before any changes are applied.

" - + "
"; //$NON-NLS-1$ - } - - public String getUpdateLabel() { - return Messages.getString("ProjectUpdater.Label"); //$NON-NLS-1$ - } - - public boolean needsUpdate(IProject project, IProgressMonitor monitor) { - IProjectDescription description = null; - try { - description = project.getDescription(); - } - catch (CoreException e) { - } - - if (description != null && description.hasNature(SYMBIAN_NATURE_ID)) { - // ping the project to force MBS to notice it's out of date - // (so we can delete the error message before it's - // converted) - ManagedBuildManager.getBuildInfo(project, true); - return true; - } - return false; - } - - public IStatus update(IProject project, IProgressMonitor monitor) { - this.project = project; - this.monitor = monitor; - - try { - monitor.beginTask(MessageFormat.format(Messages.getString("ProjectUpdater.TaskName"), //$NON-NLS-1$ - new Object[] { project.getName() }), 10); - return doUpdateProject(new SubProgressMonitor(monitor, 1)); - } finally { - monitor.done(); - } - } - - private IStatus doUpdateProject(IProgressMonitor monitor) { - printDebugHeader(); - - // first, refresh the project - try { - project.refreshLocal(IResource.DEPTH_INFINITE, monitor); - } catch (CoreException e) { - return e.getStatus(); - } - monitor.worked(1); - if (monitor.isCanceled()) - return Status.CANCEL_STATUS; - - IStatus status = createProjectInfo(); - if (!status.isOK()) - return status; - monitor.worked(1); - if (monitor.isCanceled()) - return Status.CANCEL_STATUS; - - status = createBuildParser(); - if (!status.isOK()) - return status; - monitor.worked(1); - if (monitor.isCanceled()) - return Status.CANCEL_STATUS; - - if (DUMP) { - printDebugProjectInfo(); - printDebugParserData(); - - return Status.OK_STATUS; - } - - IPath absBldInfPath = getBldInfPath(); - status = ensureSafeFile(absBldInfPath, monitor); - if (!status.isOK()) - return status; - - IPath absMMPPath = getNewMMPPath(); - status = ensureSafeFile(absMMPPath, monitor); - if (!status.isOK()) - return status; - - monitor.worked(1); - if (monitor.isCanceled()) - return Status.CANCEL_STATUS; - - status = setLinkedProperty(); - if (!status.isOK()) - return status; - - monitor.worked(1); - if (monitor.isCanceled()) - return Status.CANCEL_STATUS; - - final EpocEnginePathHelper pathHelper = new EpocEnginePathHelper(project); - IPath bldInfPath = pathHelper.convertFilesystemToWorkspace(absBldInfPath); - - // make path relative to workspace - IPath mmpPath = pathHelper.convertFilesystemToWorkspace(absMMPPath); - - // make project relative - status = (IStatus) EpocEnginePlugin.runWithBldInfView(bldInfPath, - new DefaultViewConfiguration(project, null, new AllNodesViewFilter()), - new UpdateBldInfViewRunnable(mmpPath.removeFirstSegments(1))); - if (!status.isOK()) - return status; - - monitor.worked(1); - if (monitor.isCanceled()) - return Status.CANCEL_STATUS; - - status = (IStatus) EpocEnginePlugin.runWithMMPView(mmpPath, - new DefaultMMPViewConfiguration(project, null, new AllNodesViewFilter()), - new UpdateMMPViewRunnable()); - if (!status.isOK()) - return status; - - monitor.worked(1); - if (monitor.isCanceled()) - return Status.CANCEL_STATUS; - - // this is the point of no return - status = removeUnusedProjectNaturesAndBuildInfo(); - if (!status.isOK()) - return status; - - monitor.worked(1); - if (monitor.isCanceled()) - return Status.CANCEL_STATUS; - - // Remove error markers about missing MBS info. - // Don't stop here even if it returns a bad status or is canceled, - // otherwise the project is broken. - removeMBSErrorMarkers(); - monitor.worked(1); - - status = convertToCarbideProject(bldInfPath, mmpPath, monitor); - if (!status.isOK()) - return status; - - monitor.worked(1); - return status; - } - - private IStatus createLinkedProjectStatus() { - String fmt = Messages.getString("ProjectUpdater.linkedProjectUpdateErr"); //$NON-NLS-1$ - String msg = MessageFormat.format(fmt, new Object[] {project.getName()}); - return new Status(IStatus.ERROR, ProjectCorePlugin.PLUGIN_ID, 0, msg, null); - } - - private IStatus setLinkedProperty() { - // check if the group folder is linked, and if so, set the persistent property - IPath groupFolderPath = projectInfo.getGroupFolderPath(); - IPath projectPath = project.getLocation(); - if (!projectPath.isPrefixOf(groupFolderPath)) { - IPath rootDirectory = groupFolderPath.removeLastSegments(1); - try { - project.setPersistentProperty(CarbideBuilderPlugin.LINKED_PROJECT_ROOT_DIRECTORY, rootDirectory.toOSString()); - } catch (CoreException e) { - return e.getStatus(); - } - } - - return Status.OK_STATUS; - } - - private IPath convertToMMPPath(IPath absoluteOrProjectPath, MMPViewPathHelper pathHelper, EMMPPathContext context) { - IPath wsPath = FileUtils.convertToWorkspacePath(absoluteOrProjectPath, true); - IPath path = wsPath == null ? absoluteOrProjectPath : wsPath.removeFirstSegments(1); - try { - return pathHelper.convertProjectOrFullPathToMMP(context, path); - } catch (InvalidDriveInMMPPathException e) { - return e.getPathNoDevice(); - } - } - - private IStatus convertToCarbideProject(IPath bldInfPath, IPath mmpPath, IProgressMonitor monitor) { - String projectRelativeBldInfPathStr = bldInfPath.removeFirstSegments(1).toString(); - // buildContexts will have the default context first to make it default - List buildContexts = new ArrayList(parser.getBuildContexts()); - - try { - // create the c project description - ICProjectDescription projDes = CCorePlugin.getDefault().createProjectDescription(project, false, true); - - // add the natures - IProgressMonitor nullMonitor = new NullProgressMonitor(); - CProjectNature.addCNature(project, nullMonitor); - CCorePlugin.getDefault().convertProjectFromCtoCC(project, nullMonitor); - - // add our carbide builder nature - CarbideBuilderPlugin.addBuildNature(project); - - // and now run it through our project creation stuff - ProjectCorePluginUtility.setupBuilderSettings(projDes, projectRelativeBldInfPathStr, - buildContexts, Collections.EMPTY_LIST, null); - - // rename the .cdtproject file so the user knows it's no longer used - File oldCdtProjectFile = project.getLocation().append(".cdtproject").toFile(); //$NON-NLS-1$ - if (oldCdtProjectFile.exists()) { - oldCdtProjectFile.renameTo(project.getLocation().append(".cdtproject_obsolete").toFile()); //$NON-NLS-1$ - } - } catch (CoreException e) { - return e.getStatus(); - } - - return Status.OK_STATUS; - } - - private IStatus genericErrorStatus(Throwable t) { - String message = - MessageFormat.format(Messages.getString("ProjectUpdater.NotUpdateProjectError"), new Object[] { project.getName() }); //$NON-NLS-1$ - return Logging.newSimpleStatus(ProjectCorePlugin.getDefault(), IStatus.ERROR, message, t); - } - - private IStatus createBuildParser() { - String defaultConfigKey = null; - try { - defaultConfigKey = project.getPersistentProperty(DEFAULT_CONFIG_KEY); - } catch (CoreException e) { - // if we can't find this, we default to the first config - } - parser = SymbianBuildParser.createParser(project, defaultConfigKey); - if (parser == null) - return genericErrorStatus(new Exception(Messages.getString("ProjectUpdater.NotCreateBuildParserError"))); //$NON-NLS-1$ - - return Status.OK_STATUS; - } - - private IStatus createProjectInfo() { - try { - projectInfo = SymbianProjectInfo.createProjectInfo(project); - } - catch (CoreException e) { - return e.getStatus(); - } - - return Status.OK_STATUS; - } - - private IPath getNewMMPPath() { - return projectInfo.getGroupFolderPath().append(project.getName().concat(".mmp")); //$NON-NLS-1$ - } - - private IPath getBldInfPath() { - IPath bldInfPath = projectInfo.getBldInfPath(); - if (bldInfPath == null) { - bldInfPath = projectInfo.getGroupFolderPath(); - bldInfPath = bldInfPath.append("bld.inf"); //$NON-NLS-1$ - } - return bldInfPath; - } - - private IStatus ensureSafeFile(IPath absolutePath, IProgressMonitor monitor) { - // either save off existing, or create new file - IPath wsPath = FileUtils.convertToWorkspacePath(absolutePath, true); - if (wsPath == null) { - // not in the workspace - return createLinkedProjectStatus(); - } - IWorkspaceRoot wsRoot = project.getWorkspace().getRoot(); - IFile file = wsRoot.getFile(wsPath); - try { - if (file.exists()) { - IPath saveFilePath = file.getFullPath().addFileExtension("SAVE"); //$NON-NLS-1$ - IResource saveFile = wsRoot.getFile(saveFilePath); - if (saveFile.exists()) - saveFile.delete(true, monitor); - file.copy(saveFilePath, true, monitor); - } - else - file.create(new ByteArrayInputStream(new byte[0]), true, monitor); - } - catch (CoreException e) { - return e.getStatus(); - } - - return Status.OK_STATUS; - } - - /** - * Rename the given file so the user sees it's outdated. - * Not the same as #ensureSafeFile() because we're not overwriting it. - * @param path full path - */ - private void renameAway(IPath path) throws CoreException { - IPath wsPath = FileUtils.convertToWorkspacePath(path); - if (wsPath == null) { - File file = path.toFile(); - file.renameTo(new File(file.getParentFile(), file.getName() + ".SAVE")); //$NON-NLS-1$ - return; - } - IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(wsPath); - if (resource != null) { - IPath newName = wsPath.addFileExtension("SAVE"); //$NON-NLS-1$ - resource.move(newName.makeAbsolute(), false, new NullProgressMonitor()); - } - } - - private IStatus updateMMPView(IMMPView view) { - ISymbianBuildContext context = parser.getDefaultBuildContext(); - ISymbianSDK symbianSDK = context != null ? context.getSDK() : null; - String epocRoot = symbianSDK != null ? symbianSDK.getEPOCROOT() : null; - MMPViewPathHelper pathHelper = new MMPViewPathHelper(project, epocRoot); - - IStatus status = updateAIFDEFs(view, pathHelper); - if (!status.isOK()) - return status; - - status = updateMBMDEFs(view, pathHelper); - if (!status.isOK()) - return status; - - updateWithViewAPI(view); - updateSingleArgumentSettings(view); - updateListArgumentSettings(view); - updateMMPViewPaths(view, pathHelper); - - return Status.OK_STATUS; - } - - - class GenericImageConversionPathResolver implements IPathResolver { - - public GenericImageConversionPathResolver() { - } - public IPath resolvePath(String pathString) { - IPath path = FileUtils.createPossiblyRelativePath(pathString); - if (!path.isAbsolute()) { - return FileUtils.getCanonicalWorkspacePath(new Path(project.getName()).append(path)).removeFirstSegments(1); - } - IPath wsPath = FileUtils.convertToWorkspacePath(path, true); - IPath resolvedPath; - if (wsPath == null) { - try { - resolvedPath = new Path(path.toFile().getCanonicalPath()); - } catch (IOException e) { - resolvedPath = path; - } - } else { - resolvedPath = wsPath.removeFirstSegments(1); - } - return resolvedPath; - } - } - - class MMPImageConversionPathResolver extends GenericImageConversionPathResolver { - - private final MMPViewPathHelper pathHelper; - private final EMMPPathContext context; - public MMPImageConversionPathResolver(MMPViewPathHelper pathHelper, EMMPPathContext context) { - this.pathHelper = pathHelper; - this.context = context; - - } - public IPath resolvePath(String pathString) { - IPath path = FileUtils.createPossiblyRelativePath(pathString).removeTrailingSeparator(); - - IPath resolvedPath = convertToMMPPath(path, pathHelper, context); - if (resolvedPath != null) { - if (resolvedPath.isAbsolute()) { - // This could be the hallmark of a bug in *.aifdef where the full - // path to the project is embedded, thus limiting portability. - // If this file came from CVS, it's likely pointing to a bogus location. - // See if the file actually exists in the project by trimming it down - // until some suffix is found in the project. - - try { - resolvedPath = new Path(resolvedPath.toFile().getCanonicalPath()); - } catch (IOException e) { - } - - IPath tmpPath = resolvedPath.setDevice(null).makeAbsolute(); - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - while (tmpPath.segmentCount() >= 1) { - // This canonicalization is vital, since the AIF is miscapitalized - // in some templates... - tmpPath = FileUtils.getCanonicalWorkspacePath(tmpPath); - if (root.findMember(tmpPath) != null) { - // remove project - resolvedPath = tmpPath.removeFirstSegments(1); - break; - } - tmpPath = tmpPath.removeFirstSegments(1); - } - } else { - resolvedPath = FileUtils.getCanonicalWorkspacePath( - new Path(project.getName()).append(resolvedPath)); - resolvedPath = resolvedPath.removeFirstSegments(1); - } - } else { - resolvedPath = path; - } - - return resolvedPath; - } - - } - - private IStatus updateAIFDEFs(IMMPView view, MMPViewPathHelper pathHelper) { - Collection aifdefFiles = projectInfo.getAifdefFiles(); - if (aifdefFiles == null || aifdefFiles.isEmpty()) - return Status.OK_STATUS; - - IAifDefFileConverter converter = LegacyImageFileConverterFactory.createAifdefConverter(); - String targetPathString = parser.getTargetPath(); - IPath targetPath = null; - if (targetPathString != null) - targetPath = new Path(targetPathString); - - List aifInfos = new ArrayList(); - MMPImageConversionPathResolver resolver = new MMPImageConversionPathResolver( - pathHelper, - EMMPPathContext.AIF_SOURCE); - - for (IPath path : aifdefFiles) { - File file = path.toFile(); - if (file.exists()) { - try { - String contents = new String(FileUtils.readFileContents(file, null)); - IMMPAIFInfo info = converter.convert( - targetPath, - path.lastSegment(), - contents, - resolver); - aifInfos.add(info); - renameAway(path); - } catch (CoreException e) { - return e.getStatus(); - } - } - } - - if (!aifInfos.isEmpty()) // there is never more than one, so always set it - view.setAifs(aifInfos); - - return Status.OK_STATUS; - } - - private IStatus updateMBMDEFs(IMMPView view, MMPViewPathHelper pathHelper) { - Collection mbmdefFiles = projectInfo.getMbmdefFiles(); - if (mbmdefFiles == null || mbmdefFiles.isEmpty()) - return Status.OK_STATUS; - - IMbmMifDefFileConverter converter = LegacyImageFileConverterFactory.createMbmdefConverter(); - IPath targetPath = new Path(parser.getMBMTargetPath()); - MMPImageConversionPathResolver resolver = new MMPImageConversionPathResolver( - pathHelper, EMMPPathContext.START_BITMAP_SOURCE); - - List multiImageSources = view.getMultiImageSources(); - for (IPath path : mbmdefFiles) { - File file = path.toFile(); - if (file.exists()) { - try { - String contents = new String(FileUtils.readFileContents(file, null)); - IMultiImageSource source = converter.convert( - targetPath, - path.lastSegment(), - contents, - resolver); - for (IMultiImageSource imageSource : multiImageSources) { - if (imageSource.getTargetFilePath().toString().equalsIgnoreCase(source.getTargetFilePath().toString())) { - multiImageSources.remove(imageSource); - break; - } - } - multiImageSources.add(source); - renameAway(path); - } catch (CoreException e) { - return e.getStatus(); - } - } - } - - return Status.OK_STATUS; - } - - private IStatus updateMIFDEFs(IBldInfView view) { - Collection mifdefFiles = projectInfo.getMifdefFiles(); - if (mifdefFiles == null || mifdefFiles.isEmpty()) - return Status.OK_STATUS; - - IMakefileReference iconMakefile = findIconMakefile(view.getAllMakefileReferences()); - if (iconMakefile == null) { - try { - iconMakefile = createNewIconMakefile(view); - } catch (CoreException e) { - return e.getStatus(); - } - } else { - IPath path = project.getLocation().append(iconMakefile.getPath()); - String device = path.getDevice(); - try { - path = new Path(path.toFile().getCanonicalPath()).setDevice(device); - } catch (IOException x) { - ProjectCorePlugin.log(x); - } - IStatus status = ensureSafeFile(path, monitor); - if (!status.isOK()) { - return status; - } - } - - IMbmMifDefFileConverter converter = LegacyImageFileConverterFactory.createMifdefConverter(); - IPath targetPath = new Path(parser.getMIFTargetPath()); - GenericImageConversionPathResolver resolver = new GenericImageConversionPathResolver(); - - List multiImageSources = new ArrayList(); - for (IPath path : mifdefFiles) { - File file = path.toFile(); - if (file.exists()) { - try { - String contents = new String(FileUtils.readFileContents(file, null)); - IMultiImageSource source = converter.convert( - targetPath, - path.lastSegment(), - contents, - resolver); - multiImageSources.add(source); - renameAway(path); - } catch (CoreException e) { - return e.getStatus(); - } - } - } - - try { - addMultiImageSources(iconMakefile, multiImageSources); - } catch (CoreException e) { - return e.getStatus(); - } - - return Status.OK_STATUS; - } - - private void updatePlatforms(IBldInfView view) { - boolean makeDefault = false; - List platformsToAdd = new ArrayList(); - Collection buildContexts = parser.getBuildContexts(); - for (ISymbianBuildContext context : buildContexts) { - String platform = context.getPlatformString(); - if (!platformsToAdd.contains(platform)) { - if (!makeDefault && isIncompatiblePlatform(platform)) { - makeDefault = true; - } - platformsToAdd.add(platform); - } - } - - List platforms = view.getPlatforms(); - platforms.clear(); - if (makeDefault) { - platforms.add(DEFAULT_PRJ_PLATFORM); - platforms.add(COMMENT_DELIM); - } - platforms.addAll(platformsToAdd); - if (makeDefault) { - String[] atoms = DEFAULT_PRJ_PLATFORM_COMMENT.split("\\s"); //$NON-NLS-1$ - for (String atom : atoms) { - if (atom.length() > 0) - platforms.add(atom); - } - } - } - - private boolean isIncompatiblePlatform(String platform) { - Collection buildContexts = parser.getBuildContexts(); - for (ISymbianBuildContext context : buildContexts) { - ISymbianSDK symbianSDK = context.getSDK(); - List availablePlatforms = symbianSDK.getAvailablePlatforms(); - if (!availablePlatforms.contains(platform)) - return true; - } - - return false; - } - - private void updateWithViewAPI(IMMPView view) { - updateUID2(view); - updateUID3(view); - updateLanguages(view); - updateLibraries(view); - updateStaticLibraries(view); - } - - private void updateUID2(IMMPView view) { - String uid2 = parser.getUID2(); - if (uid2 != null && !integersMatch(uid2, view.getUid2())) - view.setUid2(uid2); - } - - private void updateUID3(IMMPView view) { - String uid3 = parser.getUID3(); - if (uid3 != null && !integersMatch(uid3, view.getUid3())) - view.setUid3(uid3); - } - - private void updateLanguages(IMMPView view) { - final Collection languageCodeHolder[] = new Collection[1]; - Display.getDefault().syncExec(new Runnable() { - public void run() { - languageCodeHolder[0] = getDesignLanguages(); - } - }); - Collection languageCodes = languageCodeHolder[0]; - if (languageCodes == null) { - languageCodes = parser.getLanguages(); - } - if (languageCodes != null) { - List languages = view.getLanguages(); - for (String code : languageCodes) { - try { - EMMPLanguage language = EMMPLanguage.fromCode(code); - if (!languages.contains(language)) - languages.add(language); - } catch (IllegalArgumentException e) { - // ignore unknown language - } - } - } - } - - private Collection getDesignLanguages() { - Bundle bundle = Platform.getBundle(SDT_SYMBIAN_BUNDLE_ID); - if (bundle != null) { - Class cls = null; - try { - cls = bundle.loadClass(SYMBIAN_LANGUAGE_UTILS_CLASS); - } catch (ClassNotFoundException e) {} - if (cls != null) { - Method method = null; - try { - method = cls.getMethod(GET_DESIGN_LANGAUGES_METHOD_NAME, IProject.class, boolean.class); - } catch (SecurityException e) { - } catch (NoSuchMethodException e) { - } - if (method != null) { - Object object = null; - try { - object = method.invoke(null, project, true); - } catch (IllegalArgumentException e) { - } catch (IllegalAccessException e) { - } catch (InvocationTargetException e) { - } - if (object instanceof Collection) - return (Collection) object; - } - } - } - return null; - } - - private void updateLibraries(IMMPView view) { - Collection parsedLibraries = parser.getLibraries(); - if (parsedLibraries != null) { - removeImplicitLibraries(parsedLibraries); - List libraries = view.getLibraries(); - for (String library : parsedLibraries) { - if (!containsIgnoreCase(libraries, library)) - libraries.add(library); - } - } - } - - private void updateStaticLibraries(IMMPView view) { - // add the implicit static libs that match the default build context - List staticLibraries = view.getStaticLibraries(); - ISymbianBuildContext context = parser.getDefaultBuildContext(); - if (context != null) { - ISymbianSDK sdk = context.getSDK(); - for (int i = 0; i < IMPLICIT_STATIC_LIBS.length; i++) { - ImplicitStaticLibSpec implicitStaticLibSpec = IMPLICIT_STATIC_LIBS[i]; - if (implicitStaticLibSpec.matchesSDK(sdk)) { - String library = implicitStaticLibSpec.getLibrary(); - if (!containsIgnoreCase(staticLibraries, library)) - staticLibraries.add(library); - } - } - } - } - - private void removeImplicitLibraries(Collection parsedLibraries) { - ISymbianBuildContext context = parser.getDefaultBuildContext(); - ISymbianSDK sdk = null; - if (context != null) - sdk = context.getSDK(); - - Collection libs = new ArrayList(); - libs.addAll(parsedLibraries); - parsedLibraries.clear(); - boolean excluded; - for (String lib : libs) { - excluded = false; - for (String prefix : IMPLICIT_LIB_PREFIXES) { - if (startsWithIgnoreCase(lib, prefix)) { - excluded = true; - break; - } - } - if (!excluded) { - for (String implicitLib : IMPLICIT_LIBS) { - if (lib.equalsIgnoreCase(implicitLib)) { - excluded = true; - break; - } - } - } - if (!excluded && sdk != null) { - for (int i = 0; i < IMPLICIT_STATIC_LIBS.length; i++) { - ImplicitStaticLibSpec implicitStaticLibSpec = IMPLICIT_STATIC_LIBS[i]; - if (implicitStaticLibSpec.matchesSDK(sdk)) { - String implicitStaticLib = implicitStaticLibSpec.getLibrary(); - if (lib.equalsIgnoreCase(implicitStaticLib)) { - excluded = true; - break; - } - } - } - } - if (!excluded) - parsedLibraries.add(lib); - } - } - - private boolean startsWithIgnoreCase(String test, String prefix) { - if (test.length() < prefix.length()) - return false; - - String testPrefix = test.substring(0, prefix.length()); - return testPrefix.equalsIgnoreCase(prefix); - } - - private boolean containsIgnoreCase(Collection collection, String test) { - for (String string : collection) { - Check.checkContract(string != null && test != null); - if (string.equalsIgnoreCase(test)) - return true; - } - - return false; - } - - private boolean containsIgnoreCase(Collection collection, IPath test) { - for (IPath path : collection) { - Check.checkContract(path != null && test != null); - if (path.toString().equalsIgnoreCase(test.toString())) - return true; - } - - return false; - } - - private void updateMMPViewPaths(IMMPView view, MMPViewPathHelper pathHelper) { - updateSystemIncludes(view, pathHelper); - updateUserIncludes(view, pathHelper); - updateSourceFiles(view, pathHelper); - updateRssFiles(view, pathHelper); - } - - private void updateRssFiles(IMMPView view, MMPViewPathHelper pathHelper) { - List resourceBlocks = view.getResourceBlocks(); - - // remove dead resources of all flavors - for (Iterator iter = resourceBlocks.iterator(); iter.hasNext(); ) { - IMMPResource resource = iter.next(); - IPath projPath = pathHelper.convertMMPToProject(EMMPPathContext.START_RESOURCE, resource.getSource()); - if (projPath != null && project.findMember(projPath) == null) { - iter.remove(); - } - } - for (Iterator iter = new ChainedIterator(view.getUserResources().iterator(), - view.getSystemResources().iterator()); iter.hasNext(); ) { - IPath projPath = pathHelper.convertMMPToProject(EMMPPathContext.RESOURCE, iter.next()); - if (projPath != null && project.findMember(projPath) == null) { - iter.remove(); - } - } - - // now register the actual living resources - Collection rssFiles = projectInfo.getRssFiles(); - if (rssFiles != null) { - final String RSS_REG_PATTERN = "(?i).*_reg\\.rss"; //$NON-NLS-1$ - for (IPath path : rssFiles) { - IPath rssFile = - convertToMMPPath(path, pathHelper, EMMPPathContext.START_RESOURCE); - IMMPResource existingResourceBlock = findResourceBlockInMMPView(rssFile, view); - if (existingResourceBlock != null) { - // ensure the header is generated -- old MMPs didn't properly mention this - - // but don't do it for *_reg.rss files, since their header isn't used - if (!existingResourceBlock.getSource().lastSegment().matches(RSS_REG_PATTERN)) { - existingResourceBlock.setHeaderFlags(EGeneratedHeaderFlags.Header); - } - } else if (!rssInMMPView(rssFile, view)) { - IMMPResource resource = view.createMMPResource(); - resource.setSource(rssFile); - Map targetPathMappings = parser.getTargetPathMappings(); - String targetPathString = targetPathMappings.get(rssFile); - if (targetPathString == null) - targetPathString = parser.getTargetPath(); - if (targetPathString != null) { - resource.setTargetPath(new Path(targetPathString)); - } - resource.setHeaderFlags(EGeneratedHeaderFlags.Header); - resourceBlocks.add(resource); - } - } - // now ensure that the _reg.rss is at the end - // because it includes the .rsg (generated header) from the main rss file - IMMPResource addAtEnd = null; - for (Iterator iter = resourceBlocks.iterator(); iter.hasNext();) { - IMMPResource resource = iter.next(); - if (resource.getSource().lastSegment().matches(RSS_REG_PATTERN)) { - iter.remove(); - addAtEnd = resource; - break; - } - } - if (addAtEnd != null) - resourceBlocks.add(addAtEnd); - } - } - - /** - * Search for a resource block for the given source. - * @param path - * @param view - * @return - */ - private IMMPResource findResourceBlockInMMPView(IPath path, IMMPView view) { - List resourceBlocks = view.getResourceBlocks(); - for (IMMPResource resource : resourceBlocks) { - IPath resourcePath = resource.getSource(); - if (path.toOSString().equalsIgnoreCase(resourcePath.toOSString())) - return resource; - } - - return null; - } - - /** - * Search for other mentions of a resource source file. - * @param path - * @param view - * @return - */ - private boolean rssInMMPView(IPath path, IMMPView view) { - List aifs = view.getAifs(); - for (IMMPAIFInfo info : aifs) { - IPath resourcePath = info.getResource(); - if (path.toOSString().equalsIgnoreCase(resourcePath.toOSString())) - return true; - } - - List userResources = view.getUserResources(); - for (IPath resourcePath : userResources) { - if (path.toOSString().equalsIgnoreCase(resourcePath.toOSString())) - return true; - } - - List systemResources = view.getSystemResources(); - for (IPath resourcePath : systemResources) { - if (path.toOSString().equalsIgnoreCase(resourcePath.toOSString())) - return true; - } - - return false; - } - - private boolean hasEKA2BuildConfiguration() { - for (ISymbianBuildContext context : parser.getBuildContexts()) { - ISymbianSDK symbianSDK = context.getSDK(); - if (symbianSDK.isEKA2()) { - return true; - } - } - return false; - } - - private void updateSourceFiles(IMMPView view, MMPViewPathHelper pathHelper) { - // remove source entries for nonexistent files, or - // the broken entries for old MMPs that have this stranded stuff - // in the middle: - // - // SOURCEPATH ..\aif - // SOURCE list_icon.bmp list_icon_mask.bmp - // END - // - // We can't really get rid of the END yet... - // - for (Iterator iter = view.getSources().iterator(); iter.hasNext(); ) { - IPath projPath = pathHelper.convertMMPToProject(EMMPPathContext.SOURCE, iter.next()); - if (projPath != null) { - if (project.findMember(projPath) == null) { - iter.remove(); - } else { - String ext = projPath.getFileExtension(); - if (ext != null && ext.equalsIgnoreCase("bmp")) { //$NON-NLS-1$ - iter.remove(); - } - } - } - } - - // and add the real actual sources - Collection sourceFiles = projectInfo.getSourceFiles(); - if (sourceFiles != null) { - List sources = view.getSources(); - for (IPath path : sourceFiles) { - IPath sourceFile = - convertToMMPPath(path, pathHelper, EMMPPathContext.SOURCE); - if (!containsIgnoreCase(sources, sourceFile)) - sources.add(sourceFile); - } - } - } - - private void updateUserIncludes(IMMPView view, MMPViewPathHelper pathHelper) { - Collection userIncludePaths = projectInfo.getUserIncludePaths(); - if (userIncludePaths != null) { - List userIncludes = view.getUserIncludes(); - for (IPath path : userIncludePaths) { - IPath includePath = - convertToMMPPath(path, pathHelper, EMMPPathContext.USERINCLUDE); - if (!containsIgnoreCase(userIncludes, includePath)) - userIncludes.add(includePath); - } - } - } - - private void updateSystemIncludes(IMMPView view, MMPViewPathHelper pathHelper) { - Collection systemIncludeStrings = parser.getSystemIncludePaths(); - if (systemIncludeStrings == null) - systemIncludeStrings = new ArrayList(); - systemIncludeStrings.addAll(getDefaultSystemIncludes()); - List systemIncludeList = view.getSystemIncludes(); - for (String includeString : systemIncludeStrings) { - IPath includePath = - convertToMMPPath(new Path(includeString), pathHelper, EMMPPathContext.SYSTEMINCLUDE); - if (!containsIgnoreCase(systemIncludeList, includePath)) - systemIncludeList.add(includePath); - } - } - - private Collection getDefaultSystemIncludes() { - // add . and \epoc32\include in case they don't exist - Collection defaultSystemIncludes = new ArrayList(); - defaultSystemIncludes.add(CUR_DIR); - defaultSystemIncludes.add(EPOC32_INC); - - return defaultSystemIncludes; - } - - private void updateListArgumentSettings(IMMPView view) { - Map> listArgumentSettings = view.getListArgumentSettings(); - - if (hasEKA2BuildConfiguration()) { - updateCapabilities(view); - } - - Collection macros = parser.getMacros(); - if (macros != null) { - List macroList = listArgumentSettings.get(EMMPStatement.MACRO); - for (String macro : macros) { - if (!macroList.contains(macro)) - macroList.add(macro); - } - } - } - - /** - * @param view - */ - private void updateCapabilities(IMMPView view) { - Map> listArgumentSettings = view.getListArgumentSettings(); - - String capabilitiesString = parser.getCapability(); - boolean noCapabilities = true; - List capabilityList = listArgumentSettings.get(EMMPStatement.CAPABILITY); - - // remove NONE for now and add it back later if the list is really empty - if (capabilityList.size() == 1 && - capabilityList.get(0).equalsIgnoreCase("NONE")) { //$NON-NLS-1$ - capabilityList.clear(); - } - - if (capabilitiesString != null) { - - String[] capabilities = capabilitiesString.split("\\s"); //$NON-NLS-1$ - for (int i = 0; i < capabilities.length; i++) { - String capability = capabilities[i]; - boolean found = false; - for (String string : capabilityList) { - if (string.equalsIgnoreCase(capability)) { - found = true; - break; - } - - } - if (!found) { - capabilityList.add(capability); - } - noCapabilities = false; - } - } - - if (noCapabilities) { - capabilityList.add("NONE"); //$NON-NLS-1$ - } - } - - private void updateSingleArgumentSettings(IMMPView view) { - Map settings = view.getSingleArgumentSettings(); - - String target = parser.getTarget(); - if (target != null) - updateFilenameSetting(settings, EMMPStatement.TARGET, target); - - String targetType = parser.getTargetType(); - if (targetType != null) { - String oldTargetType = settings.get(EMMPStatement.TARGETTYPE); - if (oldTargetType == null) - settings.put(EMMPStatement.TARGETTYPE, targetType); - } - - String stack = parser.getStack(); - if (stack != null) - updateIntegerSetting(settings, EMMPStatement.EPOCSTACKSIZE, stack); - - if (hasEKA2BuildConfiguration()) { - String vendorId = parser.getVendorId(); - if (vendorId != null) - updateIntegerSetting(settings, EMMPStatement.VENDORID, vendorId); - - String secureId = parser.getSecureId(); - if (secureId != null) - updateIntegerSetting(settings, EMMPStatement.SECUREID, secureId); - } - } - - /** - * Tell if the strings, parsed as integers, have the same value. - * @param first integer string or null - * @param second integer string or null - * @return - */ - private boolean integersMatch(String first, String second) { - if (first == null || second == null) - return false; - int radix1 = 10; - if (first.toLowerCase().startsWith("0x")) { //$NON-NLS-1$ - first = first.substring(2); - radix1 = 16; - } - int radix2 = 10; - if (second.toLowerCase().startsWith("0x")) { //$NON-NLS-1$ - second = second.substring(2); - radix2 = 16; - } - try { - // parse as long since UIDs are unsigned - return Long.parseLong(first, radix1) == Long.parseLong(second, radix2); - } catch (NumberFormatException e) { - // whatever that garbage was, consider it different - return false; - } - } - - /** - * Update an integer setting, not touching it unless it didn't - * exist or its value actually changed (integer-wise). Avoids - * false changes. - */ - private void updateIntegerSetting(Map settings, EMMPStatement stmtType, String newValue) { - String value = settings.get(stmtType); - if (value != null) { - if (integersMatch(newValue, value)) - return; - } - settings.put(stmtType, newValue); - } - - /** - * Update a filename setting, canonicalizing it (sort of) - * and not updating it unless it really changed. - */ - private void updateFilenameSetting(Map settings, EMMPStatement stmtType, String newValue) { - String value = settings.get(stmtType); - if (value != null) { - value = new Path(value).toOSString(); - newValue = new Path(newValue).toOSString(); - if (value.equalsIgnoreCase(newValue)) - return; - } - settings.put(stmtType, newValue); - } - - private IStatus removeUnusedProjectNaturesAndBuildInfo() { - try { - // remove project natures - IProjectDescription description = project.getDescription(); - List natureIds = new ArrayList(Arrays.asList(description.getNatureIds())); - natureIds.remove(SYMBIAN_NATURE_ID); - natureIds.remove(ManagedCProjectNature.MNG_NATURE_ID); - description.setNatureIds((String[]) natureIds.toArray(new String[natureIds.size()])); - project.setDescription(description, monitor); - - // move off .cdtbuild, which will trigger MBS - IFile file = project.getFile(ManagedBuildManager.SETTINGS_FILE_NAME); - if (file.exists()) { - renameAway(file.getLocation()); - } - - // move off MBS prefs too - file = project.getFile(CDT_SETTINGS_MBS_PREFS_FILE_NAME); //$NON-NLS-1$ - if (file.exists()) { - renameAway(file.getLocation()); - } - } catch (CoreException e) { - return e.getStatus(); - } catch (Exception e) { - return Logging.newStatus(ProjectCorePlugin.getDefault(), e); - } - - return Status.OK_STATUS; - } - - /** - * Remove markers related the Managed Build Info missing, - * since it will no longer matter after converting. - * @return - */ - private IStatus removeMBSErrorMarkers() { - try { - project.deleteMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE); - } catch (CoreException e) { - return e.getStatus(); - } - - return Status.OK_STATUS; - - } - - private void printDebugHeader() { - if (!DUMP ) - return; - System.out.println("========================================="); //$NON-NLS-1$ - System.out.println("Update: "+project.getName()); //$NON-NLS-1$ - } - - private void printDebugProjectInfo() { - if (!DUMP ) - return; - IPath bldInfPath = projectInfo.getBldInfPath(); - System.out.println("bld.inf path="+bldInfPath); //$NON-NLS-1$ - Collection userIncludePaths = projectInfo.getUserIncludePaths(); - System.out.println("UserIncludePaths="+userIncludePaths); //$NON-NLS-1$ - Collection sourceFiles = projectInfo.getSourceFiles(); - System.out.println("SourceFiles="+sourceFiles); //$NON-NLS-1$ - Collection rssFiles = projectInfo.getRssFiles(); - System.out.println("RssFiles="+rssFiles); //$NON-NLS-1$ - Collection aifdefFiles = projectInfo.getAifdefFiles(); - System.out.println("AifdefFiles="+aifdefFiles); //$NON-NLS-1$ - Collection mbmdefFiles = projectInfo.getMbmdefFiles(); - System.out.println("MbmdefFiles="+mbmdefFiles); //$NON-NLS-1$ - Collection mifdefFiles = projectInfo.getMifdefFiles(); - System.out.println("MifdefFiles="+mifdefFiles); //$NON-NLS-1$ - } - - private void printDebugParserData() { - if (!DUMP ) - return; - String target = parser.getTarget(); - System.out.println("target="+target); //$NON-NLS-1$ - String targetType = parser.getTargetType(); - System.out.println("targetType="+targetType); //$NON-NLS-1$ - String uid2 = parser.getUID2(); - System.out.println("uid2="+uid2); //$NON-NLS-1$ - String uid3 = parser.getUID3(); - System.out.println("uid3="+uid3); //$NON-NLS-1$ - String vendorId = parser.getVendorId(); - System.out.println("vendorId="+vendorId); //$NON-NLS-1$ - String secureId = parser.getSecureId(); - System.out.println("secureId="+secureId); //$NON-NLS-1$ - String capability = parser.getCapability(); - System.out.println("capability="+capability); //$NON-NLS-1$ - String stack = parser.getStack(); - System.out.println("stack="+stack); //$NON-NLS-1$ - String targetPath = parser.getTargetPath(); - System.out.println("targetPath="+targetPath); //$NON-NLS-1$ - String mbmTargetPath = parser.getMBMTargetPath(); - System.out.println("mbmTargetPath="+mbmTargetPath); //$NON-NLS-1$ - Collection buildContexts = parser.getBuildContexts(); - System.out.println("build contexts="+buildContexts); //$NON-NLS-1$ - Collection systemIncludes = parser.getSystemIncludePaths(); - System.out.println("system include paths="+systemIncludes); //$NON-NLS-1$ - Collection languages = parser.getLanguages(); - System.out.println("languages="+languages); //$NON-NLS-1$ - Collection libraries = parser.getLibraries(); - System.out.println("libraries="+libraries); //$NON-NLS-1$ - Collection macros = parser.getMacros(); - System.out.println("macros="+macros); //$NON-NLS-1$ - Map targetPathMappings = parser.getTargetPathMappings(); - System.out.println("targetPathMappings="+targetPathMappings); //$NON-NLS-1$ - } - - private String getCanonicalIconMakeFileContents(String projectName) { - final String contents = "# ============================================================================\r\n" + //$NON-NLS-1$ - "# Name : Icons_aif_scalable_dc.mk\r\n" + //$NON-NLS-1$ - "# Part of : ${projectName}\r\n" + //$NON-NLS-1$ - "#\r\n" + //$NON-NLS-1$ - "# Description:\r\n" + //$NON-NLS-1$ - "# \r\n" + //$NON-NLS-1$ - "# ============================================================================\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "ifeq (WINS,$(findstring WINS, $(PLATFORM)))\r\n" + //$NON-NLS-1$ - "ZDIR=$(EPOCROOT)epoc32/release/$(PLATFORM)/$(CFG)/Z\r\n" + //$NON-NLS-1$ - "else\r\n" + //$NON-NLS-1$ - "ZDIR=$(EPOCROOT)epoc32/data/z\r\n" + //$NON-NLS-1$ - "endif\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "TARGETDIR=$(ZDIR)/resource/apps\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "ICONDIR=../gfx\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "do_nothing :\r\n" + //$NON-NLS-1$ - "\t@rem do_nothing\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "MAKMAKE : do_nothing\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "BLD : do_nothing\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "CLEAN : do_nothing\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "LIB : do_nothing\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "CLEANLIB : do_nothing\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "# ----------------------------------------------------------------------------\r\n" + //$NON-NLS-1$ - "# TODO: Configure these.\r\n" + //$NON-NLS-1$ - "#\r\n" + //$NON-NLS-1$ - "# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by\r\n" + //$NON-NLS-1$ - "# MifConv if the mask depth is defined.\r\n" + //$NON-NLS-1$ - "#\r\n" + //$NON-NLS-1$ - "# NOTE 2: Usually, source paths should not be included in the bitmap\r\n" + //$NON-NLS-1$ - "# definitions. MifConv searches for the icons in all icon directories in a\r\n" + //$NON-NLS-1$ - "# predefined order, which is currently /s60/icons, /s60/bitmaps2.\r\n" + //$NON-NLS-1$ - "# The directory /s60/icons is included in the search only if the feature flag\r\n" + //$NON-NLS-1$ - "# __SCALABLE_ICONS is defined.\r\n" + //$NON-NLS-1$ - "# ----------------------------------------------------------------------------\r\n" + //$NON-NLS-1$ - "# NOTE: if you have JUSTINTIME enabled for your S60 3rd FP1 or newer SDK\r\n"+ //$NON-NLS-1$ - "# and mifconv crashes, consider adding \"/X\" to the command line.\r\n"+ //$NON-NLS-1$ - "# See \r\n"+ //$NON-NLS-1$ - "# ----------------------------------------------------------------------------\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "RESOURCE : \r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "FREEZE : do_nothing\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "SAVESPACE : do_nothing\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "RELEASABLES :\r\n" + //$NON-NLS-1$ - "\t@echo \r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - "FINAL : do_nothing\r\n" + //$NON-NLS-1$ - "\r\n" + //$NON-NLS-1$ - ""; //$NON-NLS-1$ - VariableSubstitutionEngine engine = new VariableSubstitutionEngine(null, null); - Map variables = new HashMap(); - variables.put("projectName", projectName); //$NON-NLS-1$ - engine.setVariableToken('{'); - return engine.substitute(variables, contents); - } -} diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/ROMBuilderUpdater.java --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/ROMBuilderUpdater.java Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,207 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -package com.nokia.carbide.cpp.internal.project.core.updater; - -import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.eclipse.cdt.core.model.CoreModel; -import org.eclipse.cdt.core.settings.model.ICProjectDescription; -import org.eclipse.cdt.core.settings.model.ICStorageElement; -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubProgressMonitor; - -import com.nokia.carbide.cdt.builder.CarbideBuilderPlugin; -import com.nokia.carbide.cdt.builder.project.ICarbideBuildConfiguration; -import com.nokia.carbide.cdt.builder.project.ICarbideProjectInfo; -import com.nokia.carbide.cdt.builder.project.IROMBuilderInfo; -import com.nokia.carbide.cpp.internal.project.core.Messages; -import com.nokia.carbide.cpp.project.core.ProjectCorePlugin; -import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; -import com.nokia.carbide.updater.extension.IProjectUpdater; - -/** - * Class implementing the com.nokia.carbide.updater.projectUpdater extension point - */ -public class ROMBuilderUpdater implements IProjectUpdater { - - private static final String ROM_BUILD_NATURE_ID = "com.nokia.carbide.cdt.rombuilder.carbideRomBuildNature"; //$NON-NLS-1$ - private static final String ROM_BUILDER_ID = "com.nokia.carbide.cdt.rombuilder.carbideRomBuilder"; //$NON-NLS-1$ - private static final String ROM_BUILDER_PLUGIN_ID = "com.nokia.carbide.cdt.rombuilder"; - private static final String ROM_BUILD_COMMAND_LINE = "rombuildcommandline"; //$NON-NLS-1$ - private static final String ROM_BUILD_WORKING_DIR = "rombuildworkingdir"; //$NON-NLS-1$ - - private IProject project; - - - public ROMBuilderUpdater() { - super(); - } - - public String getDocumentation() { - return - "

" + //$NON-NLS-1$ - Messages.getString("ROMBuilderUpdater.Doc1") + //$NON-NLS-1$ - Messages.getString("ROMBuilderUpdater.Doc2") + //$NON-NLS-1$ - "

"; //$NON-NLS-1$ - } - - public String getUpdateLabel() { - return Messages.getString("ROMBuilderUpdater.Label"); //$NON-NLS-1$ - } - - public boolean needsUpdate(IProject project, IProgressMonitor monitor) { - IProjectDescription description = null; - try { - description = project.getDescription(); - } - catch (CoreException e) { - } - - if (description != null && description.hasNature(ROM_BUILD_NATURE_ID)) { - return true; - } - return false; - } - - public IStatus update(IProject project, IProgressMonitor monitor) { - this.project = project; - - try { - monitor.beginTask(MessageFormat.format(Messages.getString("ProjectUpdater.TaskName"), //$NON-NLS-1$ - new Object[] { project.getName() }), 3); - return doUpdateProject(new SubProgressMonitor(monitor, 3)); - } finally { - monitor.done(); - } - } - - private IStatus doUpdateProject(IProgressMonitor monitor) { - try { - // remove the nature - IProjectDescription description = project.getDescription(); - String[] prevNatures = description.getNatureIds(); - List newNatures = new ArrayList(Arrays.asList(prevNatures)); - newNatures.remove(ROM_BUILD_NATURE_ID); - description.setNatureIds((String[]) newNatures.toArray(new String[newNatures.size()])); - project.setDescription(description, monitor); - - monitor.worked(1); - if (monitor.isCanceled()) - return Status.CANCEL_STATUS; - - // remove the builder - ICommand[] commands = description.getBuildSpec(); - for (int i = 0; i < commands.length; ++i) { - if (commands[i].getBuilderName().equals(ROM_BUILDER_ID)) { - ICommand[] newCommands = new ICommand[commands.length - 1]; - System.arraycopy(commands, 0, newCommands, 0, i); - System.arraycopy(commands, i + 1, newCommands, i, - commands.length - i - 1); - description.setBuildSpec(newCommands); - project.setDescription(description, monitor); - break; - } - } - - monitor.worked(1); - if (monitor.isCanceled()) - return Status.CANCEL_STATUS; - - // convert the prefs, if any - ICarbideProjectInfo cpi = CarbideBuilderPlugin.getBuildManager().getProjectInfo(project); - if (cpi != null) { - - String cmdLine = getAndRemoveRomBuildCommandLine(); - String workingDir = getAndRemoveRomBuildWorkingDir(); - - for (ICarbideBuildConfiguration config : cpi.getBuildConfigurations()) { - // don't add it for emulator configs - if (!config.getPlatformString().equals(ISymbianBuildContext.EMULATOR_PLATFORM)) { - IROMBuilderInfo info = config.getROMBuildInfo(); - - if (cmdLine != null && cmdLine.trim().length() > 0) { - info.setCommandLine(cmdLine); - } - - if (workingDir != null && workingDir.trim().length() > 0) { - info.setWorkingDirectory(workingDir); - } - } - } - } - - monitor.worked(1); - - } catch (CoreException e) { - e.printStackTrace(); - } - - return Status.OK_STATUS; - } - - private String getAndRemoveRomBuildCommandLine() { - try { - ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project); - if (projDes != null) { - ICStorageElement storage = projDes.getStorage(ROM_BUILDER_PLUGIN_ID, false); - if (storage != null) { - String value = storage.getAttribute(ROM_BUILD_COMMAND_LINE); - storage.removeAttribute(ROM_BUILD_COMMAND_LINE); - return value; - } - } - } - catch (CoreException e) { - e.printStackTrace(); - ProjectCorePlugin.log(e); - } - - return null; - } - - private String getAndRemoveRomBuildWorkingDir() { - try { - ICProjectDescription projDes = CoreModel.getDefault().getProjectDescription(project); - if (projDes != null) { - ICStorageElement storage = projDes.getStorage(ROM_BUILDER_PLUGIN_ID, false); - if (storage != null) { - String value = storage.getAttribute(ROM_BUILD_WORKING_DIR); - storage.removeAttribute(ROM_BUILD_WORKING_DIR); - return value; - } - } - } - catch (CoreException e) { - e.printStackTrace(); - ProjectCorePlugin.log(e); - } - - return null; - } -} - diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/SymbianBuildParser.java --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/SymbianBuildParser.java Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,652 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -package com.nokia.carbide.cpp.internal.project.core.updater; - -import com.nokia.carbide.cpp.internal.api.sdk.*; -import com.nokia.carbide.cpp.internal.project.core.Messages; -import com.nokia.carbide.cpp.internal.project.core.updater.SymbianBuildParser.ValueInfo.IConverter; -import com.nokia.carbide.cpp.project.core.ProjectCorePlugin; -import com.nokia.carbide.cpp.sdk.core.ISymbianBuildContext; -import com.nokia.carbide.cpp.sdk.core.ISymbianSDK; -import com.nokia.carbide.cpp.sdk.core.SDKCorePlugin; -import com.nokia.cpp.internal.api.utils.core.*; - -import org.eclipse.core.resources.*; -import org.eclipse.core.runtime.*; -import org.w3c.dom.*; - -import java.io.File; -import java.text.MessageFormat; -import java.util.*; -import java.util.regex.Pattern; - -import javax.xml.parsers.*; - -public class SymbianBuildParser { - - private static final String RESOURCE_APPS = "resource" + File.separator + "apps"; //$NON-NLS-1$ - private static final String CDTBUILD_FILENAME = ".cdtbuild"; //$NON-NLS-1$ - private static final String OPTION = "option"; //$NON-NLS-1$ - private static final String TOOL = "tool"; //$NON-NLS-1$ - private static final String RES_CONF = "resourceConfiguration"; //$NON-NLS-1$ - private static final String ARTIFACT_EXTENSION = "artifactExtension"; //$NON-NLS-1$ - private static final String ARTIFACT_NAME = "artifactName"; //$NON-NLS-1$ - private static final String TOOL_CHAIN = "toolChain"; //$NON-NLS-1$ - private static final String CONFIGURATION = "configuration"; //$NON-NLS-1$ - private static final String LIST_OPTION_VALUE = "listOptionValue"; //$NON-NLS-1$ - private static final String VALUE = "value"; //$NON-NLS-1$ - private static final String ID = "id"; //$NON-NLS-1$ - private static final String PARENT = "parent"; //$NON-NLS-1$ - private static final String SUPER_CLASS = "superClass"; //$NON-NLS-1$ - private static final String RESOURCE_PATH = "resourcePath"; //$NON-NLS-1$ - private static final String PROJECT_TYPE = "projectType"; //$NON-NLS-1$ - private static final String EPOCROOT_VAR = "${EPOCROOT}"; //$NON-NLS-1$ - private static final String LANGUAGE_PREFIX = "LANGUAGE_"; //$NON-NLS-1$ - private static final String CAPABILITY = "capability"; //$NON-NLS-1$ - private static final String SECURE_ID = "secureid"; //$NON-NLS-1$ - private static final String VENDOR_ID = "vendorid"; //$NON-NLS-1$ - private static final String UID3 = "uid3"; //$NON-NLS-1$ - private static final String UID2 = "uid2"; //$NON-NLS-1$ - private static final String TARGET_TYPE = "targetType"; //$NON-NLS-1$ - private static final String STACK = "stack"; //$NON-NLS-1$ - private static final String TARGET_PATH = "targetPath"; //$NON-NLS-1$ - private static final String SYSTEM_INCLUDE_PATHS = "systemIncludePaths"; //$NON-NLS-1$ - private static final String LANGUAGES = "languages"; //$NON-NLS-1$ - private static final String LIBRARIES = "libraries"; //$NON-NLS-1$ - private static final String LIB_EXTENSION = "lib"; //$NON-NLS-1$ - private static final String MACROS = "macros"; //$NON-NLS-1$ - private static final String MBM = "mbm"; //$NON-NLS-1$ - private static final String MIF = "mif"; //$NON-NLS-1$ - private static final String DEFAULT_TARGET = HostOS.IS_WIN32 ? "untitled.exe" : "untitled"; //$NON-NLS-1$ //$NON-NLS-2$ - private static final String DEFAULT_TARGETTYPE = "exe"; //$NON-NLS-1$ - private static final String[] plaformMacros = { - "GCC32", "EPOC32", "MARM", "EABI", "GENERIC_MARM", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ - "MARM_ARMV5", "MARM_ARM4", "MARM_ARM4T", "ARMCC", "ARMCC_0", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ - "ARMCC_0_0", "ARM9E", "MARM_ARMI", "MARM_ARMV4", "ARMV6", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ - "ARMV6_ABIV2", "CW32", "TOOLS", "CWTOOLS", "WINS", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ - "WINSCW", "GCCE", "GCCXML", "SINGLE", "MARM_THUMB" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ - }; - private static Set platformMacroSet; - - private static final Pattern VARIABLE_PATTERN = Pattern.compile(".*\\$\\{.+\\}.*"); //$NON-NLS-1$ - private static final String PATTERN_PREFIX = ".*\\."; //$NON-NLS-1$ - private static final String PATTERN_SUFFIX = "(\\..*)?"; //$NON-NLS-1$ - private static final Pattern CAPABILITY_PATTERN = - Pattern.compile(PATTERN_PREFIX + CAPABILITY + PATTERN_SUFFIX); - private static final Pattern SECURE_ID_PATTERN = - Pattern.compile(PATTERN_PREFIX + SECURE_ID + PATTERN_SUFFIX); - private static final Pattern VENDOR_ID_PATTERN = - Pattern.compile(PATTERN_PREFIX + VENDOR_ID + PATTERN_SUFFIX); - private static final Pattern UID3_PATTERN = - Pattern.compile(PATTERN_PREFIX + UID3 + PATTERN_SUFFIX); - private static final Pattern UID2_PATTERN = - Pattern.compile(PATTERN_PREFIX + UID2 + PATTERN_SUFFIX); - private static final Pattern TARGET_TYPE_PATTERN = - Pattern.compile(PATTERN_PREFIX + TARGET_TYPE + PATTERN_SUFFIX); - private static final Pattern STACK_PATTERN = - Pattern.compile(PATTERN_PREFIX + STACK + PATTERN_SUFFIX); - private static final Pattern TARGET_PATH_PATTERN = - Pattern.compile(PATTERN_PREFIX + TARGET_PATH + PATTERN_SUFFIX); - private static final Pattern SYSTEM_INCLUDE_PATHS_PATTERN = - Pattern.compile(PATTERN_PREFIX + SYSTEM_INCLUDE_PATHS + PATTERN_SUFFIX); - private static final Pattern RCOMP_PATTERN = - Pattern.compile(PATTERN_PREFIX + "rcomp" + PATTERN_SUFFIX); //$NON-NLS-1$ - private static final Pattern RCOMP_DEFSYM_PATTERN = - Pattern.compile(PATTERN_PREFIX + "rcomp\\.general\\.definedSymbols" + PATTERN_SUFFIX); //$NON-NLS-1$ - private static final Pattern LINKER_PATTERN = - Pattern.compile(PATTERN_PREFIX + "linker" + PATTERN_SUFFIX); //$NON-NLS-1$ - private static final Pattern LINKER_LIBRARIES_PATTERN = - Pattern.compile(PATTERN_PREFIX + "linker\\.libraries\\.libraries" + PATTERN_SUFFIX); //$NON-NLS-1$ - private static final Pattern COMPILER_PATTERN = - Pattern.compile(PATTERN_PREFIX + "compiler" + PATTERN_SUFFIX); //$NON-NLS-1$ - private static final Pattern COMPILER_DEFSYM_PATTERN = - Pattern.compile(PATTERN_PREFIX + "compiler.definedSymbols" + PATTERN_SUFFIX); //$NON-NLS-1$ - private static final Pattern MBM_PATTERN = - Pattern.compile(PATTERN_PREFIX + MBM + PATTERN_SUFFIX); - private static final Pattern MBM_GENERAL_PATTERN = - Pattern.compile(PATTERN_PREFIX + "mbm.general.targetPath" + PATTERN_SUFFIX); //$NON-NLS-1$ - private static final Pattern MIF_PATTERN = - Pattern.compile(PATTERN_PREFIX + MIF + PATTERN_SUFFIX); - private static final Pattern MIF_GENERAL_PATTERN = - Pattern.compile(PATTERN_PREFIX + "mif.general.targetPath" + PATTERN_SUFFIX); //$NON-NLS-1$ - - static class ValueInfo { - private final String name; - private final Pattern pattern; - private final boolean isList; - private final IConverter converter; - public interface IConverter { - String convert(String value); - } - - public ValueInfo(String name, Pattern pattern, boolean isList, IConverter converter) { - this.name = name; - this.pattern = pattern; - this.isList = isList; - this.converter = converter; - } - public String parentTag() { return OPTION; } - public String name() { return name; } - public Pattern pattern() { return pattern; } - public boolean isList() { return isList; } - public IConverter converter() { return converter; } - } - - static class ToolInfo extends ValueInfo { - private final Pattern innerPattern; - public ToolInfo(String name, Pattern pattern, Pattern innerPattern, boolean isList, IConverter converter) { - super(name, pattern, isList, converter); - this.innerPattern = innerPattern; - } - public String parentTag() { return TOOL; } - public String innerTag() { return OPTION; } - public Pattern innerPattern() { return innerPattern; } - } - - private static ValueInfo[] toolChainValueInfos = { - new ValueInfo(CAPABILITY, CAPABILITY_PATTERN, false, null), - new ValueInfo(SECURE_ID, SECURE_ID_PATTERN, false, null), - new ValueInfo(VENDOR_ID, VENDOR_ID_PATTERN, false, null), - new ValueInfo(UID3, UID3_PATTERN, false, null), - new ValueInfo(UID2, UID2_PATTERN, false, null), - new ValueInfo(TARGET_TYPE, TARGET_TYPE_PATTERN, false, new IConverter() { - public String convert(String value) { - String[] strings = value.split("\\."); //$NON-NLS-1$ - if (strings.length == 0) - return value; - - return strings[strings.length - 1]; - } - }), - new ValueInfo(STACK, STACK_PATTERN, false, null), - new ValueInfo(TARGET_PATH, TARGET_PATH_PATTERN, false, null), - new ValueInfo(SYSTEM_INCLUDE_PATHS, SYSTEM_INCLUDE_PATHS_PATTERN, true, new IConverter() { - public String convert(String value) { - String pathString = TextUtils.unquote(value, '"'); - if (pathString.startsWith(EPOCROOT_VAR)) { - pathString = File.separator + pathString.substring(EPOCROOT_VAR.length()); //$NON-NLS-1$ - return pathString; - } - else if (!VARIABLE_PATTERN.matcher(pathString).matches()) // no other variables - return pathString; - - return null; - } - }), - new ToolInfo(LANGUAGES, RCOMP_PATTERN, RCOMP_DEFSYM_PATTERN, true, new IConverter() { - public String convert(String value) { - if (value.startsWith(LANGUAGE_PREFIX)) - return value.substring(LANGUAGE_PREFIX.length()); - - return null; - } - }), - new ToolInfo(LIBRARIES, LINKER_PATTERN, LINKER_LIBRARIES_PATTERN, true, new IConverter() { - public String convert(String value) { - String library = TextUtils.unquote(value, '"'); - IPath libPath = new Path(library); - libPath = new Path(libPath.lastSegment()); - String extension = FileUtils.getSafeFileExtension(libPath); - if (!extension.equalsIgnoreCase(LIB_EXTENSION)) { - libPath = libPath.removeFileExtension(); - libPath = libPath.addFileExtension(LIB_EXTENSION); - } - - return libPath.toString(); - } - }), - new ToolInfo(MACROS, COMPILER_PATTERN, COMPILER_DEFSYM_PATTERN, true, new IConverter() { - public String convert(String value) { - if (value.charAt(0) == '_' || isPlatformMacro(value)) - return null; - - return value; - } - }), - new ToolInfo(MBM, MBM_PATTERN, MBM_GENERAL_PATTERN, false, null), - new ToolInfo(MIF, MIF_PATTERN, MIF_GENERAL_PATTERN, false, null) - }; - - private Document document; - private List configurations; - private Element defaultConfiguration; - private Map configurationToContextMap; - private Map valueStrings; - private Map> valueSets; - private Map targetPaths; - - private SymbianBuildParser() { - } - - public static SymbianBuildParser createParser(IProject project, String defaultConfigKey) { - SymbianBuildParser parser = new SymbianBuildParser(); - IResource resource = project.findMember(CDTBUILD_FILENAME); - if (resource == null) - return null; - - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - DocumentBuilder db = null; - try { - db = dbf.newDocumentBuilder(); - } - catch (ParserConfigurationException e) { - Check.checkContract(false); // should never occur - } - Check.checkState(db != null); - IFile iFile = (IFile) resource.getAdapter(IFile.class); - String fileLocation = iFile.getLocation().toString(); - File file = new File(fileLocation); - try { - parser.document = db.parse(file); - } catch (Exception e) { - ProjectCorePlugin p = ProjectCorePlugin.getDefault(); - String message = - MessageFormat.format(Messages.getString("SymbianBuildParser.ParseFileError"), new Object[] { fileLocation }); //$NON-NLS-1$ - Logging.log(p, Logging.newSimpleStatus(p, IStatus.ERROR, message, e)); - return null; - } - - NodeList list = - parser.document.getElementsByTagName(CONFIGURATION); - // create SymbianBuildContext list by parsing info from the configurations - parser.createSymbianBuildContexts(list); - parser.getSortedConfigurations(); - - // default to first config, but try to set from persistent key - parser.setDefaultConfigurationId(defaultConfigKey); - - parser.scanToolChain(); - parser.scanResourceConfigurations(); - - return parser; - } - - private void scanResourceConfigurations() { - targetPaths = new LinkedHashMap(); - for (Element configuration : configurations) { - NodeList resConfigs = configuration.getElementsByTagName(RES_CONF); - for (int i = 0; i < resConfigs.getLength(); i++) { - Element resConfig = (Element) resConfigs.item(i); - String resourcePath = resConfig.getAttribute(RESOURCE_PATH); - if (resourcePath != null - && resourcePath.length() > 0 && - !targetPaths.containsKey(resourcePath)) { - String targetPath = getTargetPathValue(resConfig); - if (targetPath != null) - targetPaths.put(resourcePath, targetPath); - } - } - } - } - - private String getTargetPathValue(Element resourceConfig) { - String targetPath = null; - NodeList tools = resourceConfig.getElementsByTagName(TOOL); - int numTools = tools.getLength(); - for (int i = 0; i < numTools; i++) { - Element tool = (Element) tools.item(i); - NodeList options = tool.getElementsByTagName(OPTION); - int numOptions = options.getLength(); - Check.checkState(numOptions <= 1); - if (numOptions != 0) { - Element option = (Element) options.item(0); - targetPath = option.getAttribute(VALUE); - break; - } - } - - return targetPath; - } - - private void scanToolChain() { - valueStrings = new LinkedHashMap(); - valueSets = new LinkedHashMap>(); - for (int i = 0; i < toolChainValueInfos.length; i++) { - boolean found = false; - for (Element configuration : configurations) { - Element toolChain = getToolChain(configuration); - ValueInfo valueInfo = toolChainValueInfos[i]; - NodeList options = toolChain.getElementsByTagName(valueInfo.parentTag()); - found = scanToolChainOptions(options, valueInfo); - if (found) - break; - } - } - } - - private boolean scanToolChainOptions(NodeList options, ValueInfo valueInfo) { - boolean found = false; - for (int i = 0; i < options.getLength(); i++) { - Element element = (Element) options.item(i); - String attribute = element.getAttribute(SUPER_CLASS); - if (valueInfo.pattern().matcher(attribute).matches()) { - element = checkToolInfo(element, valueInfo); - if (element == null) - continue; - if (valueInfo.isList()) { - // if it's a list, get the list option values - NodeList list = element.getElementsByTagName(LIST_OPTION_VALUE); - if (list.getLength() > 0) { - Set set = getValueSet(valueInfo.name()); - for (int j = 0; j < list.getLength(); j++) { - Element listItem = (Element) list.item(j); - addValueStringToSet(set, listItem.getAttribute(VALUE), valueInfo); - } - } - } - else { - // get the string value - addValueStringToMap(valueStrings, valueInfo.name(), element.getAttribute(VALUE), valueInfo); - found = true; - break; - } - } - } - return found; - } - - private static Element checkToolInfo(Element element, ValueInfo valueInfo) { - if (valueInfo instanceof ToolInfo) { - ToolInfo toolInfo = (ToolInfo) valueInfo; - NodeList tools = element.getElementsByTagName(toolInfo.innerTag()); - for (int i = 0; i < tools.getLength(); i++) { - Element tool = (Element) tools.item(i); - String attribute = tool.getAttribute(SUPER_CLASS); - if (toolInfo.innerPattern().matcher(attribute).matches()) { - if (valueInfo.isList()) - return element; // return the parent tool element to get the list options from - else { - // return the option child element - NodeList options = element.getElementsByTagName(OPTION); - if (options.getLength() > 0) - return (Element) options.item(0); - } - } - } - - return null; - } - else - return element; - } - - private Set getValueSet(String name) { - Set set = valueSets.get(name); - if (set == null) { - set = new LinkedHashSet(); - valueSets.put(name, set); - } - - return set; - } - - private static void addValueStringToSet(Set set, String value, ValueInfo valueInfo) { - if (valueInfo.converter() != null) { - value = valueInfo.converter().convert(value); - } - if (value != null) - set.add(value); - } - - private static void addValueStringToMap(Map map, String key, String value, ValueInfo valueInfo) { - if (valueInfo.converter() != null) { - value = valueInfo.converter().convert(value); - } - if (value != null) - map.put(key, value); - } - - private void getSortedConfigurations() { - // sort the emulator platforms down, so that device values will have higher priority - configurations = new ArrayList(); - configurations.addAll(configurationToContextMap.keySet()); - Collections.sort(configurations, new Comparator() { - public int compare(Element o1, Element o2) { - ISymbianBuildContext symbianBuildContext1 = configurationToContextMap.get(o1); - if (symbianBuildContext1 == null) - return 0; - String platform1 = symbianBuildContext1.getPlatformString(); - ISymbianBuildContext symbianBuildContext2 = configurationToContextMap.get(o2); - if (symbianBuildContext2 == null) - return 0; - String platform2 = symbianBuildContext2.getPlatformString(); - if (platform1.equals(ISymbianBuildContext.EMULATOR_PLATFORM)) - return 1; - else if (platform2.equals(ISymbianBuildContext.EMULATOR_PLATFORM)) - return -1; - return 0; - } - }); - } - - private Element getToolChain(Element configuration) { - NodeList toolChains = configuration.getElementsByTagName(TOOL_CHAIN); - // tool chain should be unique - Check.checkState(toolChains.getLength() == 1); - return (Element) toolChains.item(0); - } - - private void setDefaultConfigurationId(String id) { - if (id == null) { - // No default config -- likely because it was checked out from CVS - // and the default references a nonexistent SDK. Just pick the first one. - if (configurations.size() > 0) { - defaultConfiguration = configurations.get(0); - } - return; - } - - for (Element element : configurations) { - String attribute = element.getAttribute(ID); - if (id.equals(attribute)) { - defaultConfiguration = element; - break; - } - } - - if (defaultConfiguration == null) { - // no matches, so pick the first one - if (configurations.size() > 0) { - defaultConfiguration = configurations.get(0); - } - } - } - - private ISymbianBuildContext parseConfigurationId(String configurationId) { - // E.g., S60_2nd_FP3_com.symbian.cdt.build.projectType.pdll_thumb.urel_S60_2nd_FP3 - // ...projectType.._ - - int curIndex = configurationId.indexOf(PROJECT_TYPE); - if (curIndex < 0) { - return null; - } - configurationId = configurationId.substring(curIndex + PROJECT_TYPE.length() + 1); - curIndex = configurationId.indexOf('_') + 1; - if (curIndex < 0) { - return null; - } - configurationId = configurationId.substring(curIndex); - String[] strings = configurationId.split("\\."); //$NON-NLS-1$ - if (strings.length != 2) { - return null; - } - String platform = strings[0].toUpperCase(); - curIndex = strings[1].indexOf('_'); - if (curIndex < 0) { - return null; - } - String target = strings[1].substring(0, curIndex).toUpperCase(); - String sdk = strings[1].substring(target.length() + 1); - ISymbianSDK symbianSDK = SDKCorePlugin.getSDKManager().getSDK(sdk, true); - if (symbianSDK == null) { - return null; - } - return new SymbianBuildContext(symbianSDK, platform, target); - } - - private void createSymbianBuildContexts(NodeList list) { - if (configurationToContextMap == null) - configurationToContextMap = new LinkedHashMap(); - - for (int i = 0; i < list.getLength(); i++) { - Element configuration = (Element) list.item(i); - // parent is id but without unique numerical value which we don't need - String configurationId = configuration.getAttribute(PARENT); - ISymbianBuildContext context = parseConfigurationId(configurationId); - configurationToContextMap.put(configuration, context); - } - } - - private static boolean isPlatformMacro(String s) { - if (platformMacroSet == null) { - platformMacroSet = new HashSet(); - for (int i = 0; i < plaformMacros.length; i++) { - platformMacroSet.add(plaformMacros[i]); - } - } - return platformMacroSet.contains(s); - } - - public String getTarget() { - if (defaultConfiguration == null) - return DEFAULT_TARGET; - - String target = defaultConfiguration.getAttribute(ARTIFACT_NAME); - target += '.'; - target += defaultConfiguration.getAttribute(ARTIFACT_EXTENSION); - - return target; - } - - public String getTargetType() { - String targetType = valueStrings.get(TARGET_TYPE); - if (targetType == null) { // turenki sometimes left this out, so best approximation - if (defaultConfiguration != null) - targetType = defaultConfiguration.getAttribute(ARTIFACT_EXTENSION); - else - targetType = DEFAULT_TARGETTYPE; - } - - return targetType; - } - - public String getUID2() { - String uid2 = valueStrings.get(UID2); - - return uid2; - } - - public String getUID3() { - String uid3 = valueStrings.get(UID3); - - return uid3; - } - - public String getVendorId() { - String vendorId = valueStrings.get(VENDOR_ID); - - return vendorId; - } - - public String getSecureId() { - String secureId = valueStrings.get(SECURE_ID); - - return secureId; - } - - public String getCapability() { - String capability = valueStrings.get(CAPABILITY); - - return capability; - } - - public String getStack() { - String stack = valueStrings.get(STACK); - - return stack; - } - - public String getTargetPath() { - String targetPath = valueStrings.get(TARGET_PATH); - - return targetPath; - } - - public String getMBMTargetPath() { - String mbmTargetPath = valueStrings.get(MBM); - if (mbmTargetPath == null) - mbmTargetPath = ""; //$NON-NLS-1$ - - return mbmTargetPath; - } - - public String getMIFTargetPath() { - String mifTargetPath = valueStrings.get(MIF); - if (mifTargetPath == null) - mifTargetPath = RESOURCE_APPS; - return mifTargetPath; - } - - public Collection getBuildContexts() { - // create result, but put the default configuration first so that it will be made default - List buildContextList = new ArrayList(); - - if (configurationToContextMap == null) - return buildContextList; - - for (Element config : configurationToContextMap.keySet()) { - ISymbianBuildContext symbianBuildContext = configurationToContextMap.get(config); - if (symbianBuildContext == null) - continue; - - if (config.equals(defaultConfiguration)) - buildContextList.add(0, symbianBuildContext); - else - buildContextList.add(symbianBuildContext); - } - - return buildContextList; - } - - public ISymbianBuildContext getDefaultBuildContext() { - if (defaultConfiguration == null) - return null; - return parseConfigurationId(defaultConfiguration.getAttribute(PARENT)); - } - - public Collection getSystemIncludePaths() { - return valueSets.get(SYSTEM_INCLUDE_PATHS); - } - - public Collection getLanguages() { - return valueSets.get(LANGUAGES); - } - - public Collection getLibraries() { - return valueSets.get(LIBRARIES); - } - - public Collection getMacros() { - return valueSets.get(MACROS); - } - - public Map getTargetPathMappings() { - return targetPaths; - } -} diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/SymbianProjectInfo.java --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/SymbianProjectInfo.java Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,203 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -package com.nokia.carbide.cpp.internal.project.core.updater; - -import org.eclipse.core.resources.*; -import org.eclipse.core.runtime.*; - -import java.util.*; - -/** - * A class encapsulating a single project for updating - */ -public class SymbianProjectInfo { - - private static final String INF = "inf"; //$NON-NLS-1$ - private static final String MMP = "mmp"; //$NON-NLS-1$ - private static final String CPP = "cpp"; //$NON-NLS-1$ - private static final String C = "c"; //$NON-NLS-1$ - private static final String H = "h"; //$NON-NLS-1$ - private static final String RSS = "rss"; //$NON-NLS-1$ - private static final String AIFDEF = "aifdef"; //$NON-NLS-1$ - private static final String MBMDEF = "mbmdef"; //$NON-NLS-1$ - private static final String MIFDEF = "mifdef"; //$NON-NLS-1$ - private static final String BLD_INF = "bld.inf"; //$NON-NLS-1$ - - private IProject project; - private IPath bldInfPath; - private IPath groupFolderPath; - private Set userIncludePaths = new HashSet(); - private List sourceFiles = new ArrayList(); - private List rssFiles = new ArrayList(); - private List mifdefFiles = new ArrayList(); - private List mbmdefFiles = new ArrayList(); - private List aifdefFiles = new ArrayList(); - private List mmpFiles = new ArrayList(); - - private SymbianProjectInfo(IProject project) { - this.project = project; - } - - public static SymbianProjectInfo createProjectInfo(IProject project) throws CoreException { - final SymbianProjectInfo symbianProjectInfo = new SymbianProjectInfo(project); - - project.accept(new IResourceProxyVisitor() { - public boolean visit(IResourceProxy proxy) throws CoreException { - // ignore generated files (which includes an unwanted winscw_uid.cpp) - if (proxy.getType() == IResource.FOLDER) { - if (proxy.getName().equalsIgnoreCase(".generated")) { //$NON-NLS-1$ - return false; - } - return true; - } - symbianProjectInfo.recordFileInfo(proxy); - return true; - } - }, IResource.NONE); - - - return symbianProjectInfo; - } - - private void recordFileInfo(IResourceProxy proxy) { - if (proxy.getType() != IResource.FILE) - return; - - String fileName = proxy.getName(); - String extension = (new Path(fileName)).getFileExtension(); - if (CPP.equalsIgnoreCase(extension) || C.equalsIgnoreCase(extension)) - recordSourceFile(proxy); - else if (H.equalsIgnoreCase(extension)) - recordIncludePath(proxy); - else if (RSS.equalsIgnoreCase(extension)) - recordRSS(proxy); - else if (AIFDEF.equalsIgnoreCase(extension)) - recordAIFDEF(proxy); - else if (MBMDEF.equalsIgnoreCase(extension)) - recordMBMDEF(proxy); - else if (MIFDEF.equalsIgnoreCase(extension)) - recordMIFDEF(proxy); - else if (INF.equalsIgnoreCase(extension)) - recordInf(proxy); - else if (MMP.equalsIgnoreCase(extension)) - recordMMP(proxy); - } - - private void recordMIFDEF(IResourceProxy proxy) { - IResource resource = proxy.requestResource(); - IPath path = resource.getLocation(); - mifdefFiles.add(path); - } - - private void recordMBMDEF(IResourceProxy proxy) { - IResource resource = proxy.requestResource(); - IPath path = resource.getLocation(); - mbmdefFiles.add(path); - } - - private void recordAIFDEF(IResourceProxy proxy) { - IResource resource = proxy.requestResource(); - IPath path = resource.getLocation(); - aifdefFiles.add(path); - } - - private void recordRSS(IResourceProxy proxy) { - IResource resource = proxy.requestResource(); - IPath path = resource.getLocation(); - rssFiles.add(path); - } - - private void recordIncludePath(IResourceProxy proxy) { - IResource resource = proxy.requestResource().getParent(); - IPath path = resource.getLocation(); - userIncludePaths.add(path); - } - - private void recordSourceFile(IResourceProxy proxy) { - IResource resource = proxy.requestResource(); - IPath path = resource.getLocation(); - sourceFiles.add(path); - } - - private void recordMMP(IResourceProxy proxy) { - IResource resource = proxy.requestResource(); - IPath path = resource.getLocation(); - mmpFiles.add(path); - } - - private void recordInf(IResourceProxy proxy) { - // only record the first bld.inf - if (bldInfPath == null) { - IResource resource = proxy.requestResource(); - IPath path = resource.getLocation(); - String fileName = path.lastSegment(); - if (fileName.equalsIgnoreCase(BLD_INF)) { - bldInfPath = path; - } - } - } - - public IPath getGroupFolderPath() { - if (groupFolderPath == null) { - if (bldInfPath != null) - groupFolderPath = bldInfPath.removeLastSegments(1); - else { - for (IPath mmpPath : mmpFiles) { - groupFolderPath = mmpPath.removeLastSegments(1); - break; - } - } - if (groupFolderPath == null) - groupFolderPath = project.getLocation(); - } - return groupFolderPath; - } - - public Collection getAifdefFiles() { - return aifdefFiles; - } - - public IPath getBldInfPath() { - return bldInfPath; - } - - public Collection getMbmdefFiles() { - return mbmdefFiles; - } - - public Collection getMifdefFiles() { - return mifdefFiles; - } - - public Collection getRssFiles() { - return rssFiles; - } - - public Collection getSourceFiles() { - return sourceFiles; - } - - public Collection getUserIncludePaths() { - return userIncludePaths; - } - - public Collection getMmpFiles() { - return mmpFiles; - } -} diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/UpdateProjectsScanner.java --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/UpdateProjectsScanner.java Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,196 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ -package com.nokia.carbide.cpp.internal.project.core.updater; - -import com.nokia.carbide.cdt.builder.DefaultViewConfiguration; -import com.nokia.carbide.cdt.builder.EpocEnginePathHelper; -import com.nokia.carbide.cpp.epoc.engine.EpocEnginePlugin; -import com.nokia.carbide.cpp.epoc.engine.IBldInfViewRunnable; -import com.nokia.carbide.cpp.epoc.engine.model.bldinf.IBldInfView; -import com.nokia.carbide.cpp.epoc.engine.model.bldinf.IMMPReference; -import com.nokia.carbide.cpp.epoc.engine.preprocessor.AllNodesViewFilter; -import com.nokia.carbide.cpp.internal.project.core.Messages; -import com.nokia.carbide.cpp.project.core.ProjectCorePlugin; -import com.nokia.carbide.updater.extension.IUpdateProjectsScanner; -import com.nokia.cpp.internal.api.utils.core.*; -import com.nokia.sdt.utils.ProjectFileResourceProxyVisitor; - -import org.eclipse.core.resources.*; -import org.eclipse.core.runtime.*; - -import java.text.MessageFormat; -import java.util.*; - -public class UpdateProjectsScanner implements IUpdateProjectsScanner { - - private static class BldInfViewRunnable implements IBldInfViewRunnable { - private final IWorkspaceRoot workspaceRoot; - private final EpocEnginePathHelper pathHelper; - private final IProject project; - - public BldInfViewRunnable(IWorkspaceRoot workspaceRoot, IProject project, EpocEnginePathHelper pathHelper) { - super(); - this.workspaceRoot = workspaceRoot; - this.project = project; - this.pathHelper = pathHelper; - } - - public Object failedLoad(CoreException exception) { - return null; - } - - public Object run(IBldInfView view) { - List linkedProjects = null; - IMMPReference[] allMMPReferences = view.getAllMMPReferences(); - if (allMMPReferences.length > 1) { - for (IMMPReference reference : allMMPReferences) { - IPath path = reference.getPath(); - IPath absPath = pathHelper.convertToFilesystem(path); - IFile[] files = workspaceRoot.findFilesForLocation(absPath); - for (IFile file : files) { - IProject mmpProject = file.getProject(); - if (!mmpProject.equals(project)) { - if (linkedProjects == null) { - linkedProjects = new ArrayList(); - linkedProjects.add(project); - } - - if (!linkedProjects.contains(mmpProject)) - linkedProjects.add(mmpProject); - } - } - } - } - return linkedProjects; - } - } - - private static final String INF = "inf"; //$NON-NLS-1$ - private Map excludedProjects = new HashMap(); - - public IStatus getProjectStatus(IProject project) { - IStatus status = excludedProjects.get(project); - if (status != null) - return status; - - return Status.OK_STATUS; - } - - public Collection scanProjects(List projectsToScan, IProgressMonitor monitor) { - IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); - monitor.beginTask(MessageFormat.format(Messages.getString("UpdateProjectsScanner.ScanningProjectsMessage"), new Object[0]), projectsToScan.size()); //$NON-NLS-1$ - for (IProject project : projectsToScan) { - if (!excludedProjects.containsKey(project)) { - checkLinkedFileProject(project, new SubProgressMonitor(monitor, 2)); - } - if (!excludedProjects.containsKey(project)) { - gatherAssociatedProjects(workspaceRoot, project, new SubProgressMonitor(monitor, 5)); - } - monitor.worked(1); - } - monitor.done(); - - return excludedProjects.keySet(); - } - - /** - * Check if project contains linked resources for exclusion - */ - private void checkLinkedFileProject(final IProject project, IProgressMonitor monitor) { - try { - project.accept(new IResourceProxyVisitor() { - public boolean visit(IResourceProxy proxy) throws CoreException { - if (excludedProjects.containsKey(project)) - return false; - - if (proxy.getType() == IResource.FILE) { - if (proxy.requestResource().isLinked()) { - String fileName = proxy.getName(); - String extension = FileUtils.getSafeFileExtension(new Path(fileName)); - if (extension.equalsIgnoreCase("cpp") || //$NON-NLS-1$ - extension.equalsIgnoreCase("rss")) { //$NON-NLS-1$ - // import from 1.0 w/o copying - excludedProjects.put(project, createStatusForLinkedResourceProject(project, true)); - return false; - } - } - } - else if (proxy.getType() == IResource.FOLDER) { - if (proxy.requestResource().isLinked()) { - // imported from 1.1 w/o copying - excludedProjects.put(project, createStatusForLinkedResourceProject(project, false)); - return false; - } - } - return true; - } - }, IResource.NONE); - } catch (CoreException e) { - } - - } - - /** - * Gather projects linked by same bld.inf file for exclusion - */ - private void gatherAssociatedProjects(IWorkspaceRoot workspaceRoot, IProject project, IProgressMonitor monitor) { - final EpocEnginePathHelper pathHelper = new EpocEnginePathHelper(project); - - ProjectFileResourceProxyVisitor visitor = new ProjectFileResourceProxyVisitor(INF, true); - try { - project.refreshLocal(IResource.DEPTH_INFINITE, monitor); - project.accept(visitor, IResource.NONE); - } catch (CoreException e) {} - List infFiles = visitor.getRequestedFiles(); - for (IPath path : infFiles) { - IPath wsInfPath = pathHelper.convertToWorkspace(path); - List linkedProjects = (List) EpocEnginePlugin.runWithBldInfView(wsInfPath, - new DefaultViewConfiguration(project, null, new AllNodesViewFilter()), - new BldInfViewRunnable(workspaceRoot, project, pathHelper)); - if (linkedProjects != null) { - for (IProject linkedProject : linkedProjects) { - IStatus status = createStatusForLinkedProjects(linkedProject, linkedProjects); - excludedProjects.put(linkedProject, status); - } - } - } - } - - private IStatus createStatusForLinkedProjects(IProject linkedProject, List linkedProjects) { - String message = - MessageFormat.format( - Messages.getString("UpdateProjectsScanner.LinkedProjectsMessage"), //$NON-NLS-1$ - new Object[] { linkedProject.getName() }); - for (IProject project : linkedProjects) { - if (!project.equals(linkedProject)) - message += MessageFormat.format(" ''{0}'' ", new Object[] { project.getName() }); //$NON-NLS-1$ - } - - return new Status(IStatus.ERROR, ProjectCorePlugin.PLUGIN_ID, 1, message, null); - } - - private IStatus createStatusForLinkedResourceProject(IProject project, boolean isFile) { - String fmt = isFile ? - Messages.getString("UpdateProjectScanner.LinkedFileProjectMessage") : //$NON-NLS-1$ - Messages.getString("UpdateProjectScanner.LinkedFolderProjectMessage"); //$NON-NLS-1$ - - String message = - MessageFormat.format(fmt, new Object[] { project.getName() }); - return new Status(IStatus.ERROR, ProjectCorePlugin.PLUGIN_ID, 2, message, null); - } - -} diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/UpdateTrigger.java --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/UpdateTrigger.java Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -package com.nokia.carbide.cpp.internal.project.core.updater; - -import com.nokia.carbide.updater.extension.IUpdateTrigger; - -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.*; - -/** - * Class implementing the com.nokia.carbide.updater.updateTrigger extension point - * - * This implementation will check that the project update dialog was shown at startup once - */ -public class UpdateTrigger extends AbstractUpdateTrigger implements IUpdateTrigger { - - private static final String LOCAL_KEY = ".updateTrigger"; - // use the version of Carbide updating to as the trigger property - private static final String TRIGGER_PROPERTY = "1.2.0"; //$NON-NLS-1$ - private static final String SYMBIAN_PERSPECTIVE_ID = "com.symbian.cdt.SymbianPerspective"; //$NON-NLS-1$ - - @Override - protected String getLocalKey() { - return LOCAL_KEY; - } - - @Override - protected String getTriggerProperty() { - return TRIGGER_PROPERTY; - } - - @Override - protected void postTriggerAction() { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - IWorkbench workbench = PlatformUI.getWorkbench(); - IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); - if (window == null) - return; - IWorkbenchPage page = window.getActivePage(); - if (page == null) - return; - String id; - if (isIntroViewActive(page)) - return; - IPerspectiveDescriptor descriptor = - workbench.getPerspectiveRegistry().findPerspectiveWithId(CARBIDE_PERSPECTIVE_ID); - page.setPerspective(descriptor); - IPerspectiveDescriptor[] perspectives = page.getSortedPerspectives(); - for (int i = 0; i < perspectives.length; i++) { - descriptor = perspectives[i]; - id = descriptor.getId(); - if (id.equals(SYMBIAN_PERSPECTIVE_ID)) { - page.closePerspective(descriptor, true, true); - break; - } - } - } - }); - } - -} diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/UpdateTrigger13.java --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/UpdateTrigger13.java Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -package com.nokia.carbide.cpp.internal.project.core.updater; - -import com.nokia.carbide.updater.extension.IUpdateTrigger; - -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.*; - -/** - * Class implementing the com.nokia.carbide.updater.updateTrigger extension point - * - * This implementation will check that the project update dialog was shown at startup once - */ -public class UpdateTrigger13 extends AbstractUpdateTrigger implements IUpdateTrigger { - - private static final String LOCAL_KEY = ".updateTrigger13"; - // use the version of Carbide updating to as the trigger property - private static final String TRIGGER_PROPERTY = "1.3.0"; //$NON-NLS-1$ - - @Override - protected String getLocalKey() { - return LOCAL_KEY; - } - - @Override - protected String getTriggerProperty() { - return TRIGGER_PROPERTY; - } - - @Override - protected void postTriggerAction() { - Display.getDefault().asyncExec(new Runnable() { - public void run() { - IWorkbench workbench = PlatformUI.getWorkbench(); - IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); - if (window == null) - return; - IWorkbenchPage page = window.getActivePage(); - if (page == null) - return; - if (isIntroViewActive(page)) - return; - IPerspectiveDescriptor descriptor = - workbench.getPerspectiveRegistry().findPerspectiveWithId(CARBIDE_PERSPECTIVE_ID); - page.setPerspective(descriptor); - page.resetPerspective(); - } - }); - } - -} diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/UpdateTrigger131.java --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/UpdateTrigger131.java Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -package com.nokia.carbide.cpp.internal.project.core.updater; - -import com.nokia.carbide.updater.extension.IUpdateTrigger; - -/** - * Class implementing the com.nokia.carbide.updater.updateTrigger extension point - * - * This implementation will check that the project update dialog was shown at startup once - */ -public class UpdateTrigger131 extends AbstractUpdateTrigger implements IUpdateTrigger { - - private static final String LOCAL_KEY = ".updateTrigger131"; - // use the version of Carbide updating to as the trigger property - private static final String TRIGGER_PROPERTY = "1.3.1"; //$NON-NLS-1$ - - @Override - protected String getLocalKey() { - return LOCAL_KEY; - } - - @Override - protected String getTriggerProperty() { - return TRIGGER_PROPERTY; - } - - @Override - protected void postTriggerAction() { - } - -} diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/addressbook.cdtbuild.xml --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/addressbook.cdtbuild.xml Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1326 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/birthdays.cdtbuild.xml --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/birthdays.cdtbuild.xml Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1005 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/sample1.cdtbuild.xml --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/sample1.cdtbuild.xml Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,443 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/sample2.cdtbuild.xml --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/sample2.cdtbuild.xml Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,493 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/sample3.cdtbuild.xml --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/sample3.cdtbuild.xml Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1638 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/sample4.cdtbuild.xml --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/sample4.cdtbuild.xml Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2530 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r f19bf50481c7 -r ce1819266def project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/sample5.cdtbuild.xml --- a/project/com.nokia.carbide.cpp.project.core/src/com/nokia/carbide/cpp/internal/project/core/updater/sample5.cdtbuild.xml Mon May 24 08:44:13 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1962 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file