ant tag

quote
The <project> tag

  corresponds to one project per build file. The root tag of the build file when the <project> tag is used. It can have multiple intrinsic properties, as shown in the code, and the meaning of each property is as follows.

(1) default : Indicates the default running target, this attribute is required.

(2) basedir : Indicates the base directory of the project.

(3) name table: indicates the project name.

(4) description : Indicates the description of the item.


<target> tag

A project tag can have one or more target tags. A target tag can depend on other target tags. For example, there is one target for compiling programs and another for claiming executable files. The file must be compiled before the executable file is generated, because the target of the executable file depends on the target of the compiled program. All properties of Target are as follows.

(1).name : Indicates that this attribute is required.

(2).depends: Represents the target of dependencies.

(3) if : Indicates that it is executed only when the property is set.

(4) unless: Indicates that it is executed when the property is not set.

(5) description: Indicates the description of the item.

Ant's depends attribute specifies the execution order of the target. Ant will execute each target in turn according to the order in which the targets appear in the depends attribute. Before executing, the target it depends on needs to be executed first. The depends attribute of the target named run in the program is compile, and the depends attribute of the target named compile is prepare, so the order of execution of these targets is prepare->compile->run. A target can only be executed once, even if multiple targets depend on it. If there is no if or unless attribute, target will always be executed.


<mkdir> tag

This tag is used to create a directory, and it has an attribute dir to specify the name of the directory to be created. The code is as follows:

<mkdir dir=”${class.root}”/>

Created by the above code A directory that has been specified by the previous property tag.


<jar> tag

This tag is used to generate a JAR file with the following attributes.

(1) destfile: Indicates the name of the JAR file.

(2) basedir: Indicates the name of the file being archived.

(3) includes : Indicates the file mode of other archives.

(4) exchudes : Indicates the file pattern to be excluded.


<javac tag>

This tag is used to compile one or a group of java files, and its attributes are as follows.

(1).srcdir : indicates the directory of the source program.

(2).destdir: Indicates the output directory of the class file.

(3).include : Indicates the mode of the compiled file.

(4).excludes : Indicates the pattern of excluded files.

(5).classpath: Indicates the classpath used.

(6).debug : Indicates the included debugging information.

(7).optimize : Indicates whether to use optimization.

(8).verbose: Indicates that detailed output information is provided.

(9).fileonerror: indicates that it will automatically stop when an error is encountered.


<java> tag

This tag is used to execute the .class file generated by compilation, and its attributes are as follows.

(1).classname : Indicates the class name that will be executed.

(2).jar : Indicates the name of the JAR file containing the class.

(3).classpath : The classpath used by the representation.

(4).fork : Indicates that the class is run in a new virtual machine.

(5).failonerror: Indicates that it will automatically stop when an error occurs.

(6).output: Indicates the output file.

(7).append : Indicates appending or overwriting the default file.


<delete> tag

This tag is used to delete a file or a group of files, and the attributes are as follows.

(1)/file : Indicates the file to be deleted.

(2).dir : Indicates the directory to be deleted.

(3).includeEmptyDirs : Indicates whether to delete empty directories. The default value is delete.

(4).failonerror: Indicates whether to stop when an error is encountered, the default value is automatic stop.

(5).verbose: Indicates whether to list the deleted files, the default value is not listed.


<copy> tag

This tag is used for copying files or filesets, and its attributes are as follows.

(1).file : Indicates the source file.

(2).tofile: Indicates the target file.

(3).todir: Indicates the target directory.

(4).overwrite: Indicates whether to specify whether to overwrite the target file. The default value is not to overwrite.

(5).includeEmptyDirs : Indicates whether to copy empty directories, the default value is copy.

(6).failonerror: Indicates whether to automatically stop if the target is not found, the default value is stop.

(7).verbose: Indicates whether to display detailed information, the default value is not displayed.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326805606&siteId=291194637
ANT
ANT