Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] jaring aspects to be applied later

I think you need to put your input aspects on the aspectpath rather than on the sourceroots: 


then they will be discovered, you shouldn't need to ship .aj files in source form.

> I also assume i can't package up the .class generated files from the source .aj file, and have that applied to arbitrary projects.

Yes you can, provided the pointcuts are suitable, the compiled aspect is a reusable compiled entity.

cheers,
Andy


On 11 May 2013 10:42, Dave Brosius <dbrosius@xxxxxxxxxxxxxxx> wrote:
Greetings i have some aspects that i want to make available as a jar, to be applied to arbitrary projects in the future.

When i stick the .aj file in a jar, and use it from ant as

    <target name="aspects">
        <aspectj:iajc outJar="${build.dir}/${final.name}_aj.jar" source="1.6" showWeaveInfo="true">
            <sourceRoots>
                <pathelement location="/path/to/jar/myaspects.jar"/>
            </sourceRoots>
            <inpath>
                 <pathelement location="${build.dir}/${final.name}.jar"/>
            </inpath>
            <classpath>
                <pathelement location="aspectjrt.jar"/>
                <path refid="my.classpath"/>
            </classpath>
        </aspectj:iajc>
    </target>


No aspects are found to apply

if the sourceRoots specifies a directory path, it works fine.


How is one supposed to do this? I'd prefer to not have to ship .aj file by themselves.
I also assume i can't package up the .class generated files from the source .aj file, and have that applied to arbitrary projects.

What am i do wrong?

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



Back to the top