{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/cli/issues/244","repository_url":"https://api.github.com/repos/dotnet/cli","labels_url":"https://api.github.com/repos/dotnet/cli/issues/244/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/cli/issues/244/comments","events_url":"https://api.github.com/repos/dotnet/cli/issues/244/events","html_url":"https://github.com/dotnet/cli/issues/244","id":117668860,"number":244,"title":"Generalize project.json \"scripts\"","user":{"login":"anurse","id":7574,"avatar_url":"https://avatars.githubusercontent.com/u/7574?v=3","gravatar_id":"","url":"https://api.github.com/users/anurse","html_url":"https://github.com/anurse","followers_url":"https://api.github.com/users/anurse/followers","following_url":"https://api.github.com/users/anurse/following{/other_user}","gists_url":"https://api.github.com/users/anurse/gists{/gist_id}","starred_url":"https://api.github.com/users/anurse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anurse/subscriptions","organizations_url":"https://api.github.com/users/anurse/orgs","repos_url":"https://api.github.com/users/anurse/repos","events_url":"https://api.github.com/users/anurse/events{/privacy}","received_events_url":"https://api.github.com/users/anurse/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/cli/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/dotnet/cli/labels/msbuild-notapplicable","name":"msbuild-notapplicable","color":"4DA864"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/dotnet/cli/milestones/7","html_url":"https://github.com/dotnet/cli/milestones/Backlog","labels_url":"https://api.github.com/repos/dotnet/cli/milestones/7/labels","id":1426021,"number":7,"title":"Backlog","description":null,"creator":{"login":"piotrpMSFT","id":2379589,"avatar_url":"https://avatars.githubusercontent.com/u/2379589?v=3","gravatar_id":"","url":"https://api.github.com/users/piotrpMSFT","html_url":"https://github.com/piotrpMSFT","followers_url":"https://api.github.com/users/piotrpMSFT/followers","following_url":"https://api.github.com/users/piotrpMSFT/following{/other_user}","gists_url":"https://api.github.com/users/piotrpMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrpMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrpMSFT/subscriptions","organizations_url":"https://api.github.com/users/piotrpMSFT/orgs","repos_url":"https://api.github.com/users/piotrpMSFT/repos","events_url":"https://api.github.com/users/piotrpMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/piotrpMSFT/received_events","type":"User","site_admin":false},"open_issues":155,"closed_issues":181,"state":"open","created_at":"2015-11-23T20:29:29Z","updated_at":"2016-07-27T17:30:50Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2015-11-18T20:00:40Z","updated_at":"2016-07-27T17:30:50Z","closed_at":"2016-07-27T17:30:50Z","body":"Rather than specific lifecycle events, we could have a more general model where **every** `dotnet-[command]` command (**where a project context is available**) runs the following sequence of events:\r\n\r\n1. `pre[command]` script in the `project.json`\r\n2. `[command]` implementation\r\n3. `post[command]` script in the `project.json`\r\n\r\nOpen questions:\r\n\r\n1. Should the driver do this or the individual commands? If the driver, that means the driver has to be aware of project context. It also wouldn't know which commands are intended to be used in a project context so some weird things could happen, for example running `dotnet init` in a folder with a `project.json` might run a `preinit` script in that project, if one existed. My feeling is that the commands should do it (via a simple wrapper)\r\n\r\n2. Do all the events share the same invocation model? For example, currently the `pre/postcompile` events run once **per compilation** not **per invocation**, which means they run for each framework that is built in a cross-compilation model. They also provide different variable expansions for different contexts. How important is it to try to preserve this in a general model?\r\n\r\n3. Should we restructure the project.json syntax? Maybe something like this:\r\n\r\n```json\r\n{\r\n    \"events\": {\r\n        \"compile\": {\r\n            \"before\": [ \"echo some script\" ],\r\n            \"after\": [ \"echo some script\" ]\r\n        }\r\n    }\r\n}\r\n```\r\n\r\n/cc @piotrpMSFT @davidfowl"},"comment":{"url":"https://api.github.com/repos/dotnet/cli/issues/comments/235659506","html_url":"https://github.com/dotnet/cli/issues/244#issuecomment-235659506","issue_url":"https://api.github.com/repos/dotnet/cli/issues/244","id":235659506,"user":{"login":"piotrpMSFT","id":2379589,"avatar_url":"https://avatars.githubusercontent.com/u/2379589?v=3","gravatar_id":"","url":"https://api.github.com/users/piotrpMSFT","html_url":"https://github.com/piotrpMSFT","followers_url":"https://api.github.com/users/piotrpMSFT/followers","following_url":"https://api.github.com/users/piotrpMSFT/following{/other_user}","gists_url":"https://api.github.com/users/piotrpMSFT/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrpMSFT/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrpMSFT/subscriptions","organizations_url":"https://api.github.com/users/piotrpMSFT/orgs","repos_url":"https://api.github.com/users/piotrpMSFT/repos","events_url":"https://api.github.com/users/piotrpMSFT/events{/privacy}","received_events_url":"https://api.github.com/users/piotrpMSFT/received_events","type":"User","site_admin":false},"created_at":"2016-07-27T17:30:50Z","updated_at":"2016-07-27T17:30:50Z","body":"The team is actively working on enabling [MSBuild](https://blogs.msdn.microsoft.com/dotnet/2016/05/23/changes-to-project-json/) and the component affected will be superseded by the new project system, so I am closing this issue."}}
{"actor":{"display_login":"piotrpMSFT"}}