{"action":"opened","issue":{"url":"https://api.github.com/repos/KeepSafe/dexcount-gradle-plugin/issues/96","repository_url":"https://api.github.com/repos/KeepSafe/dexcount-gradle-plugin","labels_url":"https://api.github.com/repos/KeepSafe/dexcount-gradle-plugin/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/KeepSafe/dexcount-gradle-plugin/issues/96/comments","events_url":"https://api.github.com/repos/KeepSafe/dexcount-gradle-plugin/issues/96/events","html_url":"https://github.com/KeepSafe/dexcount-gradle-plugin/issues/96","id":154893086,"number":96,"title":"Deduplicate task runs","user":{"login":"benjamin-bader","id":512212,"avatar_url":"https://avatars.githubusercontent.com/u/512212?v=3","gravatar_id":"","url":"https://api.github.com/users/benjamin-bader","html_url":"https://github.com/benjamin-bader","followers_url":"https://api.github.com/users/benjamin-bader/followers","following_url":"https://api.github.com/users/benjamin-bader/following{/other_user}","gists_url":"https://api.github.com/users/benjamin-bader/gists{/gist_id}","starred_url":"https://api.github.com/users/benjamin-bader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjamin-bader/subscriptions","organizations_url":"https://api.github.com/users/benjamin-bader/orgs","repos_url":"https://api.github.com/users/benjamin-bader/repos","events_url":"https://api.github.com/users/benjamin-bader/events{/privacy}","received_events_url":"https://api.github.com/users/benjamin-bader/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-15T06:19:23Z","updated_at":"2016-05-15T06:19:23Z","closed_at":null,"body":"While fixing #84, I noticed that the buggy code ran because the task itself was running twice.  As it turns out, the way we are causing the task to run (`variant.assemble.doLast { ... }`) is a misuse of Gradle's task graph.  It unconditionally executes a closure after `assemble`, rather than activating the task in the normal way.  Thus, if one `./gradlew assemble countDexMethods`, the counting code runs twice.\r\n\r\nThere are two key constraints we want to express - dexcount depends on assemble, and assemble being run should cause dexcount to run.  There is probably a better way to say this in Gradle."}}