mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
save the preference when shutting down
This commit is contained in:
parent
fd19cbc055
commit
c7b33d247f
3 changed files with 11 additions and 12 deletions
|
@ -183,6 +183,7 @@ public class MakeCorePlugin extends Plugin {
|
|||
fDiscoveryPathManager.shutdown();
|
||||
fDiscoveryPathManager = null;
|
||||
}
|
||||
savePluginPreferences();
|
||||
} finally {
|
||||
super.stop(context);
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ import java.util.StringTokenizer;
|
|||
|
||||
import org.eclipse.cdt.make.core.MakeCorePlugin;
|
||||
import org.eclipse.cdt.make.core.makefile.IDirective;
|
||||
import org.eclipse.cdt.make.core.makefile.IMakefile;
|
||||
import org.eclipse.cdt.make.core.makefile.gnu.IGNUMakefile;
|
||||
import org.eclipse.cdt.make.internal.core.makefile.AbstractMakefile;
|
||||
import org.eclipse.cdt.make.internal.core.makefile.BadDirective;
|
||||
|
@ -775,7 +776,11 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
|
|||
for (int i = 0; i < dirs.length; ++i) {
|
||||
if (dirs[i] instanceof Include) {
|
||||
Include include = (Include)dirs[i];
|
||||
list.addAll(Arrays.asList(include.getDirectives()));
|
||||
IDirective[] includedMakefiles = include.getDirectives();
|
||||
for (int j = 0; j < includedMakefiles.length; ++j) {
|
||||
IMakefile includedMakefile = (IMakefile)includedMakefiles[j];
|
||||
list.addAll(Arrays.asList(includedMakefile.getDirectives()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return (IDirective[]) list.toArray(new IDirective[list.size()]);
|
||||
|
|
|
@ -41,17 +41,13 @@ public class Include extends Parent implements IInclude {
|
|||
}
|
||||
|
||||
public IDirective[] getDirectives() {
|
||||
GNUMakefile gnu = new GNUMakefile();
|
||||
clearDirectives();
|
||||
for (int i = 0; i < filenames.length; i++) {
|
||||
// Try the current directory.
|
||||
GNUMakefile gnu = new GNUMakefile();
|
||||
try {
|
||||
gnu.parse(filenames[i]);
|
||||
Directive[] subdirs = gnu.getStatements();
|
||||
addDirectives(subdirs);
|
||||
for (int k = 0; k < subdirs.length; ++k) {
|
||||
subdirs[k].setFilename(filenames[i]);
|
||||
}
|
||||
addDirective(gnu);
|
||||
continue;
|
||||
} catch (IOException e) {
|
||||
}
|
||||
|
@ -59,12 +55,9 @@ public class Include extends Parent implements IInclude {
|
|||
for (int j = 0; j < dirs.length; j++) {
|
||||
try {
|
||||
String filename = dirs[j] + GNUMakefile.FILE_SEPARATOR + filenames[i];
|
||||
gnu = new GNUMakefile();
|
||||
gnu.parse(filename);
|
||||
Directive[] subdirs = gnu.getStatements();
|
||||
addDirectives(subdirs);
|
||||
for (int k = 0; k < subdirs.length; ++k) {
|
||||
subdirs[k].setFilename(filename);
|
||||
}
|
||||
addDirective(gnu);
|
||||
break;
|
||||
} catch (IOException e) {
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue