Skip to content
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

Unload all user modules when build finishes. #179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

enyim
Copy link

@enyim enyim commented May 8, 2016

When the build script (e.g. psake.ps1) is ran from a powershell window and modules are loaded globally (to enable code sharing), they

  1. pollute the current shell
  2. running the build multiple times will not pick up the changes in the modules

2 could be solved by using Import-Module -Force in LoadModules, but 1 requires that Psake unloads all loaded modules when finished.

To make the code less complicated (e.g. managing nested imports), all loaded modules are tracked and unloaded only when all builds are done (the last scope have been cleaned up).

No idea how to write tests for this tho, the current test runner does not allow me to run tests after the build have finished.

@enyim
Copy link
Author

enyim commented May 9, 2016

Is the build script bugged?

[00:00:00] Build started
[00:00:00] git clone -q https://github.com/psake/psake.git C:\projects\psake
[00:00:04] git fetch -q origin +refs/pull/179/merge:
[00:00:05] git checkout -qf FETCH_HEAD
[00:00:05] Specify a project or solution file. The directory does not contain a project or solution file.

@gep13
Copy link
Member

gep13 commented May 9, 2016

@enyim if you are referring to the AppVeyor build, then yes, as it is currently configured, it doesn't work correctly. Refer to here: #172

@enyim
Copy link
Author

enyim commented May 28, 2016

Can I do something to get this merged?

@devblackops
Copy link
Member

@enyim If some specs can be created that validate this functionality I think it would be a great addition.

The AppVeyor builds are working now as well.

@stale
Copy link

stale bot commented Aug 23, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 23, 2019
@devblackops devblackops self-assigned this Aug 23, 2019
@stale stale bot removed the stale label Aug 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants