mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Changed the buildInfoVersion to 3.1
This commit is contained in:
parent
b2265fc025
commit
be6e4036d8
4 changed files with 87 additions and 4 deletions
|
@ -135,7 +135,7 @@ public class ManagedBuildManager extends AbstractCExtension implements IScannerI
|
||||||
private static final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
|
private static final String NEWLINE = System.getProperty("line.separator"); //$NON-NLS-1$
|
||||||
|
|
||||||
// This is the version of the manifest and project files
|
// This is the version of the manifest and project files
|
||||||
private static final PluginVersionIdentifier buildInfoVersion = new PluginVersionIdentifier(3, 0, 0);
|
private static final PluginVersionIdentifier buildInfoVersion = new PluginVersionIdentifier(3, 1, 0);
|
||||||
private static Map depCalculatorsMap;
|
private static Map depCalculatorsMap;
|
||||||
private static boolean projectTypesLoaded = false;
|
private static boolean projectTypesLoaded = false;
|
||||||
private static boolean projectTypesLoading = false;
|
private static boolean projectTypesLoading = false;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005 Intel Corporation and others.
|
* Copyright (c) 2005, 2006 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -68,7 +68,7 @@ class UpdateManagedProject21 {
|
||||||
|
|
||||||
// No physical conversion is need since the 3.0 model is a superset of the 2.1 model
|
// No physical conversion is need since the 3.0 model is a superset of the 2.1 model
|
||||||
// We need to upgrade the version
|
// We need to upgrade the version
|
||||||
((ManagedBuildInfo)info).setVersion(ManagedBuildManager.getBuildInfoVersion().toString());
|
((ManagedBuildInfo)info).setVersion("3.0.0"); //$NON-NLS-1$
|
||||||
info.setValid(true);
|
info.setValid(true);
|
||||||
|
|
||||||
// Save the updated file.
|
// Save the updated file.
|
||||||
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
/*******************************************************************************
|
||||||
|
* Copyright (c) 2006 Intel Corporation and others.
|
||||||
|
* All rights reserved. This program and the accompanying materials
|
||||||
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
* which accompanies this distribution, and is available at
|
||||||
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
*
|
||||||
|
* Contributors:
|
||||||
|
* Intel Corporation - Initial API and implementation
|
||||||
|
*******************************************************************************/
|
||||||
|
package org.eclipse.cdt.managedbuilder.projectconverter;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
|
||||||
|
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||||
|
import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
|
||||||
|
import org.eclipse.core.resources.IFile;
|
||||||
|
import org.eclipse.core.resources.IProject;
|
||||||
|
import org.eclipse.core.resources.IWorkspace;
|
||||||
|
import org.eclipse.core.resources.WorkspaceJob;
|
||||||
|
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.jobs.ISchedulingRule;
|
||||||
|
import org.eclipse.core.runtime.jobs.MultiRule;
|
||||||
|
|
||||||
|
public class UpdateManagedProject30 {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param monitor the monitor to allow users to cancel the long-running operation
|
||||||
|
* @param project the <code>IProject</code> that needs to be upgraded
|
||||||
|
* @throws CoreException
|
||||||
|
*/
|
||||||
|
static void doProjectUpdate(IProgressMonitor monitor, final IProject project) throws CoreException {
|
||||||
|
String[] projectName = new String[]{project.getName()};
|
||||||
|
IFile file = project.getFile(ManagedBuildManager.SETTINGS_FILE_NAME);
|
||||||
|
File settingsFile = file.getLocation().toFile();
|
||||||
|
if (!settingsFile.exists()) {
|
||||||
|
monitor.done();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Backup the file
|
||||||
|
monitor.beginTask(ConverterMessages.getFormattedString("UpdateManagedProject20.0", projectName), 1); //$NON-NLS-1$
|
||||||
|
IManagedBuildInfo info = ManagedBuildManager.getBuildInfo(project);
|
||||||
|
UpdateManagedProjectManager.backupFile(file, "_30backup", monitor, project); //$NON-NLS-1$
|
||||||
|
|
||||||
|
// No physical conversion is need since the 3.1 model is a superset of the 3.0 model
|
||||||
|
// We need to upgrade the version
|
||||||
|
((ManagedBuildInfo)info).setVersion(ManagedBuildManager.getBuildInfoVersion().toString());
|
||||||
|
info.setValid(true);
|
||||||
|
|
||||||
|
// Save the updated file.
|
||||||
|
IWorkspace workspace = project.getWorkspace();
|
||||||
|
// boolean treeLock = workspace.isTreeLocked();
|
||||||
|
ISchedulingRule rule1 = workspace.getRuleFactory().createRule(project);
|
||||||
|
ISchedulingRule rule2 = workspace.getRuleFactory().refreshRule(project);
|
||||||
|
ISchedulingRule rule = MultiRule.combine(rule1, rule2);
|
||||||
|
//since the java synchronized mechanism is now used for the build info loadding,
|
||||||
|
//initiate the job in all cases
|
||||||
|
// if (treeLock) {
|
||||||
|
WorkspaceJob job = new WorkspaceJob(ConverterMessages.getResourceString("UpdateManagedProject.notice")) { //$NON-NLS-1$
|
||||||
|
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
|
||||||
|
ManagedBuildManager.saveBuildInfo(project, true);
|
||||||
|
return Status.OK_STATUS;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
job.setRule(rule);
|
||||||
|
job.schedule();
|
||||||
|
// } else {
|
||||||
|
// checkForCPPWithC(monitor, project);
|
||||||
|
// ManagedBuildManager.saveBuildInfo(project, true);
|
||||||
|
// }
|
||||||
|
monitor.done();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2005 Intel Corporation and others.
|
* Copyright (c) 2004, 2006 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -314,6 +314,10 @@ public class UpdateManagedProjectManager {
|
||||||
UpdateManagedProject21.doProjectUpdate(monitor, fProject);
|
UpdateManagedProject21.doProjectUpdate(monitor, fProject);
|
||||||
version = getManagedBuildInfoVersion(info.getVersion());
|
version = getManagedBuildInfoVersion(info.getVersion());
|
||||||
}
|
}
|
||||||
|
if(version.isEquivalentTo(new PluginVersionIdentifier(3,0,0))){
|
||||||
|
UpdateManagedProject30.doProjectUpdate(monitor, fProject);
|
||||||
|
version = getManagedBuildInfoVersion(info.getVersion());
|
||||||
|
}
|
||||||
|
|
||||||
if(!isCompatibleProject(info)){
|
if(!isCompatibleProject(info)){
|
||||||
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
|
throw new CoreException(new Status(IStatus.ERROR, ManagedBuilderCorePlugin.getUniqueIdentifier(), -1,
|
||||||
|
|
Loading…
Add table
Reference in a new issue