This is the second of a series of actual combat nights, focusing on some open source or third-party technologies to consider when designing a build platform, with both introductory introductions like "Hello World" and the essence of content parsing, as well as a reminder.
1. Related open source or third party technology
Before designing, it is necessary to understand some open source or third party technology in the construction of the project. The best way to learn these techniques is to get a copy, read the document carefully, practice some small examples, and use them in your work.
1.1 Ant Project Building tools
To give you a better understanding of the design that follows, this section introduces the basics and three points of the main features of the tool: multiple file composition profiles, target dependencies, extensions, and an object-oriented feature of the ant configuration script.
Briefly
Ant is a part of the Apache Open source campaign, and it is the same java-based build tool as the familiar make system. He overcomes the OS dependencies of make, and can also invoke OS-specific instructions. Unlike make, which uses the scripting commands of the operating system, Ant uses Java classes to extend itself. Ant's configuration file is a popular XML format.
The following is one of the simplest build.xml files:
<?xml version= "1.0" encoding= "Iso-8859-1"?>
<project name= "ProjectTemplate" default= "Init" basedir= "." >
<target name= "Init" >
<property name= "Lib.dir" value= "Lib"/>
<echo message= "Hello ${user.name}! Lib.dir is set to ${lib.dir} ">
</echo>
</target>
</project>
Running the ant command produces the following results:
gongys$ Ant
gongys$ Hello gongys! Lib.dir is set to Lib
In this simple build.xml shows the ant configuration file definition target (target), defines the property, accesses the property's method, where ${user.name} is a system attribute.