IDE: added project compiler option: apply target file conventions, bug #17847

git-svn-id: trunk@28721 -
This commit is contained in:
mattias 2010-12-15 13:00:17 +00:00
parent 230d56ede2
commit fbbd9447ba
5 changed files with 76 additions and 41 deletions

View File

@ -1359,6 +1359,7 @@ begin
{ Target }
p:=Path+'Target/';
TargetFilename := f(aXMLConfig.GetValue(p+'Filename/Value', ''));
TargetFilenameAppplyConventions := aXMLConfig.GetValue(p+'Filename/ApplyConventions', true);
{ SearchPaths }
p:=Path+'SearchPaths/';
@ -1569,6 +1570,7 @@ begin
{ Target }
p:=Path+'Target/';
aXMLConfig.SetDeleteValue(p+'Filename/Value', f(TargetFilename),'');
aXMLConfig.SetDeleteValue(p+'Filename/ApplyConventions', TargetFilenameAppplyConventions,true);
{ SearchPaths }
p:=Path+'SearchPaths/';
@ -1803,8 +1805,10 @@ begin
Result:=CreateAbsolutePath(OutFilename,UnitOutDir);
end;
Result:=TrimFilename(Result);
AppendDefaultExt;
PrependDefaultType;
if TargetFilenameAppplyConventions then begin
AppendDefaultExt;
PrependDefaultType;
end;
end;
function TBaseCompilerOptions.GetTargetFileExt: string;
@ -2986,6 +2990,7 @@ begin
// Target
TargetFilename := CompOpts.TargetFilename;
TargetFilenameAppplyConventions := CompOpts.TargetFilenameAppplyConventions;
// Search Paths
StorePathDelim := CompOpts.StorePathDelim;
@ -3129,6 +3134,7 @@ begin
// target
if Done(Tool.AddDiff('TargetFilename',fTargetFilename,CompOpts.fTargetFilename)) then exit;
if Done(Tool.AddDiff('TargetFilenameAppplyConventions',FTargetFilenameAppplyConventions,CompOpts.FTargetFilenameAppplyConventions)) then exit;
// search paths
if Tool<>nil then Tool.Path:='Paths';

View File

@ -12,7 +12,7 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 14
Height = 18
Top = 0
Width = 509
Anchors = [akTop, akLeft, akRight]
@ -26,8 +26,8 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 14
Top = 41
Height = 18
Top = 51
Width = 509
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
@ -41,8 +41,8 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 14
Top = 205
Height = 18
Top = 255
Width = 509
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
@ -56,8 +56,8 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 14
Top = 82
Height = 18
Top = 102
Width = 509
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
@ -71,8 +71,8 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 14
Top = 123
Height = 18
Top = 153
Width = 509
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
@ -86,8 +86,8 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 14
Top = 246
Height = 18
Top = 306
Width = 509
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
@ -99,9 +99,9 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideTop.Control = LCLWidgetTypeComboBox
AnchorSideTop.Side = asrCenter
Left = 0
Height = 14
Top = 290
Width = 101
Height = 18
Top = 363
Width = 134
Caption = 'LCLWidgetTypeLabel'
ParentColor = False
end
@ -112,8 +112,8 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 21
Top = 14
Height = 27
Top = 18
Width = 509
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Bottom = 6
@ -127,8 +127,8 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 21
Top = 55
Height = 27
Top = 69
Width = 509
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Bottom = 6
@ -142,8 +142,8 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 21
Top = 219
Height = 27
Top = 273
Width = 509
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Bottom = 6
@ -157,8 +157,8 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 21
Top = 96
Height = 27
Top = 120
Width = 509
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Bottom = 6
@ -172,8 +172,8 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 21
Top = 137
Height = 27
Top = 171
Width = 509
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Bottom = 6
@ -187,8 +187,8 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 21
Top = 260
Height = 27
Top = 324
Width = 509
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Bottom = 6
@ -200,13 +200,13 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = DebugPathEdit
AnchorSideTop.Side = asrBottom
Left = 107
Height = 21
Top = 287
Left = 140
Height = 31
Top = 357
Width = 171
BorderSpacing.Left = 6
BorderSpacing.Top = 6
ItemHeight = 13
ItemHeight = 0
Style = csDropDownList
TabOrder = 7
end
@ -214,13 +214,10 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = UnitOutputDirEdit
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 14
Top = 164
Width = 509
Anchors = [akTop, akLeft, akRight]
Height = 18
Top = 204
Width = 124
Caption = 'ProjTargetFileLabel'
ParentColor = False
end
@ -231,8 +228,8 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 21
Top = 178
Height = 27
Top = 222
Width = 509
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Bottom = 6
@ -240,4 +237,18 @@ inherited CompilerPathOptionsFrame: TCompilerPathOptionsFrame
TabOrder = 4
Text = 'ProjTargetFileEdit'
end
object ProjTargetApplyConventionsCheckBox: TCheckBox[16]
AnchorSideLeft.Control = ProjTargetFileLabel
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = ProjTargetFileLabel
AnchorSideTop.Side = asrCenter
AnchorSideRight.Side = asrBottom
Left = 130
Height = 22
Top = 202
Width = 272
BorderSpacing.Left = 6
Caption = 'ProjTargetApplyConventionsCheckBox'
TabOrder = 8
end
end

View File

@ -28,6 +28,7 @@ type
OtherSourcesLabel: TLabel;
OtherUnitsEdit: TEdit;
OtherUnitsLabel: TLabel;
ProjTargetApplyConventionsCheckBox: TCheckBox;
ProjTargetFileEdit: TEdit;
ProjTargetFileLabel: TLabel;
UnitOutputDirEdit: TEdit;
@ -558,6 +559,7 @@ var
s: string;
begin
ProjTargetFileEdit.Text:='';
ProjTargetApplyConventionsCheckBox.Caption:=lisApplyConventions;
OtherUnitsLabel.Caption := dlgOtherUnitFiles;
OtherUnitsPathEditBtn := TPathEditorButton.Create(Self);
@ -729,6 +731,7 @@ begin
ProjTargetFileEdit.Visible:=true;
ProjTargetFileLabel.Visible:=true;
ProjTargetFileEdit.Text:=TProjectCompilerOptions(AOptions).TargetFilename;
ProjTargetApplyConventionsCheckBox.Checked:=TProjectCompilerOptions(AOptions).TargetFilenameAppplyConventions;
UpdateTargetFileLabel;
end else begin
ProjTargetFileEdit.Visible:=false;
@ -757,8 +760,10 @@ procedure TCompilerPathOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions)
var
i: integer;
begin
if AOptions is TProjectCompilerOptions then
if AOptions is TProjectCompilerOptions then begin
TProjectCompilerOptions(AOptions).TargetFilename:=ProjTargetFileEdit.Text;
TProjectCompilerOptions(AOptions).TargetFilenameAppplyConventions:=ProjTargetApplyConventionsCheckBox.Checked;
end;
with AOptions as TBaseCompilerOptions do
begin

View File

@ -5089,6 +5089,7 @@ resourcestring
//Disassembler dialog
lisDisAssAssembler = 'Assembler';
lisApplyConventions = 'Apply conventions';
implementation

View File

@ -171,6 +171,7 @@ type
procedure SetStopAfterErrCount(const AValue: integer);
procedure SetStripSymbols(const AValue: Boolean);
procedure SetSyntaxMode(const AValue: string);
procedure SetTargetFilenameAppplyConventions(const AValue: boolean);
procedure SetUncertainOpt(const AValue: Boolean);
procedure SetUseAnsiStr(const AValue: Boolean);
procedure SetUseExternalDbgSyms(const AValue: Boolean);
@ -240,6 +241,7 @@ type
FExecutableType: TCompilationExecutableType;
FUseExternalDbgSyms : Boolean;
fTargetFilename: string;
FTargetFilenameAppplyConventions: boolean;
// Messages:
fShowErrors: Boolean;
@ -327,6 +329,7 @@ type
// target:
property TargetFilename: String read fTargetFilename write SetTargetFilename;
property TargetFilenameAppplyConventions: boolean read FTargetFilenameAppplyConventions write SetTargetFilenameAppplyConventions;
// parsing:
property SyntaxMode: string read FSyntaxMode write SetSyntaxMode;
@ -1751,6 +1754,14 @@ begin
IncreaseChangeStamp;
end;
procedure TLazCompilerOptions.SetTargetFilenameAppplyConventions(
const AValue: boolean);
begin
if FTargetFilenameAppplyConventions=AValue then exit;
FTargetFilenameAppplyConventions:=AValue;
IncreaseChangeStamp;
end;
procedure TLazCompilerOptions.SetUncertainOpt(const AValue: Boolean);
begin
if fUncertainOpt=AValue then exit;
@ -1833,6 +1844,7 @@ begin
fOnChanged:=TMethodList.Create;
FChangeStamp:=InvalidChangeStamp;
FSavedChangeStamp:=FChangeStamp;
FTargetFilenameAppplyConventions:=true;
FOwner := TheOwner;
end;