facebook

Linked folder resources can’t be found by Ant build scripts

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #269049 Reply

    In some cases it is important to me that external resources be referenced by my projects. I have a project with a ThirdParty linked folder that contains several jars our code needs to compile and run. I created this folder by selecting the project and picking new->folder->advanced->link to folder. But when I then export an Ant build script, the build script references the contents of my ThirdParty folder as if it were a real folder rather than reference the linked location. The end result is that my compiles fail to resolve symbols in the jar(s).

    Anybody know of a solution to this problem? I don’t want to edit the script because it will be overwritten each time I export it.

    #269050 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

    I’m not aware of a workaround…the problem is spawned as a result of Eclipse using an Eclipse-only constructed (linked resources) and you trying to make use of them in a completely separate technology stack and VM space (inside the Ant script).

    I don’t know that there is an automated way around this.

    #269065 Reply

    Well, I think I can see what belongs in the Ant script. When I ask Eclipse to export the script, it already defines properties that identify the location of various resources. For example, I also have a linked source folder, where certain source code is outside of the workspace directory tree. When eclipse generates the script it includes the following reference to that directory.

    <property name=”src.link” value=”../../../../../apps/SpatialAge/src”/>

    Then when compiling, copying to the bin folder, etc. the script intelligently uses ${src.link} to reference the source files.

    The same approach should be used for references to my ThirdParty folder. The script need only define a property like:

    <property name=”ThirdParty.location” value=”../../../../../apps/SpatialAge/ThirdParty”/>

    and then when it references the jars, include references such as {ThirdParty.location}/servlet.jar.

    If the product can correctly handle linked source folders, why not handle regular folders with the same mechanism?

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Linked folder resources can’t be found by Ant build scripts

You must be logged in to post in the forum log in