The Artima Developer Community
Sponsored Link

Weblogs Forum
Tip: Using AspectJ with WSAD 5.1

1 reply on 1 page. Most recent reply: Nov 19, 2005 1:57 PM by Bruce Maxfield

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Dale Asberry

Posts: 161
Nickname: bozomind
Registered: Mar, 2004

Tip: Using AspectJ with WSAD 5.1 (View in Weblogs)
Posted: Jul 29, 2004 11:50 AM
Reply to this message Reply
Summary
Simple configuration settings for putting your aspects into a different project than your primary project(s).
Advertisement

Here's the original message:


Subject: [aspectj-users] AJDT - cross-project weaving in WSAD

Hi All,

I need some help with AJDT 1.1.4 used with AspectJ 1.2 in WSAD 5.1.0. (Eclipse 2.x)

Below is an answer to a former question:

Suppose you have Project A which is pure Java and Project B that is AspectJ. You want to apply your aspects from Project B to Project A. You open the ProjectProperties for Project B and add a new source folder (through the java build path tab). When you add the source folder, make it a linked source folder that points to the source folder for ProjectA.

When setup this, ProjectA can build as a pure java project. When you build ProjectB it will apply your aspects to the source from ProjectA and the resulting output will be put into the bin directory for ProjectB.

I'm interested in doing the same thing and I tried the suggestion. Unfortunately, I'm unable to define a linked source folder. Actually, according to the WSAD help about linked source files, there should be a dialog with an advanced option to specifiy that a source folder is actually a link to a source folder within another project. I don't even see the Advanced button.

Any explanation, idea, suggestion?

Thanks,

Jean-Luc Libioulle


And my reply:


My solution is as follows:

  • Convert Project A to an aspect project.
  • In Project B's "Project Properties->AspectJ Compiler" tab, set the "Output jar" field
  • In Project A's "Project Properties->AspectJ Compiler" tab, set the "Input jars (aspects)" field to point to the output jar from Project B (above).
  • Build Project B
  • Build Project A

A coworker has something similar, but prefers to keep the .class files in the bin\ directory of Project B. It requires using the "Zip Creation" plugin.

  • Convert Project A to an aspect project.
  • In Project B's "Project Properties->Zip Creation" tab set all the appropriate fields (I'm not familiar with the tool so can't provide specifics).
  • In Project A's "Project Properties->AspectJ Compiler" tab, set the "Input jars (aspects)" field to point to the output jar from Project B (above).
  • Build Project B
  • Build Project A

One point of caution: make sure that in "Project Properties->Java Build Path->Libraries" tab, that none of your libraries are using variables. It appears that the 1.1.4 + 1.2 versions have problems converting the variables to their absolute paths.


Bruce Maxfield

Posts: 1
Nickname: maxfield
Registered: Nov, 2005

Re: Tip: Using AspectJ with WSAD 5.1 Posted: Nov 19, 2005 1:57 PM
Reply to this message Reply
I read the same WSAD 5.1 help documentation and was just as annoyed to find the missing 'Advanced' button. As it turns out, this button is by default disabled. This is not a WSADism, but instead an Eclipse feature.

The feature was added in Eclipse 2.1.

To enable the Source Folder Advanced button to allow linking to folder in file system you must check the 'Enable Linked Resources' setting in 'Windows->Preferences->Workbench->Linked Resources'.

I don't believe this is covered in WSAD help, I found it in the eclipse 2.1 help system.

Flat View: This topic has 1 reply on 1 page
Topic: OsXml - An XML Format for Publishing Open-Source Code Previous Topic   Next Topic Topic: A Faster Growable Array ( Indexable Stack ) for C++


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us