From 83d47c3329ba4030e242b28ceed2b5fa5b48e9b1 Mon Sep 17 00:00:00 2001 From: Mikhail Sennikovsky Date: Thu, 24 May 2007 12:47:15 +0000 Subject: [PATCH] Output entries settings fixes --- .../model/ExternalSettingsProviderTests.java | 4 ++-- .../cdt/core/settings/model/COutputEntry.java | 6 +++--- .../core/settings/model/util/CDataUtil.java | 18 +++++++++--------- .../model/util/PathEntryTranslator.java | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/ExternalSettingsProviderTests.java b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/ExternalSettingsProviderTests.java index aeb0616159a..f33dc0aeb14 100644 --- a/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/ExternalSettingsProviderTests.java +++ b/core/org.eclipse.cdt.core.tests/model/org/eclipse/cdt/core/settings/model/ExternalSettingsProviderTests.java @@ -257,8 +257,8 @@ public class ExternalSettingsProviderTests extends BaseTestCase{ cfgDes.getBuildSetting().setOutputDirectories(null); ICOutputEntry[] expectedOutputEntries = new ICOutputEntry[]{ - new COutputEntry("op_a", null, 0), - new COutputEntry("op_b", null, 0), + new COutputEntry(project.getFullPath().append("op_a"), null, 0), + new COutputEntry(project.getFullPath().append("op_b"), null, 0), }; ICOutputEntry[] outputEntries = cfgDes.getBuildSetting().getOutputDirectories(); assertEquals(2, outputEntries.length); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/COutputEntry.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/COutputEntry.java index 0586f9ac845..a256d3551e5 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/COutputEntry.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/COutputEntry.java @@ -16,15 +16,15 @@ import org.eclipse.core.runtime.IPath; public final class COutputEntry extends ACExclusionFilterEntry implements ICOutputEntry { public COutputEntry(IPath path, IPath exclusionPatterns[], int flags) { - super(path, exclusionPatterns, flags); + super(path, exclusionPatterns, flags | VALUE_WORKSPACE_PATH); } public COutputEntry(IFolder folder, IPath exclusionPatterns[], int flags) { - super(folder, exclusionPatterns, flags); + super(folder, exclusionPatterns, flags | VALUE_WORKSPACE_PATH); } public COutputEntry(String value, IPath exclusionPatterns[], int flags) { - super(value, exclusionPatterns, flags); + super(value, exclusionPatterns, flags | VALUE_WORKSPACE_PATH); } public final int getKind() { diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataUtil.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataUtil.java index c9e9a1455ba..d4c909355e7 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataUtil.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/CDataUtil.java @@ -789,7 +789,7 @@ public class CDataUtil { if(entries == null || entries.length == 0) return getDefaultOutputEntries(makeAbsolute, project); - return makeAbsolute ? checkMakeAbsolute(project, entries) : checkMakeRelative(project, entries); + return makeAbsolute ? makeAbsolute(project, entries) : makeRelative(project, entries); } public static ICSourceEntry[] adjustEntries(ICSourceEntry entries[], boolean makeAbsolute, IProject project){ @@ -873,20 +873,20 @@ public class CDataUtil { return (ICSourceEntry[])makeAbsolute(project, entries, true); } - public static ICOutputEntry checkMakeAbsolute(IProject project, ICOutputEntry entry){ - return (ICOutputEntry)makeAbsolute(project, entry, false); + public static ICOutputEntry makeAbsolute(IProject project, ICOutputEntry entry){ + return (ICOutputEntry)makeAbsolute(project, entry, true); } - public static ICOutputEntry checkMakeRelative(IProject project, ICOutputEntry entry){ - return (ICOutputEntry)makeRelative(project, entry, false); + public static ICOutputEntry makeRelative(IProject project, ICOutputEntry entry){ + return (ICOutputEntry)makeRelative(project, entry, true); } - public static ICOutputEntry[] checkMakeAbsolute(IProject project, ICOutputEntry[] entries){ - return (ICOutputEntry[])makeAbsolute(project, entries, false); + public static ICOutputEntry[] makeAbsolute(IProject project, ICOutputEntry[] entries){ + return (ICOutputEntry[])makeAbsolute(project, entries, true); } - public static ICOutputEntry[] checkMakeRelative(IProject project, ICOutputEntry[] entries){ - return (ICOutputEntry[])makeRelative(project, entries, false); + public static ICOutputEntry[] makeRelative(IProject project, ICOutputEntry[] entries){ + return (ICOutputEntry[])makeRelative(project, entries, true); } private static Collection removePrefix(IPath prefix, Collection paths, Collection result){ diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java index b4032d22e7b..eadf68586ca 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/settings/model/util/PathEntryTranslator.java @@ -977,7 +977,7 @@ public class PathEntryTranslator { Map nameKeyMap = getEntriesNameKeyMap(kind, true); for(int i = 0; i < entries.length; i++){ ICExclusionPatternPathEntry entry = entries[i]; - entry = CDataUtil.makeAbsolute(fProject, entry, kind == ICSettingEntry.SOURCE_PATH); + entry = CDataUtil.makeAbsolute(fProject, entry, true); EntryNameKey nameKey = new EntryNameKey(entry); PathEntryComposer old = (PathEntryComposer)nameKeyMap.get(nameKey); if(old != null){ @@ -1724,8 +1724,8 @@ public class PathEntryTranslator { } ICOutputEntry[] oldEntries = bData.getOutputDirectories(); - oldEntries = (ICOutputEntry[])CDataUtil.makeRelative(fProject, oldEntries, false); - entries = (ICOutputEntry[])CDataUtil.makeRelative(fProject, entries, false); + oldEntries = (ICOutputEntry[])CDataUtil.makeRelative(fProject, oldEntries, true); + entries = (ICOutputEntry[])CDataUtil.makeRelative(fProject, entries, true); entries = (ICOutputEntry[])replaceUserEntries(oldEntries, entries); switch (op) {