added ICECOmmonproject.getCommandeLIne

common interface for the action view project command line
This commit is contained in:
Basile Burg 2015-09-09 13:51:36 +02:00
parent 3a37d133a6
commit ce2d63713d
4 changed files with 37 additions and 9 deletions

View File

@ -41,6 +41,7 @@ type
procedure saveToFile(const aFilename: string);
function getIfModified: boolean;
function getBinaryKind: TProjectBinaryKind;
function getCommandLine: string;
//
function getIfIsSource(const aFilename: string): boolean;
function getOutputFilename: string;
@ -226,6 +227,23 @@ begin
end;
end;
function TCEDubProject.getCommandLine: string;
var
str: TStringList;
begin
str := TStringList.Create;
try
str.Add('dub' + exeExt);
if fBuiltTypeIx <> 0 then
str.Add('build=' + fBuildTypes.Strings[fBuiltTypeIx]);
if fConfigIx <> 0 then
str.Add('config=' + fConfigs.Strings[fConfigIx]);
result := str.Text;
finally
str.Free;
end;
end;
function TCEDubProject.getIfModified: boolean;
begin
exit(fModified);

View File

@ -63,6 +63,8 @@ type
function getOutputFilename: string;
// returns the binary kind produced according to the current configuration
function getBinaryKind: TProjectBinaryKind;
// returns what's gonna be executed in background for this config
function getCommandLine: string;
// configs -----------------------------------------------------------------

View File

@ -2136,16 +2136,9 @@ begin
end;
procedure TCEMainForm.actProjOptViewExecute(Sender: TObject);
var
lst: TStringList;
begin
lst := TStringList.Create;
try
fNativeProject.getOpts(lst);
dlgOkInfo(lst.Text);
finally
lst.Free;
end;
if fProjectInterface = nil then exit;
dlgOkInfo(fProjectInterface.getCommandLine);
end;
{$ENDREGION}

View File

@ -95,6 +95,7 @@ type
function getConfigurationName(index: integer): string;
function getFilename: string;
function getBinaryKind: TProjectBinaryKind;
function getCommandLine: string;
//
property configuration[ix: integer]: TCompilerConfiguration read getConfig;
property currentConfiguration: TCompilerConfiguration read getCurrConf;
@ -856,6 +857,20 @@ begin
exit(currentConfiguration.outputOptions.binaryKind);
end;
function TCENativeProject.getCommandLine: string;
var
str: TStringList;
begin
str := TStringList.Create;
try
str.Add('dmd' + exeExt);
getOpts(str);
result := str.Text;
finally
str.Free;
end;
end;
function isValidNativeProject(const filename: string): boolean;
var
maybe: TCENativeProject;