SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Nant contrib

Last post 09-29-2006 6:18 PM by MattWard. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 06-15-2006 9:30 AM

    • cws
    • Top 200 Contributor
    • Joined on 06-15-2006
    • Posts 18

    Nant contrib

    Hi!

    Is there a way to add/integrate nant contrib tasks to nantAddIn? Which will enable help/code completion

    Regards

    /C-W
  • 06-15-2006 2:00 PM In reply to

    Re: Nant contrib

    The xml completion for a NAnt build file is determined by the NAnt schema (data\schemas\nant.xsd). So you'll need a schema that includes the NAnt contrib tasks. There is no official NAnt Contrib schema, at least I could not find one, but it seems that you can generate a schema that includes all the NAnt tasks and the NAnt Contrib tasks. If NAnt Contrib has been installed into the NAnt directory then apparently you can use the nantschema task to generate a schema for all the NAnt and NAnt contrib tasks.

    <project name="GenerateSchema" default="generate">
         <property name="filename" value="nant.xsd"/>
         <target name="generate">
              <nantschema output="${filename}" target-ns="http://nant.sf.net/schemas/nant.xsd"/>
        </target>
    </project>

    Then add this generated schema to SharpDevelop via Tools | Options | Text Editor | XML Schemas.
  • 06-27-2006 12:57 PM In reply to

    • cws
    • Top 200 Contributor
    • Joined on 06-15-2006
    • Posts 18

    Re: Nant contrib

    Thanks for replying Matt!

    Maybe I havn't tried hard enough, but I havn't suceeded to replace the existing xml schemas as you suggested, but I am able to add a new one. On the other hand this seems not the solve the problem though.

    Do you know more about it?
    I think I need to remove the exisitng ant schema or the problem has something to do with namespaces.

    Regards

    /C-W
  • 06-27-2006 1:09 PM In reply to

    Re: Nant contrib

    If your new NAnt schema has the same namespace as the one shipped with SharpDevelop (data\schemas\nant.xsd) then you'll need to replace it or change its namespace.

    You can replace it with your own schema or change its file extension, to something other than .xsd, and SharpDevelop will ignore it.
  • 09-29-2006 5:41 PM In reply to

    Re: Nant contrib

    I'm trying to replace the nant.xsd with a newer one with NAntContrib, but I'm running into a few issues.

     a) if you rename the existing nant.xsd to nant.xsdx, #D still picks it up, you have to rename it to nant.xxsd for it to ignore it.

     b) If I add the new nant shcema, it has a namespace of http://nant.sf.net/schemas/nant.xsd, #D doesn't appear to assocate .build files with this schema, where do I need to set this?  Our build files do not have a namespace declaration in them and I'd like to have it automatically associate the nant.xsd with .build files as it currently does with the rc3 schema.

     

    Thanks,

    John
     

  • 09-29-2006 6:18 PM In reply to

    Re: Nant contrib

    You should be do everything via Tools | Options | Text Editor | XML Schemas. There's some documentation on this in another post, but it should be straightforward.

    To try out the schema I generated and added it via the XML Schemas options, and then changed the association between the .build file extension and the new schema namespace, on the same options page. I left the original NAnt schema alone, since the namespaces were different. The XML Editor does not seem to pick up the new schema until the open file is closed and re-opened. I'll have to fix that bug.

    The other alternative is to completely replace the existing NAnt.xsd in data/schemas, and change the namespace so it matches. 

Page 1 of 1 (6 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.