如果有人在Windows(NTFS)上运行Ant symlink任务会怎样? [英] What happen if someone run Ant symlink task on Windows (NTFS)?

查看:81
本文介绍了如果有人在Windows(NTFS)上运行Ant symlink任务会怎样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个ant build脚本.我需要创建一个符号链接,然后找到了符号链接任务.根据手册,它仅适用于Unix.如果有人在Windows平台上运行我的构建脚本会怎样?建造会失败吗?还是在Windows平台上将忽略此任务?还是使用NTFS驱动器,它甚至可以工作?

I write ant build script. I need to create a symlink and I found symlink task. According to manual, it works only on Unix. What happens if someone run my build script on windows platform? Will build fail? Or this task will be ignored on windows platform? Or in case of NTFS drive, it will even work?

推荐答案

我正在运行Win7,并尝试了它.由于我安装了Mingw,因此使用了ln. Ln似乎只是在复制所有内容.由于普通的Windows安装没有ln,因此在那里会失败.

I'm running Win7 and I tried it. Since I have Mingw installed it used ln. Ln seemed just to copy everything. Since a normal Windows installation does not have ln, it would fail there.

在没有ln的情况下会发生以下情况:

Here's what happens without ln:

C:\Users\Janus\Desktop>.\apache-ant-1.8.2\bin\ant
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar
Buildfile: C:\Users\Janus\Desktop\build.xml

dist:

BUILD FAILED
C:\Users\Janus\Desktop\build.xml:3: Could not launch ln: java.io.IOException: Cannot run program "ln": CreateProcess error=2, The system can
not find the file specified

Total time: 1 second

C:\Users\Janus\Desktop>

Build.xml:

Build.xml:

<project name="MyProject" default="dist" basedir=".">
<target name="dist">
<symlink link="lol" resource="d3dwindower" />
</target>
</project>

这篇关于如果有人在Windows(NTFS)上运行Ant symlink任务会怎样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆