close #141 - add CE project "version" field, as a symbol

This commit is contained in:
Basile Burg 2017-06-01 07:43:15 +02:00
parent f021024b4f
commit d80249b62d
No known key found for this signature in database
GPG Key ID: 1868039F415CB8CF
5 changed files with 10 additions and 2 deletions

View File

@ -44,6 +44,7 @@ Current project:
- **`<CPP>`**: also _`<CurrentProjectPath>`_. Expanded to the project path. - **`<CPP>`**: also _`<CurrentProjectPath>`_. Expanded to the project path.
- **`<CPR>`**: also _`<CurrentProjectRoot>`_. Expanded to the field _RootFolder_ of a CE project (n/a if the current project is for DUB). - **`<CPR>`**: also _`<CurrentProjectRoot>`_. Expanded to the field _RootFolder_ of a CE project (n/a if the current project is for DUB).
- **`<CPCD>`**: also _`<CurrentProjectCommonFilesDirectory>`_. Expanded to the sources common directory. - **`<CPCD>`**: also _`<CurrentProjectCommonFilesDirectory>`_. Expanded to the sources common directory.
- **`<CPV>`**: also _`<CurrentProjectVersion>`_. 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 **`<CPP>`** when no project is opened. 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 **`<CPP>`** when no project is opened.

View File

@ -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. - **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. 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. 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 #### Message options

View File

@ -35,6 +35,7 @@ type
fRootFolder: string; fRootFolder: string;
fBasePath: string; fBasePath: string;
fRunnerOldCwd: string; fRunnerOldCwd: string;
fVersion: string;
fLibAliases: TStringList; fLibAliases: TStringList;
fAutoDeps: boolean; fAutoDeps: boolean;
fConfigs: TCollection; fConfigs: TCollection;
@ -83,6 +84,7 @@ type
property ConfigurationIndex: Integer read fConfIx write setConfIx; property ConfigurationIndex: Integer read fConfIx write setConfIx;
property LibraryAliases: TStringList read fLibAliases write setLibAliases; property LibraryAliases: TStringList read fLibAliases write setLibAliases;
property AutoSolveDependencies: boolean read fAutoDeps write fAutoDeps default false; property AutoSolveDependencies: boolean read fAutoDeps write fAutoDeps default false;
property version: string read fVersion write fVersion;
public public
constructor create(aOwner: TComponent); override; constructor create(aOwner: TComponent); override;
destructor destroy; override; destructor destroy; override;

View File

@ -251,7 +251,7 @@ type
procedure setLdcOtherOptions(value: TStringList); procedure setLdcOtherOptions(value: TStringList);
procedure setGdcOtherOptions(value: TStringList); procedure setGdcOtherOptions(value: TStringList);
published 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 coverage: boolean read fCov write setCov default false;
property customOptions: TStringList read fCustom write setCustom; property customOptions: TStringList read fCustom write setCustom;
property dmdOtherOptions: TStringList read fDmdOthers write setDmdOtherOptions; property dmdOtherOptions: TStringList read fDmdOthers write setDmdOtherOptions;

View File

@ -14,7 +14,8 @@ type
* Enumerates the symbol kinds, used to index an associative array. * Enumerates the symbol kinds, used to index an associative array.
*) *)
TCESymbol = ( ENV_USER, ENV_HOME, ENV_TEMP, CAF, CAP, 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 const
FirstVariableSymbol = CFF; FirstVariableSymbol = CFF;
@ -233,6 +234,8 @@ begin
begin begin
if fProj.fileName.fileExists then if fProj.fileName.fileExists then
begin begin
if fProj.version.isNotEmpty then
fSymbols[CPV] := fProj.version;
fSymbols[CPR] := expandFilenameEx(fProj.basePath, fProj.RootFolder); fSymbols[CPR] := expandFilenameEx(fProj.basePath, fProj.RootFolder);
if fSymbols[CPR].isEmpty then if fSymbols[CPR].isEmpty then
fSymbols[CPR] := fSymbols[CPP]; fSymbols[CPR] := fSymbols[CPP];
@ -295,6 +298,7 @@ begin
'CPP', 'CurrentProjectPath' : Result += fSymbols[CPP]; 'CPP', 'CurrentProjectPath' : Result += fSymbols[CPP];
'CPR', 'CurrentProjectRoot' : Result += fSymbols[CPR]; 'CPR', 'CurrentProjectRoot' : Result += fSymbols[CPR];
'CPCD','CurrentProjectCommonDirectory': Result += fSymbols[CPCD]; 'CPCD','CurrentProjectCommonDirectory': Result += fSymbols[CPCD];
'CPV', 'CurrentProjectVersion': Result += fSymbols[CPV];
// //
else Result += '<' + sym + '>'; else Result += '<' + sym + '>';
end; end;