Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Slimmed down jar for just command line weaving?

I have started writing this. I was stepping through ajc weaving and had the “what’s happening – how did I miss the weaving step” question. Then I set a break point on the point where weaving happens and saw there was an aspect advising after compilation, kick off weaving. Definitely a case where if you don’t know there’s advice (and I didn’t see it in Eclipse), it can be surprising. But it is good to see the core tools are using aspects themselves!

 

I have a simple version working that creates a weaver & world and basically does these things:

 

                       weaver.addLibraryJarFile(new File(aspectPathLoc));

 

                      unwovenClasses = weaver.addJarFile(inJar, null, false);

                      binarySourceFiles.put(inJar.getPath(), unwovenClasses);

                                  copyResourcesFromJarFile(inJar);

 

                      weaver.prepareForWeave();

 

          private class WeavingClassFileProvider implements IClassFileProvider {

                    public IWeaveRequestor getRequestor() {

                                return new IWeaveRequestor() {

 

                                           public void acceptResult(UnwovenClassFile result) {

                                                       try {

                                                                   writeZipEntry(result.getClassName(), result.getBytes());

 

By the way, I saw you had put this idea forward about a year ago in the bugzilla report about aspectjweaver.jar Wes. ;-)

 


From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Wes Isberg
Sent: Friday, October 07, 2005 5:49 PM
To: aspectj-users@xxxxxxxxxxx
Subject: Re: [aspectj-users] Slimmed down jar for just command line weaving?

 

 

You should be able to avoid jar repackaging. If you use ant to build the module you want, you'll get all that's required for that module.  aspectjweaver.jar is just an alias for the loadtime5 module, so that should work standalone.  To get ajc, you need only build org.aspectj.ajdt.core (4.7MB).  aspectjtools.jar includes other stuff. 

 

We don't have a weaver-only command-line or ant interface.  You could probably just stick a command-line interface on WeavingAdaptor, with basic and logging options, in which case you'd only need to build the weaver module (775K).  We've always considered that, but have had no reason to surface a CLI apart from ajc.  Code for parsing classpaths, etc. should be in util, included by weaver.

 

Wes

 

------------Original Message------------

From: "Ron Bodkin" <rbodkin@xxxxxxxxxxxxxx>

To: aspectj-users@xxxxxxxxxxx

Date: Fri, Oct-7-2005 11:35 AM

Subject: [aspectj-users] Slimmed down jar for just command line weaving?

I am looking for a way to package a smaller sized jar to do binary-only weaving of jars. We want to distribute as small a jar file as possible, and have decided to use a weave on install approach for this project. Clearly most of what we need is in aspectjweaver.jar, but not all. It’s pretty important for our needs to have something more like the 1.5 megabyte aspectjweaver jar rather than the nearly 8 megabyte aspectjtools.jar

 

Has anyone packaged such a thing? Is there a small set of jars from the raw aj-build/jars that could be put together to support this requirement?

 

Ron Bodkin

Chief Technology Officer

New Aspects of Software

w: (415) 824-4690

 

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top