-
Notifications
You must be signed in to change notification settings - Fork 510
Modified Examples dir to provide a preview of PSake based module publ… #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modified Examples dir to provide a preview of PSake based module publ… #112
Conversation
@rkeithhill, I wonder if it will be possible to use an alternative tool similar to PSake. I mean Invoke-Build. Please do not get me wrong, I am not asking to use it. But it would be nice if in VSCode I can choose the build tool or at least to be able to configure manually. Will this be possible? |
@rkeithhill Awesome! Excellent work on the documentation and everything. I think it might be time for me to clean up or get rid of @nightroman You can definitely use an alternative build system by hooking up your own build script to VS Code's task interface. Check out the |
Good part of what we are trying to figure out is what is exposed and what is done 'black box' by this extension. I lean towards having the extension rely upon existing infrastructure but help tie it together. By tie together I mean scaffold the project files required to accomplish build and publish. The two files that are of interest here are the build.ps1 file and the tasks.json file that defines how to invoke the build script. I could imagine providing alternatives during the scaffolding process. That said, I'd like to steer folks towards the best solution for things like build and test. For test, Pester is the clear winner. For build, I liked that Psake had lots of contributors. But as @daviwil says, if we go with something similar to this approach you can easily plumb in invoke-build for your builds. |
@rkeithhill Regarding the Publish-Module concerns, this is definitely going to be a problem with invoking those cmdlets directly through the task interface since the PowerShell engine won't be able to prompt the user. Maybe we can open a new PowerShell.exe prompt to run those commands so that the console host can show the prompts? For the NuGet key prompt we could say "Enter your PSGallery API key (or nothing, this isn't used yet in the preview)" |
Forgot to ask, is this ready to be merged? Looks good to me. |
Not quite yet. Few more tweaks. |
No problem man, I'm not in a rush :) |
…t before calling Publish-Module to see where in the Publish task it occassionally hangs. Although now that I put this text in, it doesn't appear to hang on me now. Go figure.
OK, should be ready now. BTW found a bug I think. Peek definition doesn't seem to work for module-based functions. |
Modified Examples dir to provide a preview of PSake based module publ…
You mean a function defined in another file in a module? If so, I still need to implement "find references" support in general for functions defined in modules. Only references we're traversing right now are dot-source references. |
Yes. I had thought about replacing the Stop/Stop-Processing examples by importing SampleModule.psd1 in DebugTest and then using the New-File command. But peek def did not work on New-File. |
Hmmm, interesting, will need to look into that. |
@daviwil and @rkeithhill, thank you. Configurable |
…ishing. OK, take this for a spin and see what you think. FYI, PSake has not been published to the PSGallery yet. They are shooting for end of the month. For now, just grab it from here (https://github.com/psake/psake/releases) and install it manually. Then press Ctrl+Shift+B to create the Release directory. You can CD to that run ipmo SampleModule and play with the sample module. When ready to publish, Ctrl+P then "task publish". First time you should get a credential prompt as you to enter your NuGet API key. I wonder if we should modify the prompt text for now to say "Enter anything - doesn't matter"? The only other thing I'm worried about is that running Publish-Module could trigger bootstrapping which requires the user to respond. Unfortunately the way the task is run, that "prompt" doesn't become visible. However once you've bootstrapped publish-module once, there shouldn't be any more prompts. Probably need to test this on a virgin system.