Labs
  1. Labs
  2. LABS-410

[eclipse] Linked source folder for project which are a dependency

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Next
    • Fix Version/s: Current
    • Component/s: Magma
    • Labels:
      None

      Description

      The Magma Eclipse plugin currently creates linked source folders for sources of Magma dependencies. This gives AJDT the ability to properly resolve all Magma aspects, ITDs, and also to weave in user's own aspects.

      When a project in the workspace is added as a dependency, however, only the binary output folder of the project is exposed to AJDT, giving access only to stuff already weaved there, but not using aspects in that project or giving the ability to weave into it.

      AJDT only offers ways to add the project to the inpath or to the aspectpath, as opposed to a LTW-like environment.

      So, we need linked sources also for those projects.

        Activity

        Hide
        Simone Gianni added a comment -

        Thanks to recent fixes in AJDT it's now possible to add stuff to both inpath and aspectpath.

        The trick is to add the entire maven container to both paths, and the restrict it using names of dependencies we want included (in our case, dependency projects).

        This works from a binary POV. AJDT does not take into account that it also has the source code for those projects to build its model, so the model is limited, giving a suboptimal editor feedback.

        As it is now, having an aspect in the main project weaving a dependency class is correctly reported (cause the source is considered), while having an aspect in a dependency weaving a class in the main project is not correctly reported (cause the source is NOT considered).

        This is however the best solution actually available, cause it still compiles properly (also when running junit tests), does not give any Eclipse sideffects, and leaves to Eclipse and AJDT the task of properly coordinating and optimizing the build cycle between interdependant projects, thus reducing cpu cycles and memory consumption.

        Show
        Simone Gianni added a comment - Thanks to recent fixes in AJDT it's now possible to add stuff to both inpath and aspectpath. The trick is to add the entire maven container to both paths, and the restrict it using names of dependencies we want included (in our case, dependency projects). This works from a binary POV. AJDT does not take into account that it also has the source code for those projects to build its model, so the model is limited, giving a suboptimal editor feedback. As it is now, having an aspect in the main project weaving a dependency class is correctly reported (cause the source is considered), while having an aspect in a dependency weaving a class in the main project is not correctly reported (cause the source is NOT considered). This is however the best solution actually available, cause it still compiles properly (also when running junit tests), does not give any Eclipse sideffects, and leaves to Eclipse and AJDT the task of properly coordinating and optimizing the build cycle between interdependant projects, thus reducing cpu cycles and memory consumption.
        Hide
        Simone Gianni added a comment -

        As a side note, if the project is a dependency that is also installed, Magma should notice that the project is in the workspace and NOT create a magmalnk folder to the unzipped sources.

        Show
        Simone Gianni added a comment - As a side note, if the project is a dependency that is also installed, Magma should notice that the project is in the workspace and NOT create a magmalnk folder to the unzipped sources.
        Hide
        Simone Gianni added a comment -

        Basic experiments on having the source folder of another project linked is giving less than optimal results :

        • Error markers are placed on the linked source folder on the other project instead that on the main project
        • Despite being derived, results from the linked folder still appears in searches
        • F3 from project opens linked directory files instead of java file in dependency project

        Don't know if this behaviour can be fixed somehow, or if adding dependencies to both inpath and aspectpath can be a solution.

        Show
        Simone Gianni added a comment - Basic experiments on having the source folder of another project linked is giving less than optimal results : Error markers are placed on the linked source folder on the other project instead that on the main project Despite being derived, results from the linked folder still appears in searches F3 from project opens linked directory files instead of java file in dependency project Don't know if this behaviour can be fixed somehow, or if adding dependencies to both inpath and aspectpath can be a solution.
        Hide
        Simone Gianni added a comment -

        This could bring another advantage, that is not requiring to clean install dependencies separately when magma:run is invoked for a web project. In fact, directing output of project linked source folders to a specific output folder, and including it in the magma:run classpath, can ease the pain of rebuilding them.

        Since there could be exist a problem with duplicate resources however, this solution has to be validated against generated magma.locals and possible enhancements on that part before.

        Show
        Simone Gianni added a comment - This could bring another advantage, that is not requiring to clean install dependencies separately when magma:run is invoked for a web project. In fact, directing output of project linked source folders to a specific output folder, and including it in the magma:run classpath, can ease the pain of rebuilding them. Since there could be exist a problem with duplicate resources however, this solution has to be validated against generated magma.locals and possible enhancements on that part before.
        Hide
        Simone Gianni added a comment -

        Adding a project present on the Maven classpath to both inpath and aspectpath for AJDT triggers an AJDT bug, which could be worth investigating.

        Show
        Simone Gianni added a comment - Adding a project present on the Maven classpath to both inpath and aspectpath for AJDT triggers an AJDT bug, which could be worth investigating.

          People

          • Assignee:
            Simone Gianni
            Reporter:
            Simone Gianni
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development