Added programmatic generation capabilities to the module build process#402
Open
Foggy2 wants to merge 7 commits intoSCRT-HQ:mainfrom
Open
Added programmatic generation capabilities to the module build process#402Foggy2 wants to merge 7 commits intoSCRT-HQ:mainfrom
Foggy2 wants to merge 7 commits intoSCRT-HQ:mainfrom
Conversation
…SGSuite into programmatic-generation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @scrthq & @jgeron-suhsd
I have been working on some other changes that require the ability to programmatically generate some classes and functions at build time.
So I have put this together to support that, but also support any future work that may make use of programmatic generation of the module content.
As a high level explanation, I have made the following changes:
DownloadandGenerateto the PSAKE build process.Downloadcontains the existing code to download the NuGet dependencies, simply moved from theCompiletask.Generatecontains the new programmatic generation functionality.Generatetask generates content by executing all.ps1files found in theci\templatesdirectory. These files are expected to return either String or Hashtable output that contains the generated PowerShell code. The generated code will be written to the corresponding file in the source directory. See theci\templates\README.mdfile for a more detailed explanation of the functionality.Compiletask now captures the source code from theClass,Private,PublicandModulesource code folders.Compiletask has been split and moved into two files:templates\Module\Aliases.ps1template file.Module\Initialization.ps1file.I have made a few design decisions with this so I am very conscious of getting some feedback. Let me know your thoughts.