JakeWharton / hugo

Annotation-triggered method call logging for your debug builds.
Apache License 2.0
7.92k stars 797 forks source link

setEnabled() not available in latest jar. #130

Open koalahamlet opened 8 years ago

koalahamlet commented 8 years ago

This is technically a dupe of #127 but I'll avoid the nondescript title and inflammatory exclamation points. I've pulled the latest hugo plugin, and wanted to access that handy little public static method setEnabled(). Unfortunately it doesn't seem to be in the decompiled class. Would be nice to have out in the wild :bear:

kaneoriley commented 8 years ago

The last release (1.2.1) was in February last year, whereas that commit (https://github.com/JakeWharton/hugo/commit/00a0d4f580f8c82b943c627b1f67de069f0f8897) was done in August. I'm sure Jake will release a new version when he feels the need, otherwise just fork it or use JitPack for now.

IgorGanapolsky commented 8 years ago

I am not able to call hugo { enabled false } in build.gradle. I get an error:

DSL method not found: 'hugo()'

kaneoriley commented 8 years ago

Please read my previous comment, you'll need to either build Hugo yourself or use Jitpack until a new release is published.

tzutalin commented 8 years ago

How can we use gradlew to build by ourselves?

kaneoriley commented 8 years ago

If you can't figure out how to build it yourself, use https://jitpack.io/#JakeWharton/hugo/50ee96dc07

tzutalin commented 8 years ago

@lennykano Thanks. I will use https://jitpack.io/#JakeWharton/hugo/50ee96dc07 directly

ClemMahe commented 7 years ago

Hello, Thanks lennykano for this alternative solution. Looking forward for a new version though :)

damianflannery commented 7 years ago

I've found that Hugo messes with the debugger in AS so setEnabled would be extremely useful. Also looking forward to a new version.

756718646 commented 7 years ago

I have the same problem,Did you solve it??? Hugo.setenabled is not find and DSL method not found: 'hugo()'

756718646 commented 7 years ago

@koalahamlet

mtotschnig commented 7 years ago

@lennykano Could you help me following up on your advise to use the Jitpack version?

The following

buildscript {
    repositories {
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }

    dependencies {
        classpath 'com.github.JakeWharton.hugo:hugo-plugin:50ee96dc07'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.hugo'

results in

Error:Failed to resolve: com.jakewharton.hugo:hugo-annotations:1.2.2-SNAPSHOT
Error:Failed to resolve: com.jakewharton.hugo:hugo-runtime:1.2.2-SNAPSHOT
kaneoriley commented 7 years ago

@mtotschnig either you haven't added jitpack to your allprojects repositories, or 1.2.2-SNAPSHOT isn't a valid version. Probably both.

liaolintao commented 4 years ago

@lennykano I was misled by you. This library is only effective in the debug version. Why do you design a temporary enable, if you want to disable, you can assemble a release or other build version.

master version : https://github.com/JakeWharton/hugo/blob/master/hugo-plugin/src/main/groovy/hugo/weaving/plugin/HugoPlugin.groovy

1.2.1 : hugo-1.2.1\hugo-plugin\src\main\groovy\hugo\weaving\plugin\HugoPlugin.groovy

    project.dependencies {
      debugCompile 'com.jakewharton.hugo:hugo-runtime:1.2.1'
      // TODO this should come transitively
      debugCompile 'org.aspectj:aspectjrt:1.8.5'
      compile 'com.jakewharton.hugo:hugo-annotations:1.2.1'
    }

    variants.all { variant ->
      if (!variant.buildType.isDebuggable()) {
        log.debug("Skipping non-debuggable build type '${variant.buildType.name}'.")
        return;
      }