Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Unconventional naming of antlib descriptor(Cannot load antlib using recommended usage pattern)
Unconventional naming of antlib descriptor [message #1855004] Fri, 23 September 2022 02:41 Go to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

Epsilon's antlibs are in resources named tasks.xml instead of antlib.xml.

Unfortunately, this naming blocks the simplified declaration of antlibs described in the antlib documentation.

Quote:
Antlib namespace
The name space URIs with the pattern antlib:java.package are given special treatment.

When Ant encounters a element with a namespace URI with this pattern, it will check to see if there is a resource of the name antlib.xml in the package directory in the default classpath.


A project using workflow tasks would then declare:

<project xmlns:workflow="antlib:org.eclipse.epsilon.workflow.tasks"/>


It would be great if the antlib resource could be renamed.
Re: Unconventional naming of antlib descriptor [message #1855005 is a reply to message #1855004] Fri, 23 September 2022 06:14 Go to previous messageGo to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

This would also allow to remove the longish prefix to be reduced, if tasks was given a short name, as shown below

<epsilon.emf.loadModel name="Tree1"
  modelFile="TreeInstance.ecore"
  metamodelFile="Tree.ecore" />


to be abbreviated

<emf:loadModel name="Tree1"
  modelFile="TreeInstance.ecore"
  metamodelFile="Tree.ecore" />
Re: Unconventional naming of antlib descriptor [message #1855031 is a reply to message #1855005] Sat, 24 September 2022 16:43 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

Hi Jörn,

Thanks for the suggestion. Instead of renaming tasks.xml files (which would break existing code), I have added new antlib.xml files to all Epsilon ANT projects (as with tasks.xml files, the new files are also auto-generated from the respective plugin.xmls). The new antlib.xml files omit the epsilon.* prefixes from task names so the following should work fine now:

<project xmlns:epsilon="antlib:org.eclipse.epsilon.workflow.tasks" default="main">
  <target name="main">
    <epsilon:eol>
      "Hello world".println();
    </epsilon:eol>
  </target>
</project>


Thanks,
Dimitris

[Updated on: Sat, 24 September 2022 16:43]

Report message to a moderator

Re: Unconventional naming of antlib descriptor [message #1855307 is a reply to message #1855031] Fri, 07 October 2022 00:42 Go to previous message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

That looks very slick. Thank you!
Previous Topic:Native usage
Next Topic:Accessing URIConverter and using mappings
Goto Forum:
  


Current Time: Sat Apr 27 12:38:27 GMT 2024

Powered by FUDForum. Page generated in 0.03369 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top