How to add a library directory to a project in my DSL [message #1048699] |
Wed, 24 April 2013 17:07  |
Eclipse User |
|
|
|
I want to configure an Eclipse project with code in my DSL to recognize some library directories (which are external to the project folder). That is, I have some functions defined in these libraries which I want to call from my project.
The ideia is the same as including classes in the class path for Java or libraries for C. How can I do it?
|
|
|
|
|
|
Re: How to add a library directory to a project in my DSL [message #1052845 is a reply to message #1052829] |
Tue, 30 April 2013 12:50   |
Eclipse User |
|
|
|
On 04/30/2013 05:45 PM, Erick Fonseca wrote:
> So... anyone can help me? I will try to rephrase what I need.
>
> I need to be able to use imports in my DSL files to include other files
> (or packages for that matter) that are NOT in the same project. Say I
> have myproject1 and myproject2, and both have files importing
> mylib.mydsl. Naturally, I don't want to have a copy of mylib.mydsl in
> both projects, but rather in a separate directory.
> The problem is, as far as I know, import URI and import Namespace can
> only import stuff from the same project they are in. How can I get past
> this limitation?
if you put your library DSL files in a bundle, the projects which depend
on that bundle will be able to refer to the library files :)
import namespace uses a classpath approach, thus it can import also
files contained in bundles a project depends on...
hope this helps
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
|
|
|
|
Re: How to add a library directory to a project in my DSL [message #1053828 is a reply to message #1052876] |
Tue, 07 May 2013 14:49  |
Eclipse User |
|
|
|
On 04/30/2013 11:42 PM, Erick Fonseca wrote:
> Thank you for your answer. Ideally, I wanted a way to use a location for
> the library independent from Eclipse projects, but this will do.
>
> I'm not sure if I know how to create a bundle, though. I created a
> simple Eclipse project and moved mylib.mydsl to it. There, I chose
> Configure->Convert to Plug-in Project. Is that it? And how can I set a
> dependency in the other projects?
> Sorry for the silly questions, I'm not used to this Java style development.
Yes, you can either convert it to Plug-in Project, or create a new
Plug-in Project; the packages you want to export must be declared in the
Runtime tab of the MANIFEST editor.
In other projects, you add a dependency to your library project in the
Dependencies tab of the MANIFEST editor.
Hope this helps
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
|
|
|
Powered by
FUDForum. Page generated in 0.31176 seconds