Integration and Construction Guide (4)

zhaozj2021-02-12  149

1 Building basic knowledge

1.1 Ant build script

The core of automation is the script of expression components dependent relationships and build procedures. The Make tool uses Makefile, and Ant uses a configuration file named Build.xml based on the XML format based default file.

1.1.1 Ant Project Profile

The ANT profile describes a build project (which consists of some attribute definitions and one target tree; the target represents a desired build result (for example, generating a link good executable), And express its dependence, common build targets include initialization (Compile, unit test (TEST), installation (CLEAN), etc., each target contains it to implement it The task of execution is very rich, such as the source code compilation, file copy, execution of command line operations. Ant also provides a very important task is to implement other project profiles, making batch processing of multiple build items possible.

1.1.2 ANT configuration file example

Below is an example of a configuration file for an ANT project:

">

Build File for All Improve Library Project

Exceptions = "true" multithreaded = "true" runtime = "Dynamic" debug = "true">

Failοnerrοr = "true" vmlauncher = "false" OS = "Windows 2000">

Failοnerrοr = "true" vmlauncher = "false" OS = "Windows 2000">

Depends = "CleanAll, Autobuild, Install, Test"

Description = "Make a Clean (Re) Install and test>

In this Ant profile, some of the project will be referenced, such as environment variables, root directory paths, specified compilers, etc .; project default build targets are installall, which makes initialization (init) Cleanall, Compilation (Autobuild), Install, Test (Test), etc. Introduction The library 3D_Party.lib is required to be linked via the Linker section.

For the specific configuration and use of each ANT configuration file in this project, see the ANT User Manual and other reference materials, and read the ANT configuration file itself.

1.1.3 ANT Example

An example of executing on the command line:

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

New Post(0)