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); procedure saveToFile(const aFilename: string);
function getIfModified: boolean; function getIfModified: boolean;
function getBinaryKind: TProjectBinaryKind; function getBinaryKind: TProjectBinaryKind;
function getCommandLine: string;
// //
function getIfIsSource(const aFilename: string): boolean; function getIfIsSource(const aFilename: string): boolean;
function getOutputFilename: string; function getOutputFilename: string;
@ -226,6 +227,23 @@ begin
end; end;
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; function TCEDubProject.getIfModified: boolean;
begin begin
exit(fModified); exit(fModified);

View File

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

View File

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

View File

@ -95,6 +95,7 @@ type
function getConfigurationName(index: integer): string; function getConfigurationName(index: integer): string;
function getFilename: string; function getFilename: string;
function getBinaryKind: TProjectBinaryKind; function getBinaryKind: TProjectBinaryKind;
function getCommandLine: string;
// //
property configuration[ix: integer]: TCompilerConfiguration read getConfig; property configuration[ix: integer]: TCompilerConfiguration read getConfig;
property currentConfiguration: TCompilerConfiguration read getCurrConf; property currentConfiguration: TCompilerConfiguration read getCurrConf;
@ -856,6 +857,20 @@ begin
exit(currentConfiguration.outputOptions.binaryKind); exit(currentConfiguration.outputOptions.binaryKind);
end; 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; function isValidNativeProject(const filename: string): boolean;
var var
maybe: TCENativeProject; maybe: TCENativeProject;