ANT exec task with WINEPREFIX

I need to execute a wine program (on Linux) within an ANT script (build.xml) from eclipse.

Supposing the wine program is in default WINEPREFIX, the following would work flawless:

<exec dir="${dist}" executable="wine" os="Linux">
    <arg line="'C:Program FilesInno Setup 5Compil32.exe'" />
    <arg line="/cc 'setup.iss'" />
</exec>

Unfortunatelly, due to compatibility issues with other wine programs, I had install that program to another WINEPREFIX. I can successfully run it from terminal by typing WINEPREFIX=~/.wine_innosetup wine "C:Program FilesInno Setup 5Compil32.exe" The problem now is how to add WINEPREFIX=~/.wine_innosetup env variable while executing my ANT exec task?

This doesnt work:

<exec dir="${dist}" executable="WINEPREFIX=~/.wine_innosetup wine" os="Linux">

...ok found it...

<exec dir="${dist}" executable="wine" os="Linux">
    <arg line="'C:Program FilesInno Setup 5Compil32.exe'" />
    <arg line="/cc 'setup.iss'" />
    <env key="WINEPREFIX" value="${user.home}/.wine_innosetup"/>
</exec>

the <env> tag did the trick!

链接地址: http://www.djcxy.com/p/44408.html

上一篇: Eclipse没有找到蚂蚁

下一篇: ANT执行任务与WINEPREFIX