How can I get a list of build targets in Ant?

前端 未结 4 980
栀梦
栀梦 2021-01-29 20:27

My codebase has a long build.properties file written by someone else. I want to see the available built targets without having to search through the file manually.

4条回答
  •  [愿得一人]
    2021-01-29 20:47

    The -p or -projecthelp option does exactly this, so you can just try:

    ant -p build.xml
    

    From ant's command line documentation:

    The -projecthelp option prints out a list of the build file's targets. Targets that include a description attribute are listed as "Main targets", those without a description are listed as "Other targets", then the "Default" target is listed ("Other targets" are only displayed if there are no main targets, or if Ant is invoked in -verbose or -debug mode).

提交回复
热议问题