diff --git a/src/ce_dubproject.pas b/src/ce_dubproject.pas index 67d35a50..d6cddd2b 100644 --- a/src/ce_dubproject.pas +++ b/src/ce_dubproject.pas @@ -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); diff --git a/src/ce_interfaces.pas b/src/ce_interfaces.pas index 5624ac5d..ee3ba17a 100644 --- a/src/ce_interfaces.pas +++ b/src/ce_interfaces.pas @@ -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 ----------------------------------------------------------------- diff --git a/src/ce_main.pas b/src/ce_main.pas index 6f6d7ec9..1f66b220 100644 --- a/src/ce_main.pas +++ b/src/ce_main.pas @@ -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} diff --git a/src/ce_nativeproject.pas b/src/ce_nativeproject.pas index cac2674c..656b352e 100644 --- a/src/ce_nativeproject.pas +++ b/src/ce_nativeproject.pas @@ -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;