NAnt integration

17 views
Skip to first unread message

Mikael Henriksson

unread,
Jan 26, 2010, 9:43:24 AM1/26/10
to phantom...@googlegroups.com
Hi,

I was wondering about the NAnt integration and can't make it work with "import tasks from nant.core"
BCE0000: D:\Projects\Numo\build.boo(19,1): BCE0044: Boo.Lang.Compiler.CompilerError: expecting "EOF", found 'import'. ---> D:\Projects\Numo\build.boo:19:1: expecting "EOF", found 'import'

without the import I get the following message:
BCE0000: D:\Projects\Numo\build.boo(103,3): BCE0005: Boo.Lang.Compiler.CompilerError: Unknown identifier: 'xmlpoke'.

Any ideas?

Mikael Henriksson

unread,
Jan 26, 2010, 9:51:57 AM1/26/10
to phantom...@googlegroups.com
Wild guess, the task I am after is not located in NAnt.Core? :)

Jeremy Skinner

unread,
Jan 26, 2010, 10:12:30 AM1/26/10
to phantom...@googlegroups.com
xmlpoke *is* in Nant.Core. Could you post the contents of the script?

Jeremy


2010/1/26 Mikael Henriksson <mik...@zoolutions.se>

Andrey Shchekin

unread,
Jan 26, 2010, 10:58:14 AM1/26/10
to phantom-discuss
Have you put "import tasks from" on top of the script?
Seems like an import location error to me.

Mikael Henriksson

unread,
Jan 27, 2010, 9:58:00 AM1/27/10
to phantom...@googlegroups.com
Yeah it was that but now I run into another issue...
D:\Projects\Numo\build.boo(75,8): BCE0019: Boo.Lang.Compiler.CompilerError: 'Run' is not a member of 'void'.

I get this on all rows that try to create a directory like below.
mkdir("${build_ui_dir}")

Jeremy Skinner

unread,
Jan 27, 2010, 10:05:58 AM1/27/10
to phantom...@googlegroups.com
This works fine for me. Which build are you running?

2010/1/27 Mikael Henriksson <mik...@zoolutions.se>

Jeremy Skinner

unread,
Jan 27, 2010, 10:08:20 AM1/27/10
to phantom...@googlegroups.com
Also: please post the contents of the entire target - it's difficult to troubleshoot these issues without seeing the context...

2010/1/27 Jeremy Skinner <jer...@jeremyskinner.co.uk>

Mikael Henriksson

unread,
Jan 27, 2010, 10:18:47 AM1/27/10
to phantom...@googlegroups.com
Since I had problems with the "official" build and copying folders recursively I run my own build. I did send you a pull request for that.
Don't think it's necessary to send the whole script. When I do the following (this is the whole script)

import tasks from NAnt.Core

build_dir = "build2"

target default:
  rm("${build_dir}")
  mkdir("${build_dir}")

the script fails with the message:
BCE0000: D:\Projects\Numo.Autosync\build.boo(7,8): BCE0019: Boo.Lang.Compiler.CompilerError: 'Run' is not a member of 'void'.

Line 7 of course being mkdir line. 

Jeremy Skinner

unread,
Jan 27, 2010, 10:36:30 AM1/27/10
to phantom...@googlegroups.com
Ah, my tests didn't have the "import tasks from..." line in.

This is happening because nant also has a built in "mkdir" task and the call to "mkdir" is incorrectly being identified as a Runnable.

I've created an issue for this: (http://github.com/JeremySkinner/Phantom/issues/issue/11) and will try and get it fixed over the next week.

For now, a temporary workaround is to manually call Directory.CreateDirectory.

Jeremy

2010/1/27 Mikael Henriksson <mik...@zoolutions.se>

Mikael Henriksson

unread,
Jan 28, 2010, 12:32:00 PM1/28/10
to phantom...@googlegroups.com
I am a tiny bit unsure about where to start with the NAnt integration but I also desperately need xml poking so maybe I can help out with this. I'll have a look during the weekend.

Andrey Shchekin

unread,
Jan 28, 2010, 12:41:26 PM1/28/10
to phantom...@googlegroups.com
The beauty of Phantom is that you do not actually need external task for that.
For example:
import System.Xml

def xmlpoke(fileName as string, xpath as string, value as string):
    document = XmlDocument()
    document.Load(fileName)
    document.DocumentElement.SelectSingleNode(xpath).Value = value
    document.Save(fileName)

Mikael Henriksson

unread,
Jan 28, 2010, 12:47:10 PM1/28/10
to phantom...@googlegroups.com
And of course that's why I could do Directory.CreateDirectory("path") as well! Thanks Andrey saved me the waiting time. Of course it would be nicer to not have to write all that code myself but on the other hand it's an incredible power given to me being able to program on the fly instead of worrying about matching a stupid XSL! :)
Reply all
Reply to author
Forward
0 new messages