mirror of https://gitlab.com/basile.b/dexed.git
make project, add an option to filter out by ext files located in the sourceDirectories
This commit is contained in:
parent
093ffa54b3
commit
e0b599aea9
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -1,3 +1,14 @@
|
|||
# v3.9.22-dev
|
||||
|
||||
## Enhancements
|
||||
|
||||
- Make projects, added the _excludedSourceExtensions_ options. It allows to filter out files that are in the
|
||||
_sourceDirectories_ from the project inspector or from the list of files used to perform project wide searches.
|
||||
|
||||
## Regressions fixed
|
||||
|
||||
- Editor, line clicked when adding a breakpoint unexpectedly vertically centered (
|
||||
|
||||
# v3.9.21
|
||||
|
||||
## Bugs fixed
|
||||
|
|
|
@ -16,14 +16,17 @@ TMakeProjectOptionsBase = class(TWritableLfmTextComponent)
|
|||
strict private
|
||||
fNumThreads: integer;
|
||||
fSourceDirectories: TStringList;
|
||||
fExcludedSourceExtensions: TStringList;
|
||||
fQuiet: boolean;
|
||||
fKeepGoing: boolean;
|
||||
procedure setSourceDirectories(value: TStringList);
|
||||
procedure setExcludedSourceExtensions(value: TStringList);
|
||||
published
|
||||
property keepGoing: boolean read fKeepGoing write fKeepGoing default false;
|
||||
property quiet: boolean read fQuiet write fQuiet default false;
|
||||
property numThreads: integer read fNumThreads write fNumThreads default 1;
|
||||
property sourceDirectories: TStringList read fSourceDirectories write setSourceDirectories;
|
||||
property excludedSourceExtensions: TStringList read fExcludedSourceExtensions write setExcludedSourceExtensions;
|
||||
public
|
||||
constructor create(aOwner: TComponent); override;
|
||||
destructor destroy(); override;
|
||||
|
@ -152,11 +155,14 @@ begin
|
|||
fNumThreads := 1;
|
||||
fSourceDirectories := TStringList.Create;
|
||||
fSourceDirectories.AddStrings(['src', 'import', 'include']);
|
||||
fExcludedSourceExtensions := TStringList.Create;
|
||||
fExcludedSourceExtensions.AddStrings(['.txt', '.md', '.gcov']);
|
||||
end;
|
||||
|
||||
destructor TMakeProjectOptionsBase.destroy();
|
||||
begin
|
||||
fSourceDirectories.Free;
|
||||
fExcludedSourceExtensions.Free;
|
||||
inherited;
|
||||
end;
|
||||
|
||||
|
@ -165,6 +171,11 @@ begin
|
|||
fSourceDirectories.Assign(value);
|
||||
end;
|
||||
|
||||
procedure TMakeProjectOptionsBase.setExcludedSourceExtensions(value: TStringList);
|
||||
begin
|
||||
fExcludedSourceExtensions.Assign(value);
|
||||
end;
|
||||
|
||||
procedure TMakeProjectOptionsBase.assign(other: TPersistent);
|
||||
var
|
||||
src: TMakeProjectOptionsBase;
|
||||
|
@ -173,6 +184,7 @@ begin
|
|||
begin
|
||||
src := TMakeProjectOptionsBase(other);
|
||||
fSourceDirectories.Assign(src.sourceDirectories);
|
||||
fExcludedSourceExtensions.Assign(src.excludedSourceExtensions);
|
||||
fQuiet:= src.fQuiet;
|
||||
fKeepGoing:= src.fKeepGoing;
|
||||
fNumThreads:= src.fNumThreads;
|
||||
|
@ -291,8 +303,11 @@ var
|
|||
hidden: string = DirectorySeparator + '.';
|
||||
f: string;
|
||||
p: string;
|
||||
e: string;
|
||||
s: string;
|
||||
colPos: integer;
|
||||
i: integer;
|
||||
badExt: boolean;
|
||||
begin
|
||||
fRules.Clear;
|
||||
fRules.add('default');
|
||||
|
@ -330,8 +345,21 @@ begin
|
|||
begin
|
||||
listFiles(srcs, fBasePath + p, true);
|
||||
for f in srcs do
|
||||
begin
|
||||
if pos(hidden, f) = 0 then
|
||||
fSrcs.Add(f[fBasePath.length + 1 .. f.length]);
|
||||
begin
|
||||
badExt := false;
|
||||
s := f.extractFileExt();
|
||||
for e in makeProjectOptions.excludedSourceExtensions do
|
||||
if SameText(e, s) then
|
||||
begin
|
||||
badExt := true;
|
||||
break;
|
||||
end;
|
||||
if not badExt then
|
||||
fSrcs.Add(f[fBasePath.length + 1 .. f.length]);
|
||||
end;
|
||||
end;
|
||||
srcs.Clear;
|
||||
end;
|
||||
finally
|
||||
|
|
Loading…
Reference in New Issue