How to set Ant properties based on variables in Eclipse?

后端 未结 5 1925
我在风中等你
我在风中等你 2021-02-13 23:00

I have a common problem and there are probably countless ways to solve it. I\'m looking for an elegant, simple solution to this typical scenario:

I have a project in Ec

5条回答
  •  生来不讨喜
    2021-02-13 23:45

    You can set eclipse relative properties for your ANT Build from eclipse

    Go to your ANT Builder properties and in arguments section you can set properties using -D as below

    -Dworkspace="${workspace_loc}" -Dproject_dir="${project_loc}"
    

    (here workspace_loc and project_loc are eclipse variables). These properties can be accessed in your ANT build script like regular properties, for example:

    
    
    

提交回复
热议问题