{"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":5,"created_at":"2015-04-04T10:24:24Z","updated_at":"2015-12-05T22:49:02Z","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/162254738","html_url":"https://github.com/sarhanm/gradle-versioner/issues/9#issuecomment-162254738","issue_url":"https://api.github.com/repos/sarhanm/gradle-versioner/issues/9","id":162254738,"user":{"login":"Alex-Vol-SV","id":15095009,"avatar_url":"https://avatars.githubusercontent.com/u/15095009?v=3","gravatar_id":"","url":"https://api.github.com/users/Alex-Vol-SV","html_url":"https://github.com/Alex-Vol-SV","followers_url":"https://api.github.com/users/Alex-Vol-SV/followers","following_url":"https://api.github.com/users/Alex-Vol-SV/following{/other_user}","gists_url":"https://api.github.com/users/Alex-Vol-SV/gists{/gist_id}","starred_url":"https://api.github.com/users/Alex-Vol-SV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alex-Vol-SV/subscriptions","organizations_url":"https://api.github.com/users/Alex-Vol-SV/orgs","repos_url":"https://api.github.com/users/Alex-Vol-SV/repos","events_url":"https://api.github.com/users/Alex-Vol-SV/events{/privacy}","received_events_url":"https://api.github.com/users/Alex-Vol-SV/received_events","type":"User","site_admin":false},"created_at":"2015-12-05T22:49:02Z","updated_at":"2015-12-05T22:49:02Z","body":"I have reached the same conclusion regarding versions on branches. I make the solidBranchREgex = .* for my builds so regardless of branch the version is always defined in a consistent manner.\n\nThank you for a great plugin by the way!\n\nFrom: sarhanm <notifications@github.com<mailto:notifications@github.com>>\nReply-To: sarhanm/gradle-versioner <reply@reply.github.com<mailto:reply@reply.github.com>>\nDate: Saturday, December 5, 2015 at 5:42 PM\nTo: sarhanm/gradle-versioner <gradle-versioner@noreply.github.com<mailto:gradle-versioner@noreply.github.com>>\nCc: Alexander Volanis <alexander.volanis@simplivity.com<mailto:alexander.volanis@simplivity.com>>\nSubject: Re: [gradle-versioner] Not placing the code execution in afterEvaluate is causing early evaluation of gradle (#9)\n\n\nI'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.\n\n—\nReply to this email directly or view it on GitHub<https://github.com/sarhanm/gradle-versioner/issues/9#issuecomment-162254415>.\n---------------------------------------------------------------------------------------\nPRIVACY STATEMENT:\nThis message is a PRIVATE communication.  This message and all attachments are a private communication sent by SimpliVity and are considered to be confidential or protected by privilege. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of the information contained in or attached to this message is strictly prohibited.  Please notify the sender of the delivery error by replying to this message, and then delete it from your system.\n---------------------------------------------------------------------------------------\n"}}