I am trying to run an Ant build on a Mercurial repository and I am having some trouble. The Ant task can't seem to find the build.xml
file. When I look through the Hg repo, I can find my file at:
myrepo/.hg/store/data/build
but inside here, the build.xml
file is named build.xml.i
and I think this may be confusin开发者_如何学Pythong Ant, although I'm not sure.
What is the best way to run an Ant script against a Mercurial repository? Or am I doing this completely wrong?
You're trying to run a build inside the repository (myrepo/.hg/store/data/build). That, and may other things will fail unless you use a work directory. To get a work directory, tell HG to clone the repository.
In other words, you should treat HG repositories as obscure databases only to be manipulated through HG commands. The same applies to any other VC/SCM system (try taking a look inside a SVN repository).
You need to update the 'working directory' with the version of build.xml you want. This is generally the latest, so you can:
$ cd hgrepo
$ hg update
$ ant build
Where hgrepo
is the Mercurial repository.
精彩评论