ANT Chinese Manual - Introduction

zhaozj2021-02-16  49

Introduction

Apache Ant Is A Java-Based Build Tool. In Theory, IT IS Kind of Like Make, WITHOUT Make's Wrinkles.

Why?

Why another build tool when there is already make, gnumake, nmake, jam, and others? Because all those tools have limitations that Ant's original author could not live with when developing software across multiple platforms. Make-like tools are inherently shell-based : they evaluate a set of dependencies, then execute commands not unlike what you would issue on a shell This means that you can easily extend these tools by using or writing any program for the OS that you are working on; however, this also means. That you limit yourself to the OS, or at Least The OS Type, Such As UNIX, That You Are Working ON.

Makefiles are inherently evil as well. Anybody who has worked on them for any time has run into the dreaded tab problem. "Is my command not executing because I have a space in front of my tab? !!" said the original author of Ant Way Too Many Times. Tools Like Jam Took Care of this To a Great Degree, But Still Have Yet Another Format To Use and Remember.

Ant is different. Instead of a model where it is extended with shell-based commands, Ant is extended using Java classes. Instead of writing shell commands, the configuration files are XML-based, calling out a target tree where various tasks get executed. Each Task is Run by an Object That Implements a Partic Taask Interface.

Grand, this Removes Some of the Expressive Power That Inhere In Being Able To Construct A Shell Command SuMMAND SUCH AS

`find. -name foo -exec rm {}`

, But it gives you the ability to be cross-platform -. To work anywhere and everywhere And hey, if you really need to execute a shell command, Ant has antask that allows different commands to be executed based on the OS it is executing on .

Introduction Apache Ant is a Java build tool, in theory, he is a compiled, but there is no compilation trace

There are now many compilation tools, such as make, gnumake, nmake, jam, and more: Why should we do an Ant to compile? Because other tools have a limitations: can't cross the platform, this is also the ANT author can't endure.

Ant is a compilation tool based on JavaClass file extension. It doesn't want many compilation tools. Based on a command shell, replaced, Ant is a set of target tree to perform compilation process, each target tree is A special task interface, you can use this tool anywhere, he is really cross-platform, if you must insist on using the command line to perform the compilation process, good, Ant also has a special task called EXEC, you can operate Different tasks are performed on the system.

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

New Post(0)