{"comment":{"created_at":"2011-10-24T06:39:36Z","body":"Nice","updated_at":"2011-10-24T06:39:36Z","url":"https://api.github.com/repos/psake/psake/issues/comments/2500242","id":2500242,"user":{"gravatar_id":"c5146b35444bddcc4057d2ec645fb6f0","avatar_url":"https://secure.gravatar.com/avatar/c5146b35444bddcc4057d2ec645fb6f0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/lanwin","id":15905,"login":"lanwin"}},"action":"created","issue":{"number":22,"created_at":"2011-10-08T19:49:20Z","pull_request":{"diff_url":"https://github.com/psake/psake/pull/22.diff","patch_url":"https://github.com/psake/psake/pull/22.patch","html_url":"https://github.com/psake/psake/pull/22"},"body":"Hi,\r\n\r\nI have some new ideas about psake, and I would like hear your comments. \r\n\r\n# DerivedProperties\r\n\r\nFirst commit adds DerivedProperties, that's something similar to Properties, but executed later, so it allows writing build script like this:\r\n\r\nProperties {\r\n  $version_major = \"1.0.0\"\r\n  $version_build = \"0\"\r\n}\r\n\r\nDerivedProperties {\r\n  $version = \"$version_major.$version_build\"\r\n}\r\n\r\nTask default -depends ShowVersion\r\n\r\nTask ShowVersion {\r\n  write-host \"Version: $version\"\r\n}\r\n\r\n# Simplified modules loading\r\n\r\nNext commit is about simplifying psake-config.ps1 when comes to loading modules. Now it can be written as:\r\n\r\nDon't load anything (default):\r\n$config.modules=$null\r\n\r\nLoad modules from .\\modules folder and from file my_module.psm1:\r\n$config.modules=(\".\\modules\\*.psm1\",\".\\my_module.psm1\")\r\n\r\n# Required helper function\r\n\r\nNext commit adds Required helper function, that checks if all variables passed as arguments are set. I use such function in our deploy scripts, to check if all required parameters to execute some task (like 'CreateWebSiteInIIS') are set. Example:\r\n\r\nproperties {\r\n  $webSiteDir = $null\r\n   $webSitePort = $null\r\n}\r\n\r\ntask default -depends CreateWebSiteInIIS\r\n\r\ntask CreateWebSiteInIIS {\r\n  Required webSiteDir, webSitePort\r\n}\r\n\r\n# Marking Include function as deprecated\r\n\r\nWhen I started using psake I used Include function, and I had some problems with it, because I didn't know that files added by Include will be included not at the point of Include call, but after loading whole build script. So because Include behavior is surprising, and what it does can be done just by \". somefile.ps1\", I believe that it should be deprecated.","comments":5,"title":"Some new ideas","updated_at":"2011-10-24T06:39:36Z","url":"https://api.github.com/repos/psake/psake/issues/22","id":1853615,"assignee":null,"milestone":null,"closed_at":"2011-10-23T12:53:37Z","user":{"gravatar_id":"9102291f23ecbe29c7574148301dc5b0","avatar_url":"https://secure.gravatar.com/avatar/9102291f23ecbe29c7574148301dc5b0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/whut","id":774125,"login":"whut"},"html_url":"https://github.com/psake/psake/issues/22","labels":[],"state":"closed"},"legacy":{"issue_id":1853615,"comment_id":2500242}}