Skip to content

Refactored psake build script. #147

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

Merged
merged 2 commits into from
Oct 7, 2016

Conversation

rkeithhill
Copy link
Collaborator

This separates out the user customizations into a separate file build.settings.ps1. Also made changes related to the discussion in issue #145. Fixed some bugs with the build script as well after a fair bit of testing. Too bad my code-signing cert expired last month. Hopefully DigiCert will come through with a new cert so I can test the Sign task.

This separates out the user customizations into a separate file build.settings.ps1.  Also made changes related to the discussion in issue #145. Fixed some bugs with the build script as well after a fair bit of testing.  Too bad my code-signing cert expired last month. Hopefully DigiCert will come through with a new cert so I can test the Sign task.
@rkeithhill
Copy link
Collaborator Author

Ugh, by splitting out the psake properties (variables) from where they are mostly used, I wind up with 14 PSSA warnings in a newly scaffolded module. I can eliminate the warnings like this:

    [System.Diagnostics.CodeAnalysis.SuppressMessage('PSUseDeclaredVarsMoreThanAssigments', '', Scope='*', Target='DocsRootDir')]
    $DocsRootDir = "$PSScriptRoot/docs"
    $SrcRootDir  = "$PSScriptRoot/src"
    [System.Diagnostics.CodeAnalysis.SuppressMessage('PSUseDeclaredVarsMoreThanAssigments', '', Scope='*', Target='TestRootDir')]
    $TestRootDir = "$PSScriptRoot/test"

but that is a bit of a spew. I wish there was a way to tell PSSA that the file always gets dot sourced and to never evaluate the file by itself.

@rkeithhill rkeithhill merged commit e7ce642 into master Oct 7, 2016
@rkeithhill rkeithhill deleted the rkeithhill/fix-build-script-issues branch October 7, 2016 15:34
@daviwil
Copy link
Contributor

daviwil commented Oct 7, 2016

@kapilmb has started improving Script Analyzer to make certain rules (recently the one about ShouldProcess usage) have more awareness of the context or usage of certain things before giving warnings about them. I think we'll continue to move in that direction to make the rules smarter so it's good to know that this is a case where a rule can be improved with that kind of logic.

@rkeithhill
Copy link
Collaborator Author

I saw that PSSA issue get closed. Way cool. Looks like the code to fix it was non-trivial.

@daviwil
Copy link
Contributor

daviwil commented Oct 7, 2016

Yep, we're finally starting to put the "Analyzer" into "Script Analyzer" ;)

@rkeithhill
Copy link
Collaborator Author

rkeithhill commented Oct 7, 2016

@daviwil BTW I was able to run through all the build script tasks up to sign/buildhelp/install with no problems. Haven't tested publish yet. Do you have a private test gallery that we could use for testing the publish task?

@daviwil
Copy link
Contributor

daviwil commented Oct 7, 2016

Not one that's publicly available, but I wonder if we could easily set one up with PSPrivateGallery. Also wonder if we could somehow set up a private gallery inside of an AppVeyor VM...

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.

3 participants