Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Can non-weaved classes be removed from generated jar after ctw

Hi  Simone,

Thanks for the quick response, Simone. If I understand right, you are
saying that the generated jar would only contain classes which have
some advices.

I compiled with showWeaveInfo. I am not sure I can post the entire
output because it is proprietary code, but my observations are:

1. showWeaveInfo lists methods of on 35 odd classes that I intend to
put advices on, out of 10s of thousands total

2. I have already tested what I asked, and as you would guess it
works. My condition for removing classes from the generated jar is
that the .class file  don't contain the string "aspectj".  That does
leave me with those 35 odd classes.

I wonder if it has something to do with the way I invoke iajc? My xml
is as follows, slightly fudged.

    <aspectj:iajc showWeaveInfo="true" Xlint="ignore" source="1.5"
outjar="${build.dir}/${aspects.jar.name}" outxml="true">
      <sourceroots>
        <pathelement location="src/aj" />
      </sourceroots>
      <inpath>
        <fileset dir="${target}/lib">
          <include name="ext/ds.jar"/>
          <include name="ext/rt.jar"/>
          <include name="server.jar"/>
        </fileset>
        <pathelement location="${target}/deploy/codegen/classes"/>
      </inpath>
      <classpath>
        <fileset dir="${target}/lib">
          <exclude name="ext/ds.jar"/>
          <exclude name="ext/server-15.jar"/>
          <exclude name="ext/aspects.jar"/>
          <exclude name="server.jar"/>
          <exclude name="**/*aspect*jar"/>
          <include name="**/*.jar"/>
        </fileset>
        <fileset dir="../../depends">
          <include name="${aspectj.dir}/aspectjrt.jar"/>
          <include name="${commons.lang.dir}/commons-lang-*.jar"/>
        </fileset>
      </classpath>
    </aspectj:iajc>

On Thu, Jan 21, 2010 at 3:48 PM, Simone Gianni <simoneg@xxxxxxxxxx> wrote:
> Hi Hemal,
> could it be that your aspects are in reality matching much more classes than
> you expect them to?
> So, non weaved classes are in reality partially weaved?
>
> You could activate the debug output of the weaver to see what it's doing and
> eventually post here the pointcut expression that is causing unwanted
> weaving and see if there is a way to write it so that it targets only the
> right classes.
>
> Simone
>
> Hemal Pandya wrote:
>>
>> Hello everyone,
>>
>> After my trouble with load time weaving I have shifted to compile team
>> weaving and got it work after some trouble. This creates a huge jar,
>> while I have actually put advices in a few classes.
>>
>> I am wondering if it would be ok to strip the non-weaved classes after
>> ctw and put that jar in the front of classpath. That would make it
>> easier for me to supply small files that can be deployed to get
>> AspectJ runs.
>>
>> Or maybe there is already an iajc parameter that creates a jar only of
>> the weaved classes?
>>
>> Appreciate any comments. Thanks in advance,
>>
>> - hemal
>> _______________________________________________
>> aspectj-users mailing list
>> aspectj-users@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>>
>
>
> --
> Simone Gianni            CEO Semeru s.r.l.           Apache Committer
> http://www.simonegianni.it/
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top