{"action":"created","issue":{"url":"https://api.github.com/repos/gradle/gradle/issues/5817","repository_url":"https://api.github.com/repos/gradle/gradle","labels_url":"https://api.github.com/repos/gradle/gradle/issues/5817/labels{/name}","comments_url":"https://api.github.com/repos/gradle/gradle/issues/5817/comments","events_url":"https://api.github.com/repos/gradle/gradle/issues/5817/events","html_url":"https://github.com/gradle/gradle/issues/5817","id":336828524,"node_id":"MDU6SXNzdWUzMzY4Mjg1MjQ=","number":5817,"title":"Plugins defined in plugins {} block are not run in the specified order","user":{"login":"sonicsnes","id":517502,"node_id":"MDQ6VXNlcjUxNzUwMg==","avatar_url":"https://avatars2.githubusercontent.com/u/517502?v=4","gravatar_id":"","url":"https://api.github.com/users/sonicsnes","html_url":"https://github.com/sonicsnes","followers_url":"https://api.github.com/users/sonicsnes/followers","following_url":"https://api.github.com/users/sonicsnes/following{/other_user}","gists_url":"https://api.github.com/users/sonicsnes/gists{/gist_id}","starred_url":"https://api.github.com/users/sonicsnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonicsnes/subscriptions","organizations_url":"https://api.github.com/users/sonicsnes/orgs","repos_url":"https://api.github.com/users/sonicsnes/repos","events_url":"https://api.github.com/users/sonicsnes/events{/privacy}","received_events_url":"https://api.github.com/users/sonicsnes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-06-29T01:02:11Z","updated_at":"2018-07-11T09:10:14Z","closed_at":null,"author_association":"NONE","body":"<!--- \r\nPlease follow the instructions below. We receive dozens of issues every week, so to stay productive, we will close issues that don't provide enough information. \r\n\r\nPlease open Android-related issues on the Android Issue Tracker at https://source.android.com/source/report-bugs\r\nPlease open Kotlin DSL-related issues at https://github.com/gradle/kotlin-dsl/issues\r\nPlease open Gradle Native-related issues at https://github.com/gradle/gradle-native/issues\r\n-->\r\n\r\n<!--- Provide a brief summary of the issue in the title above -->\r\nWhen defining plugins in a plugins {} block, they are not always applied in the order that was given.\r\n\r\n### Expected Behavior\r\n<!--- If you're describing a bug, tell us what should happen -->\r\n<!--- If you're suggesting a change/improvement, tell us how it should work -->\r\n```\r\nplugins {\r\n  id 'java'\r\n  id 'com.google.protobuf' version '0.8.6'\r\n  id 'com.example' version '1.0'\r\n}\r\n```\r\nThis buildfile should result in the application of java, followed by com.google.protobuf.\r\n\r\n### Current Behavior\r\n<!--- If describing a bug, tell us what happens instead of the expected behavior -->\r\n<!--- If suggesting a change/improvement, explain the difference from current behavior -->\r\ncom.google.protobuf and com.example are applied first.\r\n\r\n### Context\r\n<!--- How has this issue affected you? What are you trying to accomplish? -->\r\n<!--- Providing context helps us come up with a solution that is most useful in the real world -->\r\nSince the `java` plugin is always executed after `com.google.protobuf` when specified in a plugins{} block, this means that `com.google.protobuf` always goes into its \"wait for java before applying myself\" mode. In the example above, this means the `com.example` plugin cannot configure the protobuf plugin when it is applied. Configuring protobuf in afterEvaluate is also not an option, as this is too late and the protobuf plugin has already processed several of its extension properties.\r\n\r\nI know this could be resolved with changes to the plugins, but it still seems like a bug that the java plugin is always saved for last when specified in this way.\r\n\r\n### Steps to Reproduce (for bugs)\r\n<!--- Provide a self-contained example project (as an attached archive or a Github project). -->\r\n<!--- In the rare cases where this is infeasible, we will also accept a detailed set of instructions. -->\r\n* Check out https://github.com/sonicsnes/gradle-5817\r\n* `gradle publishToMavenLocal` in example-plugin\r\n* Notice that `gradle jar` in example-app-working passes\r\n* Notice that `gradle jar` in example-app-broken fails (if you run with -i, you'll see that the java plugin was not applied at the time of the exception)\r\n* Both should work.\r\n\r\n### Your Environment\r\n<!--- Include as many relevant details about the environment you experienced the bug in -->\r\n<!--- A build scan `https://scans.gradle.com/get-started` is ideal -->\r\n4.8.1"},"comment":{"url":"https://api.github.com/repos/gradle/gradle/issues/comments/404100189","html_url":"https://github.com/gradle/gradle/issues/5817#issuecomment-404100189","issue_url":"https://api.github.com/repos/gradle/gradle/issues/5817","id":404100189,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDEwMDE4OQ==","user":{"login":"lacasseio","id":22181740,"node_id":"MDQ6VXNlcjIyMTgxNzQw","avatar_url":"https://avatars2.githubusercontent.com/u/22181740?v=4","gravatar_id":"","url":"https://api.github.com/users/lacasseio","html_url":"https://github.com/lacasseio","followers_url":"https://api.github.com/users/lacasseio/followers","following_url":"https://api.github.com/users/lacasseio/following{/other_user}","gists_url":"https://api.github.com/users/lacasseio/gists{/gist_id}","starred_url":"https://api.github.com/users/lacasseio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lacasseio/subscriptions","organizations_url":"https://api.github.com/users/lacasseio/orgs","repos_url":"https://api.github.com/users/lacasseio/repos","events_url":"https://api.github.com/users/lacasseio/events{/privacy}","received_events_url":"https://api.github.com/users/lacasseio/received_events","type":"User","site_admin":false},"created_at":"2018-07-11T09:10:14Z","updated_at":"2018-07-11T09:10:14Z","author_association":"MEMBER","body":"We discussed it a little bit and it makes sense for the `plugins` block to be predictable and intuitive, even if we don’t want users to rely on that order. It also helps to work around some plugin bug. It shouldn't be hard to fix. @sonicsnes do you want to give it a shot? "}}
{"actor":{"display_login":"lacasseio"}}