Automation Daily Build (1) Use Ant to complete daily build of Delphi project

zhaozj2021-02-16  80

Delphi's IDE is very convenient in the compilation of general engineering, deployment, but when the scale of the project is large, the construction of the project is more cost-effective. At this time we can use the shell script to complete this task. But the script is limited to the operating system platform, which is not convenient to manage. If you can unify all items in Ant and Nant environments, then the management efficiency of the project can be greatly improved, and the cost can be greatly reduced.

The actual content constructed daily should include: code update, compilation, unit test, packaging, smoke test, etc. Basic content. The following build files do not include all of this content.

This series includes daily construction of Delphi, Java with Ant, using NANT. NANT daily.

Ant's build files build.xml, can be used instead of ******** when used.

< Property file = "$ {s.build} /build.properties" />

< echo message = "release -> buildate =" clean -> cleans up the directory "/> <

Echo message = "See the comments inside the building.xml file for more details." />

< Arg line = "-b $ {pname} -n $ {s.gohome} -e $ {s.gohome} $ {s.build.bin} -u $ {s.gohome} $ {s.build.lib} "/>

< Fileset file = "$ {s.src} / sql /*.*" />

Here is a help documentation that has been written in the daily build of Delphi engineering automation, and the content is English.

START A New Delphi Project by Using Ant

This Document Has 5 Sections:

Brief

System Requirement

Directories and Files

The Build File

Run Ant

Brief

START A New Delphi Project by Using Ant, So We Can Make Daily Building. All Have to Do List Below:

1.Install delphi sdk1.4 and new version ant, and make ant works.

2. Copy Directories and Files from DPROJECT (D for Delphi) Template Library.

3. Make Project Files Stay in The Right Directory.

4.EDit the build.xml file. Let it fit the project.5.run Ant.

System Requirement

Delphi SDK1.4 or Higher

Ant 1.6 or higher

Delphi 6.0 or higher

Directories and Files

You can make Directories yourself, or copy from template. But make Sure The Directory Tree Like this:

Every Directory Is Made for a Certain Kind of Files. Directory Names and What Kind of Files Should Be Put in List Below:

Directory Files SHOULD BE PUT IN

Build Building Files

Data Project's data files

DOC Project's Documents for Installation and Deploying

LIB Libraries Project Depending ON

RES Resources Project Using

Install Resources for Installation

SRC Project 'Source Files

Config Project's Configuration FILES

Database Project's Database Files

Delphi Project's Delphi Source Code Files

DOCS Project's Documents for Manager, Developer, Tester

Scripts Project's script files

SQL Project's Script Files for Database

Now put the delphi files inTo the / src / delphi Directory.

The Build File

The build file is /build/build.xml. In the template we already have a default build file. Because every project has different name and different configuration, so we must edit the build file to suit project. We must edit the project name and Path in the build file.

Run Ant

After Doing That, Now Start A Command-Line Prompt, Change Path To ./build, and type ant. We can see a function list like this:

Now Ant Runs. We can Edit The Build File To Add New Features: Unit Testing, Packing, Deploying, ETC, as you like.

转载请注明原文地址:https://www.9cbs.com/read-16849.html

New Post(0)