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

前端 未结 4 987
栀梦
栀梦 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:48

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

    ant -p build.xml
    

    You can make a target to invoke this like:

    
        
            
            
            
        
    
    

    which you can then set as the default, so just typing ant will list the available targets.

    (Combining @Grodriguez' answer and @sschuberth's comment - I thought it was worth an answer by itself)

提交回复
热议问题