hugo
hugo copied to clipboard
-
I am getting the same issue. It will be nice to have support for AAR dependencies
I don't think it would, because Hugo is disabled for release builds. Library projects are built in release mode by default unless you explicitly set them not to.
That said, I set up my library project to produce debug builds, and Hugo still isn't working for me. I even forked Hugo locally and removed the bit of the code in the plugin to disable Hugo in non-debug builds, but it still didn't work.
@sperzion remove "debugCompile 'com.jakewharton.hugo:hugo-runtime:1.2.2XXX" in hugo-plugin/src/main/groovy/hugo/weaving/plugin/HugoPlugin.groovy publish the plugin into your local maven repo.
and added releaseCompile 'com.jakewharton.hugo:hugo-runtime:1.2.2.X-XXX' in your library build.gradle
@fangzhzh Unfortunately, I was unable to get that to work. I added "compile 'com.jakewharton.hugo:hugo-runtime:1.2.2-SNAPSHOT' to my library project instead of releaseCompile, just to avoid any confusion. Still no output from the library. One thing to note is that it also no longer works for the normal app module.
One additional thing I did was also remove the block of code in the variants.all closure that skips the javaCompile stuff. By all accounts, this should work, but for whatever reason, it just doesn't.
I imagine that's what motivated others to seek other solutions (i.e. https://github.com/promeG/XLog).
@sperzion https://github.com/fangzhzh/hugo/commit/4577489f3bd1cc724826020d8c326a90f95e137c check this commit, I managed to enable hugo library to debug and internal, and disable it to release.
One thing don't forget is that after every local library publish, you need to clear local library cache for you application or library which uses hugo library.
cd $HOME/.gralde && find . -name "\*hugo\*" -exec rm {}\;
Thanks for your help, @fangzhzh . I finally managed to find out what was going wrong. It actually had nothing to do with the edits on the Hugo side, but rather the fact that I was using an older version of retrolambda in the library project that was also using Hugo. Updating to the latest version of retrolambda (3.2.4 is what I ended up on) fixed the issue. I'm seeing output from my library project now.
Without any changes to hugo, you can force gradle to build debug version of app with debug version of a library project/AAR with following changes to the app's and the library's build.gradle
app/build.gradle
dependencies { releaseCompile project(path: ':library_module', configuration: 'release') debugCompile project(path: ':library_module', configuration: 'debug') }
library/build.gradle
android { compileSdkVersion 23 //... publishNonDefault true }