support for multiple version identifiers

This commit is contained in:
Basile Burg 2014-07-07 04:17:02 +02:00
parent 6c52701a10
commit 1ce5f8f65f
1 changed files with 48 additions and 3 deletions

View File

@ -103,6 +103,7 @@ type
fBinKind: TBinaryKind; fBinKind: TBinaryKind;
fUt: boolean; fUt: boolean;
fVerId: string; fVerId: string;
fVerIds: TStringList;
fInline: boolean; fInline: boolean;
fNoBounds: boolean; fNoBounds: boolean;
fOptimz: boolean; fOptimz: boolean;
@ -119,6 +120,7 @@ type
procedure setGenStack(const aValue: boolean); procedure setGenStack(const aValue: boolean);
procedure setMain(const aValue: boolean); procedure setMain(const aValue: boolean);
procedure setRelease(const aValue: boolean); procedure setRelease(const aValue: boolean);
procedure setVerIds(const aValue: TStringList);
published published
property targetKind: TTargetSystem read fTrgKind write setTrgKind; property targetKind: TTargetSystem read fTrgKind write setTrgKind;
property binaryKind: TBinaryKind read fBinKind write setBinKind; property binaryKind: TBinaryKind read fBinKind write setBinKind;
@ -130,7 +132,10 @@ type
property release: boolean read fRelease write setRelease; property release: boolean read fRelease write setRelease;
property unittest: boolean read fUt write setUt; property unittest: boolean read fUt write setUt;
property versionIdentifier: string read fVerId write setVerId; property versionIdentifier: string read fVerId write setVerId;
property versionIdentifiers: TStringList read fVerIds write setVerIds;
public public
constructor create;
destructor destroy; override;
procedure assign(aValue: TPersistent); override; procedure assign(aValue: TPersistent); override;
procedure getOpts(const aList: TStrings); override; procedure getOpts(const aList: TStrings); override;
end; end;
@ -286,6 +291,12 @@ end;
procedure TDocOpts.setGenDoc(const aValue: boolean); procedure TDocOpts.setGenDoc(const aValue: boolean);
begin begin
if fDocDir <> '' then
begin
fGenDoc := true;
exit;
end;
//
if fGenDoc = aValue then exit; if fGenDoc = aValue then exit;
fGenDoc := aValue; fGenDoc := aValue;
doChanged; doChanged;
@ -293,6 +304,12 @@ end;
procedure TDocOpts.setGenJSON(const aValue: boolean); procedure TDocOpts.setGenJSON(const aValue: boolean);
begin begin
if fJsonFname <> '' then
begin
fGenJson := true;
exit;
end;
//
if fGenJson = aValue then exit; if fGenJson = aValue then exit;
fGenJson := aValue; fGenJson := aValue;
doChanged; doChanged;
@ -302,6 +319,7 @@ procedure TDocOpts.setDocDir(const aValue: string);
begin begin
if fDocDir = aValue then exit; if fDocDir = aValue then exit;
fDocDir := patchPlateformPath(aValue); fDocDir := patchPlateformPath(aValue);
if fDocDir <> '' then setGenDoc(true);
doChanged; doChanged;
end; end;
@ -309,6 +327,7 @@ procedure TDocOpts.setJSONFile(const aValue: string);
begin begin
if fJsonFname = aValue then exit; if fJsonFname = aValue then exit;
fJsonFname := patchPlateformPath(aValue); fJsonFname := patchPlateformPath(aValue);
if fJsonFname <> '' then setGenJSON(true);
doChanged; doChanged;
end; end;
@ -397,6 +416,18 @@ end;
(******************************************************************************* (*******************************************************************************
* TOutputOpts * TOutputOpts
*) *)
constructor TOutputOpts.create;
begin
fVerIds := TStringList.Create;
//fVerId := 'deprecated_field';
end;
destructor TOutputOpts.destroy;
begin
fVerIds.Free;
inherited;
end;
procedure TOutputOpts.getOpts(const aList: TStrings); procedure TOutputOpts.getOpts(const aList: TStrings);
var var
opt: string; opt: string;
@ -416,6 +447,8 @@ begin
if fGenStack then aList.Add('-gs'); if fGenStack then aList.Add('-gs');
if fMain then aList.Add('-main'); if fMain then aList.Add('-main');
if fRelease then aList.Add('-release'); if fRelease then aList.Add('-release');
for opt in fVerIds do
aList.Add('-version=' + opt );
end; end;
procedure TOutputOpts.assign(aValue: TPersistent); procedure TOutputOpts.assign(aValue: TPersistent);
@ -453,6 +486,12 @@ begin
doChanged; doChanged;
end; end;
procedure TOutputOpts.setVerIds(const aValue: TStringList);
begin
fVerIds.Assign(aValue);
doChanged;
end;
procedure TOutputOpts.setTrgKind(const aValue: TTargetSystem); procedure TOutputOpts.setTrgKind(const aValue: TTargetSystem);
begin begin
if fTrgKind = aValue then exit; if fTrgKind = aValue then exit;
@ -683,10 +722,16 @@ end;
procedure TOtherOpts.getOpts(const aList: TStrings); procedure TOtherOpts.getOpts(const aList: TStrings);
var var
str: string; str1, str2: string;
begin begin
for str in fCustom do if str <> '' then for str1 in fCustom do if str1 <> '' then
aList.Add(str); begin
if str1[1] <> '-' then
str2 := '-' + str1
else
str2 := str1;
aList.Add(str2);
end;
end; end;
procedure TOtherOpts.setCustom(const aValue: TStringList); procedure TOtherOpts.setCustom(const aValue: TStringList);