How to specify base dir then we run ant like ant -f somedir/dir/build.xml

前端 未结 4 1770
猫巷女王i
猫巷女王i 2021-02-13 14:29

How to specify base dir then we run ant like ant -f somedir/dir/build.xml. Ant sets basedir relative to build.xml, if I specify



        
4条回答
  •  太阳男子
    2021-02-13 15:17

    You can try to use subant task:

    Assuming you have two different folders

    1. Your current folder X:/your/launching/folder where you are executing ant command from

    2. Folder where your destination bulid.xml is: Y:/any/folder/with/build.xml

    You can do the following:

    Create build.xml in X:/your/launching/folder with the next content:

    
        
            
        
    
    

    Then you can execute ant mytarget from X:/your/launching/folder folder to start building your Y:/any/folder/with/build.xml

    Update:

    You can override basedir property for subant build like this:

        
            
            
        
    

提交回复
热议问题