Use command line parameters in ant

Source: Internet
Author: User

When developing the Omnitrix module, you must create multiple directories as required by the system.

It is really boring to repeat such a series of operations every time. Recently, ant can be used for simple implementation.

Copy the following content to the build. xml file:

<? XML version = "1.0" encoding = "UTF-8"?> <Project name = "Omnitrix" Default = "Omnitrix" basedir = ". "> <property name =" root "location = ". "/> <target name =" Create-module "> <fail message =" Usage: ant create-module-dmodule_name = foo "> <condition> <not> < Isset Property = "module_name"/> </not> </condition> </fail> < Mkdir   Dir = "$ {Root}/modules/$ {module_name}"/> <Mkdir   Dir = "$ {Root}/modules/$ {module_name}/controllers"/> < Mkdir   Dir = "$ {Root}/modules/$ {module_name}/templates"/> < Mkdir   Dir = "$ {Root}/modules/$ {module_name}/ages"/> < Mkdir   Dir = "$ {Root}/modules/$ {module_name}/ages/Chinese"/> </Target> </Project>

 

Execute the following command on the command line to perform the following operations:

 
Ant create-module-dmodule_name = foo

When the command parameter is not specified, ant can prompt us to use the correct method and terminate the execution.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.