{"action":"created","issue":{"url":"https://api.github.com/repos/jaredsburrows/gradle-spoon-plugin/issues/5","repository_url":"https://api.github.com/repos/jaredsburrows/gradle-spoon-plugin","labels_url":"https://api.github.com/repos/jaredsburrows/gradle-spoon-plugin/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/jaredsburrows/gradle-spoon-plugin/issues/5/comments","events_url":"https://api.github.com/repos/jaredsburrows/gradle-spoon-plugin/issues/5/events","html_url":"https://github.com/jaredsburrows/gradle-spoon-plugin/pull/5","id":276646866,"number":5,"title":"Fixing the issue with the output dir and build variants","user":{"login":"tinsukE","id":1063155,"avatar_url":"https://avatars1.githubusercontent.com/u/1063155?v=4","gravatar_id":"","url":"https://api.github.com/users/tinsukE","html_url":"https://github.com/tinsukE","followers_url":"https://api.github.com/users/tinsukE/followers","following_url":"https://api.github.com/users/tinsukE/following{/other_user}","gists_url":"https://api.github.com/users/tinsukE/gists{/gist_id}","starred_url":"https://api.github.com/users/tinsukE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinsukE/subscriptions","organizations_url":"https://api.github.com/users/tinsukE/orgs","repos_url":"https://api.github.com/users/tinsukE/repos","events_url":"https://api.github.com/users/tinsukE/events{/privacy}","received_events_url":"https://api.github.com/users/tinsukE/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-11-24T15:28:09Z","updated_at":"2017-12-13T23:04:18Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/jaredsburrows/gradle-spoon-plugin/pulls/5","html_url":"https://github.com/jaredsburrows/gradle-spoon-plugin/pull/5","diff_url":"https://github.com/jaredsburrows/gradle-spoon-plugin/pull/5.diff","patch_url":"https://github.com/jaredsburrows/gradle-spoon-plugin/pull/5.patch"},"body":"I figured out what was causing the issue https://github.com/jaredsburrows/gradle-spoon-plugin/issues/4.\r\n\r\nIn SpoonPlugin.kt, while looping throughout the variants and assigning the `extension.output` property, the value calculated for the first variant (`$buildDir/spoon-output/variantA`) would be used as a base for the value for the next variants (resulting in `$buildDir/spoon-output/variantA/variantB`), and since there is only one Extension instance for the whole build, this would be in the end the concatenation for all the possible variants.\r\n\r\nMoving the logic of calculating the `extension.output` to the `task.doFirst` block mitigated the problem, since the calculation would only take place before executing Spoon for a specific variant.\r\n\r\nBut if you would run something like `./gradlew spoonVariantA spoonVariantB`, `extension.output` would be a concatenation again when running spoon for the second variant.\r\n\r\nAdding a `finalOutput` field to the extension, that houses the calculated output path (the user-configured one is kept unchanged at `output`) completes the fix.\r\n\r\nUnfortunately, I'm not experienced with Groovy and couldn't even get the project tests to run, so please advice me on how to cover this scenario with tests if you'd require them. "},"comment":{"url":"https://api.github.com/repos/jaredsburrows/gradle-spoon-plugin/issues/comments/351553758","html_url":"https://github.com/jaredsburrows/gradle-spoon-plugin/pull/5#issuecomment-351553758","issue_url":"https://api.github.com/repos/jaredsburrows/gradle-spoon-plugin/issues/5","id":351553758,"user":{"login":"jaredsburrows","id":1739848,"avatar_url":"https://avatars0.githubusercontent.com/u/1739848?v=4","gravatar_id":"","url":"https://api.github.com/users/jaredsburrows","html_url":"https://github.com/jaredsburrows","followers_url":"https://api.github.com/users/jaredsburrows/followers","following_url":"https://api.github.com/users/jaredsburrows/following{/other_user}","gists_url":"https://api.github.com/users/jaredsburrows/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredsburrows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredsburrows/subscriptions","organizations_url":"https://api.github.com/users/jaredsburrows/orgs","repos_url":"https://api.github.com/users/jaredsburrows/repos","events_url":"https://api.github.com/users/jaredsburrows/events{/privacy}","received_events_url":"https://api.github.com/users/jaredsburrows/received_events","type":"User","site_admin":false},"created_at":"2017-12-13T23:04:18Z","updated_at":"2017-12-13T23:04:18Z","author_association":"OWNER","body":"@alexilyenko Sorry about the delay. I have been very busy this week. Basically for each variant, it was appending to the out put directory. I was able to reproduce this in a test and working on a solution now. "}}
{"actor":{"display_login":"jaredsburrows"}}