开发者

Delphi command-line compiler

I have a project with a few apps with a couple of {$DEF aaaaa} and then I use Inno setup to do a installer. To streamline the process it would be great to create a batch file to do the whole thing from A to Z. Hence the need to use the line compiler I never did that in 10+ years of delphi.

Given that the help is... well we all know about the help

Where can I find some documentation/tutorial on this topic if would be nice if the IDE would produce a file with all the parameters to be used with the line compiler may be it does (it does internally but...) then where?? Should 开发者_运维知识库I use Msbuild or DCC32.exe and some file ??? if MSbuild how do you use the stuff

I have no clue where to start any hint in the right direction wold be appreciated

Thank you PW


See here: http://delphi.wikia.com/wiki/Compile_from_Commandline


If you are using a Delphi version that supports MSBuild directly it is easier to use it because it can read most parameters from your Delphi and project settings, while DCC32 requires a little more work to use it. There are also many tools to automate a build (both free/open source or commercial), but for simple needs even a batch file could be enough.


A good start:

  • http://docwiki.embarcadero.com/RADStudio/en/DCC32.EXE,_the_Delphi_Command_Line_Compiler
  • http://docwiki.embarcadero.com/RADStudio/en/Delphi_compiler_directives

The big picture:

  • http://docwiki.embarcadero.com/RADStudio/en/Command_Line_Utilities_Index


DCC32 does output its own help if called in either of these ways:

dcc32
dcc32 -h
dcc32 -help

This can be found here, as Andreas pointed out.

In Rad Studio XE (Delphi 2011), FinalBuilder will be integrated into the IDE helping with exactly this. i would therefore have a look into the product, as you would prepare for the future using it.


Seeing as you mention msbuild can we assume you have a reasonably recent version of Delphi? As mentioned already FinalBuilder is great for this sort of thing. there is a FinalBuilder action for doing this which basically boils down to a command line of:

msbuild /target:Build /property:config=Release;UsePackages=false myapp.dproj

Change the config= as approriate and add/remove other property: settings as you choose.
Compiling using dcc32 is fine and still perfectly doable but msbuild is definitely a bit more straightforward now as it is much easier to build different configurations.

msbuild -h

is a good starting point as are all the links already given.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜