Call ant target multiple times with different parameters

后端 未结 1 936
孤城傲影
孤城傲影 2021-01-05 03:36

Is it possible in Ant to call the same target multiple times with different parameters?

My command looks like the following:

ant unittest -Dproject=\         


        
1条回答
  •  天涯浪人
    2021-01-05 04:30

    You could add another target to invoke your unittest target twice, with different parameters, using the antcall task e.g.

    
    
        
            
                
            
            
                
            
        
    
        
            
        
    
    
    

    Output:

    test:
    
    unittest:
         [echo] project=proj1
    
    unittest:
         [echo] project=proj2
    
    BUILD SUCCESSFUL
    Total time: 0 seconds
    

    Alternatively, you could change the unittest target to be a macrodef:

    
    
        
            
            
        
    
        
            
            
                
            
        
    
    
    

    0 讨论(0)
提交回复
热议问题