Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build event macros in Delphi XE

According to Delphi's help file, when I open the dialog box to add build events to my project's options, the dialog box should show a list of macros (placeholders) that I can use on the command line for the build event. When I try this in Delphi XE, the list of macros is empty. The help file doesn't say which macros are available either (that I could find).

So, which macros are available? Right now I need a macro for the full path to the compiled .exe file (post-build), and the full path to the .dproj file. But I'd like to have a complete list of the available macros for future reference.

like image 541
Jan Goyvaerts Avatar asked Apr 04 '11 01:04

Jan Goyvaerts


2 Answers

I have Update 1 installed, but still can't see them, however...

For the Output File use "$(OUTPUTDIR)$(OUTPUTFILENAME)" and the Project File use "$(ProjectDir)$(ProjectFileName)"

You can find a list of the available macros (if they aren't showing up in the IDE) in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Borland.Delphi.Targets (sourced from What are the MSBuild project level properties for Delphi?)

Inside that file is the following area on my machine...

<!-- Build event properties settable in the IDE -->
    <ProjectName>$(MSBuildProjectName)</ProjectName>
    <ProjectFilename>$(MSBuildProjectFile)</ProjectFilename>
    <ProjectExt>$(MSBuildProjectExtension)</ProjectExt>
    <ProjectDir>$(MSBuildProjectDirectory)</ProjectDir>
    <ProjectPath>$(MSBuildProjectFullPath)</ProjectPath>

    <InputPath>@(DelphiCompile->'%(FullPath)')</InputPath>
    <InputDir>@(DelphiCompile->'%(RootDir)%(Directory)')</InputDir>
    <InputName>@(DelphiCompile->'%(Filename)')</InputName>
    <InputExt>@(DelphiCompile->'%(Extension)')</InputExt>
    <InputFilename>@(DelphiCompile->'%(Filename)%(Extension)')</InputFilename>

    <OutputPath>@(_DependencyCheckOutputName->'%(FullPath)')</OutputPath>
    <OutputDir>@(_DependencyCheckOutputName->'%(RootDir)%(Directory)')</OutputDir>
    <OutputName>@(_DependencyCheckOutputName->'%(Filename)')</OutputName>
    <OutputExt>@(_DependencyCheckOutputName->'%(Extension)')</OutputExt>
    <OutputFilename>@(_DependencyCheckOutputName->'%(Filename)%(Extension)')</OutputFilename>

HTH

like image 81
GoldenTao Avatar answered Sep 19 '22 16:09

GoldenTao


I had to go back to D2010 to come up with this list:

BDS                 The environment variable $(BDS)
DEFINES             The project's conditional defines
DIR                 The environment variable $(DIR)
INCLUDEPATH         The project's include path
INPUTDIR            The input file's directory
INPUTEXT            The input file's extension
INPUTFILENAME       The input file's name, with extension
INPUTPATH           The input file's full path
LOCALCOMMAND        Local command entered by user in project manager
OUTPUTDIR           The output file's directory
OUTPUTEXT           The output file's extension
OUTPUTFILENAME      The output file's name, with extension
OUTPUTNAME          The output file's name, without extension
OUTPUTPATH          The output file's full path
Path                The environment variable $(PATH)
PROJECTDIR          The project's directory
PROJECTEXT          The project's extension
PROJECTFILENAME     The project file's name, with extension
PROJECTNAME         The project's name
PROJECTPATH         The project file's full path
SAVE                Save the input file to disk before it's compiled
SystemRoot          The environment variable $(SYSTEMROOT)
WINDIR              The environment variable $(WINDIR)
like image 34
Ken White Avatar answered Sep 18 '22 16:09

Ken White