{"action":"created","issue":{"url":"https://api.github.com/repos/PowerShell/Plaster/issues/145","repository_url":"https://api.github.com/repos/PowerShell/Plaster","labels_url":"https://api.github.com/repos/PowerShell/Plaster/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/PowerShell/Plaster/issues/145/comments","events_url":"https://api.github.com/repos/PowerShell/Plaster/issues/145/events","html_url":"https://github.com/PowerShell/Plaster/issues/145","id":181458705,"number":145,"title":"psake build script review","user":{"login":"rkeithhill","id":5177512,"avatar_url":"https://avatars.githubusercontent.com/u/5177512?v=3","gravatar_id":"","url":"https://api.github.com/users/rkeithhill","html_url":"https://github.com/rkeithhill","followers_url":"https://api.github.com/users/rkeithhill/followers","following_url":"https://api.github.com/users/rkeithhill/following{/other_user}","gists_url":"https://api.github.com/users/rkeithhill/gists{/gist_id}","starred_url":"https://api.github.com/users/rkeithhill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkeithhill/subscriptions","organizations_url":"https://api.github.com/users/rkeithhill/orgs","repos_url":"https://api.github.com/users/rkeithhill/repos","events_url":"https://api.github.com/users/rkeithhill/events{/privacy}","received_events_url":"https://api.github.com/users/rkeithhill/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/PowerShell/Plaster/labels/discussion","name":"discussion","color":"1d76db"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-10-06T16:07:56Z","updated_at":"2016-10-09T20:51:58Z","closed_at":null,"body":"TL;DR - skim through and look at the **bolded questions/issues**.  FYI, I'm in the midst of making changes to build.psake.ps1 so please hold off on making changes to this file.\r\n\r\nCurrently our build script has the following tasks:\r\n```\r\nTask PreBuild {\r\nTask PostBuild {\r\nTask PreBuildHelp {\r\nTask PostBuildHelp {\r\nTask PreInstall {\r\nTask PostInstall {\r\nTask PrePublish {\r\nTask PostPublish {\r\nTask default -depends Build\r\nTask Init -requiredVariables PublishDir {\r\nTask Clean -requiredVariables PublishRootDir {\r\nTask Sign -depends PostCopySource -requiredVariables SettingsPath, SignScripts {\r\nTask Build -depends BuildImpl, Sign, PostBuild {\r\nTask BuildImpl -depends Init, Clean, PreBuild -requiredVariables SourceRootDir, PublishDir {\r\nTask GenerateMarkdown -depends Build, PreBuildHelp -requiredVariables DefaultLocale, DocsRootDir, ModuleName, PublishDir {\r\nTask BuildHelp -depends BuildHelpImpl, PostBuildHelp {\r\nTask BuildHelpImpl -depends GenerateMarkdown -requiredVariables DocsRootDir, PublishDir {\r\nTask Install -depends InstallImpl, PostInstall {\r\nTask InstallImpl -depends BuildHelp, PreInstall -requiredVariables InstallPath, PublishDir {\r\nTask Test -depends Build {\r\nTask Publish -depends Test, PrePublish, PublishImpl, PostPublish {\r\nTask PublishImpl -requiredVariables SettingsPath, PublishDir {\r\nTask ? -description 'Lists the available tasks' {\r\nTask RemoveApiKey -requiredVariables SettingsPath {\r\nTask StoreApiKey -requiredVariables SettingsPath {\r\nTask ShowApiKey -requiredVariables SettingsPath {\r\nTask ShowFullApiKey -requiredVariables SettingsPath {\r\nTask RemoveCertSubjectName -requiredVariables SettingsPath {\r\nTask StoreCertSubjectName -requiredVariables SettingsPath {\r\nTask ShowCertSubjectName -requiredVariables SettingsPath {\r\n```\r\nThe `default` task is `Build`.  The primary build flow is:\r\n```\r\n Init -> Clean -> PreBuild -> BuildImpl -> Sign -> PostBuild\r\n```\r\nThe two simple user extension points are:\r\n```\r\n# Executes before the BuidImpl phase of the Build task.\r\nTask PreBuild {\r\n}\r\n\r\n# Executes after the Sign phase of the Build task.\r\nTask PostBuild {\r\n}\r\n```\r\nThe BuildHelp flow is:\r\n```\r\n<Build flow> -> PreBuildHelp -> GenerateMarkdown -> BuildHelpImpl -> PostBuildHelp\r\n```\r\nBTW since we usually refer to docs as \"help\" in PowerShell, **shouldn't these be called GenerateHelp or better yet, `GenerateMarkdown` and `BuildHelp`**?  GenerateFoo and BuildFoo sound a bit like they would do the same thing, at least to me.  **Update**: I've temporarily made this change.\r\n\r\nThe install task flow is:\r\n```\r\n<BuildHelp flow> -> PreInstall -> InstallImpl -> PostInstall\r\n```\r\nBTW, **I think we need an option (property) on the Install task to allow it to \"clean\" the destination before copying over the module**.  The default should probably be to not clean the destination first.\r\n\r\nThe test task flow is:\r\n```\r\n<Build flow> -> test\r\n```\r\n\r\nAnd the publish flow is:\r\n```\r\n<Test flow> -> PrePublish -> PublishImpl ->PostPublish\r\n```\r\nThis provides two more empty, task extension points for the user: `Pre/PostPublish`.\r\n```\r\n# Executes before publishing occurs.\r\nTask PrePublish {\r\n}\r\n\r\n# Executes after publishing occurs.\r\nTask PostPublish {\r\n}\r\n```\r\n\r\nHmm, forgot that I had used this \"impl\" pattern before.  I like that and may convert PreCopySource/PostCopySource (never liked those names) to more of PreBuild/PostBuild where these would fit in like so:\r\n```\r\n Init -> Clean -> PreBuild ->BuildImpl -> Sign -> PostBuild\r\n```\r\nIn fact, I might do the same for Install (Pre/PostInstall).  These are simple to add and give the user easy ways to hook into the build flow without having to drop down and modify the common code.   **Update**: I've temporarily made this change.\r\n\r\nOK this has me thinking (given something @daviwil mentioned a few days ago), **we should look into splitting up the build.psake.ps1 file and putting the things the user is going to change in one file and the fixed stuff in another file** (perhaps module-build.psake.ps1).\r\n\r\nFinally, in testing the build script I found some cases where a newly created module wouldn't build without failures.  **When we are creating build steps like the help build for instance, we need to be sure we tolerate conditions like no exported commands**."},"comment":{"url":"https://api.github.com/repos/PowerShell/Plaster/issues/comments/252511892","html_url":"https://github.com/PowerShell/Plaster/issues/145#issuecomment-252511892","issue_url":"https://api.github.com/repos/PowerShell/Plaster/issues/145","id":252511892,"user":{"login":"davegreen","id":759393,"avatar_url":"https://avatars.githubusercontent.com/u/759393?v=3","gravatar_id":"","url":"https://api.github.com/users/davegreen","html_url":"https://github.com/davegreen","followers_url":"https://api.github.com/users/davegreen/followers","following_url":"https://api.github.com/users/davegreen/following{/other_user}","gists_url":"https://api.github.com/users/davegreen/gists{/gist_id}","starred_url":"https://api.github.com/users/davegreen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davegreen/subscriptions","organizations_url":"https://api.github.com/users/davegreen/orgs","repos_url":"https://api.github.com/users/davegreen/repos","events_url":"https://api.github.com/users/davegreen/events{/privacy}","received_events_url":"https://api.github.com/users/davegreen/received_events","type":"User","site_admin":false},"created_at":"2016-10-09T20:51:58Z","updated_at":"2016-10-09T20:51:58Z","body":"RE None vs Skip, That would make more sense with the altered variable names, with None being ReportOnly and Skip becoming None. \r\n\r\nSure, I can do the Analyze task skip if the module isn't installed and the manifest requiremodule directive.\r\n\r\nI'm unsure about how to deal with the differences in PSSA between editor based and running the module. I imagine the goal is to eventually get to parity?"}}
{"actor":{"display_login":"davegreen"}}