Can Ant expand environment variables from a properties file?

前端 未结 1 1256
盖世英雄少女心
盖世英雄少女心 2021-02-19 22:03

I have a question regarding Ant and its treatment of environment variables. To illustrate I have a small sample.

Given the Ant build file test.xml:

1条回答
  •  佛祖请我去吃肉
    2021-02-19 22:22

    You need to read the test.props property file after the environment - you could do so using another property task, i.e. add

    
    

    after your existing property environment task.

    In full:

    
    
    
    
        
        
    
    

    When you supply the properties file on the command line this gets processed before the content of the build, but at that time ${env.MyEnvVar} is not yet set.

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