mirror of https://gitlab.com/basile.b/dexed.git
native projects : allow to specify a file that contain the version number
This commit is contained in:
parent
abe56ec68e
commit
e7477af066
|
@ -51,6 +51,7 @@ type
|
||||||
fSymStringExpander: ISymStringExpander;
|
fSymStringExpander: ISymStringExpander;
|
||||||
fMsgs: IMessagesDisplay;
|
fMsgs: IMessagesDisplay;
|
||||||
fAsProjectItf: ICommonProject;
|
fAsProjectItf: ICommonProject;
|
||||||
|
fVersionFile: string;
|
||||||
procedure updateOutFilename;
|
procedure updateOutFilename;
|
||||||
procedure doChanged(modified: boolean = true);
|
procedure doChanged(modified: boolean = true);
|
||||||
procedure getBaseConfig;
|
procedure getBaseConfig;
|
||||||
|
@ -63,6 +64,7 @@ type
|
||||||
function getConfig(value: integer): TCompilerConfiguration;
|
function getConfig(value: integer): TCompilerConfiguration;
|
||||||
function getCurrConf: TCompilerConfiguration;
|
function getCurrConf: TCompilerConfiguration;
|
||||||
function runPrePostProcess(processInfo: TCompileProcOptions): Boolean;
|
function runPrePostProcess(processInfo: TCompileProcOptions): Boolean;
|
||||||
|
function getVersion(): string;
|
||||||
// passes pre/post/executed project/ outputs as bubles.
|
// passes pre/post/executed project/ outputs as bubles.
|
||||||
procedure runProcOutput(sender: TObject);
|
procedure runProcOutput(sender: TObject);
|
||||||
// passes compilation message as "to be guessed"
|
// passes compilation message as "to be guessed"
|
||||||
|
@ -85,7 +87,8 @@ 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;
|
property version: string read getVersion write fVersion;
|
||||||
|
property versionFile: TPathname read fVersionFile write fVersionFile;
|
||||||
public
|
public
|
||||||
constructor create(aOwner: TComponent); override;
|
constructor create(aOwner: TComponent); override;
|
||||||
destructor destroy; override;
|
destructor destroy; override;
|
||||||
|
@ -390,6 +393,28 @@ begin
|
||||||
result := TCompilerConfiguration(fConfigs.Items[fConfIx]);
|
result := TCompilerConfiguration(fConfigs.Items[fConfIx]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TNativeProject.getVersion(): string;
|
||||||
|
var
|
||||||
|
p: string = '';
|
||||||
|
begin
|
||||||
|
if fVersionFile.isNotEmpty then
|
||||||
|
begin
|
||||||
|
if FilenameIsAbsolute(fVersionFile) then
|
||||||
|
p := fVersionFile
|
||||||
|
else
|
||||||
|
p := expandFilenameEx(fBasePath, fVersionFile);
|
||||||
|
end;
|
||||||
|
if p.isNotEmpty and p.fileExists then
|
||||||
|
with TStringList.Create do
|
||||||
|
try
|
||||||
|
LoadFromFile(p);
|
||||||
|
fVersion := trim(strictText);
|
||||||
|
finally
|
||||||
|
free;
|
||||||
|
end;
|
||||||
|
result := fVersion;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TNativeProject.addDefaults;
|
procedure TNativeProject.addDefaults;
|
||||||
begin
|
begin
|
||||||
with TCompilerConfiguration(fConfigs.Add) do
|
with TCompilerConfiguration(fConfigs.Add) do
|
||||||
|
|
Loading…
Reference in New Issue