Archinamon / android-gradle-aspectj

gradle plug-in adding supports of AspectJ into Android project
Apache License 2.0
364 stars 58 forks source link

Do not hardcode AspectJ version #4

Closed renaudcerrato closed 8 years ago

renaudcerrato commented 8 years ago

I'm not a gradle plugin expert, but It seems your plugin is compiled against AspectJ 1.8.4, and we can't override it? I tried to explicitely define my AspectJ dependency to 1.8.7 without success.

Since I needed AspectJ 1.8.7 (bug fixes), I had to recompile your plugin against 1.8.7 - and the bug were fixed.

Archinamon commented 8 years ago

Hi! Thank's for your report. I'll update plugin to support 1.8.7 version (now it's 1.8.5). And I'll add custom field to override root ajc version, I'm currently refactoring some parts.

renaudcerrato commented 8 years ago

Thanks for the prompt reply! I can't understand why forcing 1.8.7 onto my project dependencies didn't solved it...? The ajc compiler used is statically compiled with the plug-in?

Archinamon commented 8 years ago

Yep, it is. I'll try to update plugin today.

renaudcerrato commented 8 years ago

Can't wait to see how you solved it - I'm on my learning curve writing custom plugin and yours is an excellent starting point.

renaudcerrato commented 8 years ago

FYI, I was able to temporary solve it by adding configurations.classpath.resolutionStrategy.force("org.aspectj:aspectjtools:1.8.7") to my buildScript closure.

Archinamon commented 8 years ago

Good. That's not so easy as I expected :) You can take to try 1.1.0 version. I didn't announced it yet, but have uploaded already. Version of ajc tools is have to be hardcoded, there's no way (or I don't know it) to make it dynamically because of pre-building plugin into jar with ajc tools package for bridge api. I'm now setting up rt version via module extension.

But, you can always download sources as standalone project and compile it with any needed version locally.

renaudcerrato commented 8 years ago

Just tried 1.1.0, but it seems to ignore errors:

:app:compileDebugAspectj
53 errors, 4 warnings
......
BUILD SUCCESSFULL

Amazing plugin anyway - can't understand why there's not an official AspectJ android plugin - yours is the most solid to date.

Archinamon commented 8 years ago

Check your extensions, maybe you turned on ignoreErrors flag. Follow this example: https://github.com/Archinamon/AspectJExampleAndroid

renaudcerrato commented 8 years ago

I didn't defined any extensions, but I then tried with both true and false:

ignoreErrors false gives:

:app:compileDebugAspectj
53 errors, 4 warnings
....
BUILD SUCCESSFULL

and ignoreErrors true gives:

:app:compileDebugAspectj
1 fail|abort, 1 error
.....
(other tasks executing!)
.....
BUILD SUCCESSFUL

It seems the ignoreErrors flag is somewhat ignored, despite the different output. Looking at the ajc_details.log in the later case, we have '[error] unrecognized single argument: "-noImportError"

Archinamon commented 8 years ago

Found problem.