2014-09-30 135 views
0

我正在尋找一種通過Ant構建腳本運行play dist的方法。我研究過使用exec任務,但它不適合我。這裏是我的嘗試:從Ant腳本執行遊戲

<target name="deploy"> 
    <exec executable="play"> 
     <arg value="dist" /> 
    </exec>  
</target> 

我得到這個錯誤:

C:\Users\path\to\build.xml:39: Execute failed: java.io.IOException: Cannot run program "play": CreateProcess error=2, The system cannot find the file specified

戲劇已經在我的Path環境變量中,我可以通過鍵入play,這樣ISN在命令行中執行它這個問題。由於系統管理員限制,我不允許使用絕對路徑。

任何想法?

回答

0

端了手動搜索播放可執行文件和存儲性能的exec任務使用:

<exec executable="where" outputproperty="play.dir" osfamily="windows"> 
     <arg value="play.bat" /> 
</exec> 
<exec executable="which" outputproperty="play.dir" osfamily="unix"> 
     <arg value="play" /> 
</exec> 

<exec executable="${play.dir}" dir=" ... "> 
     <arg value="dist" /> 
</exec>