add ability to package all of powershell core as a NuGet Package#4363
add ability to package all of powershell core as a NuGet Package#4363daxian-dbw merged 20 commits intoPowerShell:masterfrom
Conversation
tools/packaging/packaging.psm1
Outdated
There was a problem hiding this comment.
Maybe change the name to 'content'
There was a problem hiding this comment.
It seems we never use "CLI". Maybe <title>PowerShell Core $runtime$</title>.
There was a problem hiding this comment.
Or just PowerShell for $runtime$ :)
There was a problem hiding this comment.
Update to PowerShell Core
There was a problem hiding this comment.
We have #4352 under review - should we use "Microsoft" in community project?
build.psm1
Outdated
There was a problem hiding this comment.
Better use the verb Sync, as Get- usually indicates result(s) will be returned while Sync is an action.
build.psm1
Outdated
There was a problem hiding this comment.
How about return (git tag --list --sort=-v:refname | Select-Object -First 1)?
There was a problem hiding this comment.
Your proposed implementation depends on version sorting.
The code I wrote gets the latest commit which is a tag, then gets the name.
There was a problem hiding this comment.
discussed offline and git describe --abbrev=0 does what you intended.
build.psm1
Outdated
build.psm1
Outdated
There was a problem hiding this comment.
git describe --dirty causes git to crash on my machine. No idea why is that.
There was a problem hiding this comment.
perhaps it could not find the git-dir. I'll update all the commands to specify it.
There was a problem hiding this comment.
Or just PowerShell for $runtime$ :)
tools/packaging/packaging.psm1
Outdated
There was a problem hiding this comment.
nit: there are trailing spaces in this line.
tools/packaging/packaging.psm1
Outdated
There was a problem hiding this comment.
This description needs to be updated
There was a problem hiding this comment.
PowerShell CLI
Maybe just PowerShell
There was a problem hiding this comment.
Changed to PowerShell Core
build.psm1
Outdated
There was a problem hiding this comment.
Maybe we continue to use git describe to get the commit id. It should work as long as we merge the release branch.
3ab8281 to
4bf60fd
Compare
4bf60fd to
ac6c62a
Compare
| } | ||
| elseif(!$upstreamRemote) | ||
| { | ||
| Write-Error "Please add a remote to PowerShell\PowerShell. Example: git remote add $upstreamRemoteDefaultName $PowerShellRemoteUrl" -ErrorAction Stop |
There was a problem hiding this comment.
Can we continue to execute the script after the error?
There was a problem hiding this comment.
You should not continue executing the script unless you have a remote to PowerShell as the error indicates. The script has always assumed you can fetch the tags. This is just adding a verification.
There was a problem hiding this comment.
This should only occur when someone manually runs the function and it cannot complete the action. So, returning an error and stopping is the correct thing to do.
| --> | ||
| <PropertyGroup> | ||
| <AssemblyName>NotUsed</AssemblyName> | ||
| <Description>PowerShell Core nuget packag with .NET CLI host including everything needed to run it.</Description> |
daxian-dbw
left a comment
There was a problem hiding this comment.
LGTM except for a minor comment.
| $dotnetCLIRequiredVersion = "2.0.0-preview2-006502" | ||
| $tagsUpToDate = $false | ||
|
|
||
| function Sync-PSTags |
There was a problem hiding this comment.
Can you please add a comment to explain why we need to run Sync-PSTags before getting the version (tag) and commit ID? It will help people to understand.
Example usage