Skip to content

Replace OneGet assemblies with these generated by OneGet.org - #2711

Merged
sergei (vors) merged 11 commits into
PowerShell:masterfrom
jianyunt:master
Nov 20, 2016
Merged

sergei (vors) merged 11 commits into
PowerShell:masterfrom
jianyunt:master

Conversation

@jianyunt

Copy link
Copy Markdown
Contributor

Removed PackageManagement source code
Removed existing PackageMangement test code and replace with 8 tests case as acceptance test.
Use Save-Module to pull down PackageMangement from myget.
Changed to alpha.11 in download.sh to enable use PowerShellGet and OneGet in the build

Fix
Issue #1355
Issue #2347

@vors sergei (vors) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good to me

Comment thread build.psm1 Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: Dsetination

Comment thread build.psm1 Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need () around log calls

Comment thread build.psm1 Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's cool 👍

@vors sergei (vors) self-assigned this Nov 18, 2016
Comment thread build.psm1 Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would flip the default behavior and make it -PSModuleRestore.
Very tiny Start-PSBuild should be the bare minimum of things sufficient to run PowerShell.
It also should be incremental-friendly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to PSModuleRestore

Comment thread build.psm1 Outdated

@vors sergei (vors) Nov 18, 2016 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is not correct

  1. On incremental builds, it would Silently not change the folder
  2. When user provide a custom binDir, it will pollute parent directory.

Please, consider fix Start-PSPester to understand both -Publish and no-publish options.
It could be as simple as add -Publish switch.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I open a separate issue #2720 to track the problem in Start-PSPester. For now, the workaround works.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, lets merge the Fix in #2723 and we can proceed with your changes then.

Please revert back 969ac05d706d968eb534e886b5a5b9a4ce14a5bc

@vors

Copy link
Copy Markdown
Collaborator

Jianyun (@jianyunt) to avoid this in the future, please join Microsoft GitHub organization and make your membership public.
image

Comment thread build.psm1 Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not needed as we are registering only if we there is no existing repo with the same source location.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the repository exists, $needRegister is false. This code won't get executed.
Only the case when the same repo exists but is pointing to some other source location.


In reply to: 88761457 [](ancestors = 88761457)

Comment thread build.psm1 Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be simplified with below
log "Unregistering PSRepository with name: $RepositoryName"
PowerShellGet\Get-PSRepository -Name $RepositoryName -ErrorAction SilentlyContinue | PowerShellGet\UnRegister-PSRepository -Name $RepositoryName

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. Will integrate it


In reply to: 88761662 [](ancestors = 88761662)

@bmanikm

Copy link
Copy Markdown
Contributor

:shipit:

# The first commit's message is:

Changed to PSModuleRestore switch, i.e., by default no PSModule install

# This is the commit message #2:

install PowerShell modules to publish folder as well as one level up

# This is the commit message #3:

removed workaround
# Check if the PackageManagement works in the base-oS or PowerShellCore
$PSHome
$PSVersionTable
$env:PSModulePath

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to remove these lines. They will pollute the test output.

Comment thread build.psm1 Outdated
$publishPath = Split-Path $Options.Output -Parent
log "Restore PowerShell modules to $publishPath"
Restore-PSModule -Name PackageManagement -Destination (Join-Path -Path $publishPath -ChildPath "Modules")
Restore-PSModule -Name PowerShellGet -Destination (Join-Path -Path $publishPath -ChildPath "Modules")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you, please, make Name parameter a string[] and pass an array of strings

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it in 391a787

No errors if brew dependencies already present
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants