diff --git a/docs/features_symbolic_strings.md b/docs/features_symbolic_strings.md index 926844cb..e98f4116 100644 --- a/docs/features_symbolic_strings.md +++ b/docs/features_symbolic_strings.md @@ -44,6 +44,7 @@ Current project: - **``**: also _``_. Expanded to the project path. - **``**: also _``_. Expanded to the field _RootFolder_ of a CE project (n/a if the current project is for DUB). - **``**: also _``_. Expanded to the sources common directory. +- **``**: also _``_. Expanded to the value of the _version_ field of a [CE project](widgets_native_project_configuration). The expanded form of a symbol is never empty. When a symbol expands to nothing it's set to a pair of back quotes, e.g **\``** for a **``** when no project is opened. diff --git a/docs/widgets_ce_project_editor.md b/docs/widgets_ce_project_editor.md index 49f5b35f..ea8a8db3 100644 --- a/docs/widgets_ce_project_editor.md +++ b/docs/widgets_ce_project_editor.md @@ -38,6 +38,7 @@ When dependencies are complex, it's possible to select all the entries by settin - **Sources**: Shows a dialog used to edit the filenames of the project sources. Relative paths are automatically handled. Only one item must stand by line. It's recommended to use the [project inspector](widgets_project_inspector) instead of this archaic editor. To include a folder of source it's also possible to specify a path with a asterisk in the **Paths** options, **ExtraSources** editor. This avoids to manually remove the obsolete source or to manually add the new source files. +- **version**: Defines a string used to expand the [_CPV_ symbolic string](features_symbolic_strings). #### Message options diff --git a/src/ce_ceproject.pas b/src/ce_ceproject.pas index 9a51ff7c..d88b7cda 100644 --- a/src/ce_ceproject.pas +++ b/src/ce_ceproject.pas @@ -35,6 +35,7 @@ type fRootFolder: string; fBasePath: string; fRunnerOldCwd: string; + fVersion: string; fLibAliases: TStringList; fAutoDeps: boolean; fConfigs: TCollection; @@ -83,6 +84,7 @@ type property ConfigurationIndex: Integer read fConfIx write setConfIx; property LibraryAliases: TStringList read fLibAliases write setLibAliases; property AutoSolveDependencies: boolean read fAutoDeps write fAutoDeps default false; + property version: string read fVersion write fVersion; public constructor create(aOwner: TComponent); override; destructor destroy; override; diff --git a/src/ce_dmdwrap.pas b/src/ce_dmdwrap.pas index 6c61355e..01f672bf 100644 --- a/src/ce_dmdwrap.pas +++ b/src/ce_dmdwrap.pas @@ -251,7 +251,7 @@ type procedure setLdcOtherOptions(value: TStringList); procedure setGdcOtherOptions(value: TStringList); published - property guiApplication: boolean read fGui write setGui; + property guiApplication: boolean read fGui write setGui default false; property coverage: boolean read fCov write setCov default false; property customOptions: TStringList read fCustom write setCustom; property dmdOtherOptions: TStringList read fDmdOthers write setDmdOtherOptions; diff --git a/src/ce_symstring.pas b/src/ce_symstring.pas index 5ad03301..c91346f4 100644 --- a/src/ce_symstring.pas +++ b/src/ce_symstring.pas @@ -14,7 +14,8 @@ type * Enumerates the symbol kinds, used to index an associative array. *) TCESymbol = ( ENV_USER, ENV_HOME, ENV_TEMP, CAF, CAP, - CFF, CFP, CFR, CI, CL, CPF, CPP, CPO, CPOP, CPR, CPN, CPFS, CPCD, CS); + CFF, CFP, CFR, CI, CL, CPF, CPP, CPO, CPOP, CPR, CPN, CPFS, CPCD, + CPV, CS); const FirstVariableSymbol = CFF; @@ -233,6 +234,8 @@ begin begin if fProj.fileName.fileExists then begin + if fProj.version.isNotEmpty then + fSymbols[CPV] := fProj.version; fSymbols[CPR] := expandFilenameEx(fProj.basePath, fProj.RootFolder); if fSymbols[CPR].isEmpty then fSymbols[CPR] := fSymbols[CPP]; @@ -295,6 +298,7 @@ begin 'CPP', 'CurrentProjectPath' : Result += fSymbols[CPP]; 'CPR', 'CurrentProjectRoot' : Result += fSymbols[CPR]; 'CPCD','CurrentProjectCommonDirectory': Result += fSymbols[CPCD]; + 'CPV', 'CurrentProjectVersion': Result += fSymbols[CPV]; // else Result += '<' + sym + '>'; end;