I just committed a small change to ScriptTask to allow the definition of custom functions inside a <script> task instance - see example below:
This is quite nice as it means people can easily prototype new functions without having to compile and load a dedicated task/function assembly. Note that the script still requires a ScriptMain even if its empty.


<script language="C#"> <code><![CDATA[
public static void ScriptMain(Project project) {
}
[FunctionSet("test", "Test")]
public class TestFunctions : FunctionSetBase {
public TestFunctions(Project project, PropertyDictionary propDict) : base(project, propDict) {
}
[Function("test-func")]
public static string Testfunc( ) {
return "some result !!!!!!!!";
}
}
]]></code>
</script>
<echo message="${test::test-func()}" /> ...


--
Ian MacLean, Developer, ActiveState, a division of Sophos
http://www.ActiveState.com




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to