{"action":"created","issue":{"url":"https://api.github.com/repos/sarhanm/gradle-versioner/issues/9","labels_url":"https://api.github.com/repos/sarhanm/gradle-versioner/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/sarhanm/gradle-versioner/issues/9/comments","events_url":"https://api.github.com/repos/sarhanm/gradle-versioner/issues/9/events","html_url":"https://github.com/sarhanm/gradle-versioner/issues/9","id":66303338,"number":9,"title":"Not placing the code execution in afterEvaluate is causing early evaluation of gradle","user":{"login":"sarhanm","id":2353508,"avatar_url":"https://avatars.githubusercontent.com/u/2353508?v=3","gravatar_id":"","url":"https://api.github.com/users/sarhanm","html_url":"https://github.com/sarhanm","followers_url":"https://api.github.com/users/sarhanm/followers","following_url":"https://api.github.com/users/sarhanm/following{/other_user}","gists_url":"https://api.github.com/users/sarhanm/gists{/gist_id}","starred_url":"https://api.github.com/users/sarhanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarhanm/subscriptions","organizations_url":"https://api.github.com/users/sarhanm/orgs","repos_url":"https://api.github.com/users/sarhanm/repos","events_url":"https://api.github.com/users/sarhanm/events{/privacy}","received_events_url":"https://api.github.com/users/sarhanm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-04-04T10:24:24Z","updated_at":"2015-12-05T22:42:00Z","closed_at":"2015-04-04T12:12:50Z","body":"Because we are trying too hard to make sure the versioner plugin executes as early as possible, we are accidently forcing gradle to evaluate the project well before its done initializing the build script. For example, we are retrieving the value from the properties container, which is putting the gradle project into a \"configured\" state which then prevents the project from adding pieces to the publishing plugin (amongst other things).\r\n\r\nSolution: Move the execution into the afterEvaluate event. Worst case scenario, you'll have to grab the version of the project again during certain executions."},"comment":{"url":"https://api.github.com/repos/sarhanm/gradle-versioner/issues/comments/162254415","html_url":"https://github.com/sarhanm/gradle-versioner/issues/9#issuecomment-162254415","issue_url":"https://api.github.com/repos/sarhanm/gradle-versioner/issues/9","id":162254415,"user":{"login":"sarhanm","id":2353508,"avatar_url":"https://avatars.githubusercontent.com/u/2353508?v=3","gravatar_id":"","url":"https://api.github.com/users/sarhanm","html_url":"https://github.com/sarhanm","followers_url":"https://api.github.com/users/sarhanm/followers","following_url":"https://api.github.com/users/sarhanm/following{/other_user}","gists_url":"https://api.github.com/users/sarhanm/gists{/gist_id}","starred_url":"https://api.github.com/users/sarhanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarhanm/subscriptions","organizations_url":"https://api.github.com/users/sarhanm/orgs","repos_url":"https://api.github.com/users/sarhanm/repos","events_url":"https://api.github.com/users/sarhanm/events{/privacy}","received_events_url":"https://api.github.com/users/sarhanm/received_events","type":"User","site_admin":false},"created_at":"2015-12-05T22:42:00Z","updated_at":"2015-12-05T22:42:00Z","body":"I'm not sure if that works because we are at the whim of other plugins who might pull in the version string. The current usage of this plugin at Zillow is using the GitData in the build logic of build.gradle and therefore needing the actual version metadata early enough continues to be a forcing function. In the various projects we have so far, i have yet to use the VersionerOptions extensibly. We like our versions to always be fully defined regardless of branch (makes hotfixing easier) and think thats a better practice then clean version numbers. The only exception here is for android, ios and gradle plugin builds that enforce a version scheme for uploads to their stores/repos. Adding the VersionerOptions extensions manually is a small inconvenience that we are willing to live with.\r\n"}}