1
我想用javac編譯一組java文件到.class文件,然後使用iajc編譯和編織所有方面。我的ant build.xml看起來像這樣。將.aj文件編織到現有的javac編譯源
的編譯部分:
<target name="compile" depends="init" description="compile the source ">
<!-- Compile the java code from ${src} into ${target} -->
<javac srcdir="${src}" destdir="${target}" debug="true">
<classpath refid="project.class.path" />
</javac>
</target>
的iajc部分:
<target name="aspects">
<mkdir dir="dist"/>
<iajc source="1.6" target="${asptarget}">
<inpath>
<pathelement location="${target}"/>
</inpath>
<sourceroots>
<fileset dir="${src}">
<include name="**/*.aj"/>
</fileset>
</sourceroots>
<classpath>
<pathelement location="${aspectj.home}/lib/aspectjrt.jar"/>
</classpath>
</iajc>
</target>
由錯誤信息來看,我沒有得到這個正確的。源根錯誤! 如何使用aspectj編譯.aj文件,然後編譯類文件和編譯的.aj文件?有可能沒有重新編譯所有原始的Java源代碼?
你能幫助我,這個問題嗎?http://stackoverflow.com/questions/38930247/when-run-ant-script-aspectj-not-import-aspect-source-folder-out-side-java-class – uma