Skip to content

Commit

Permalink
Merge pull request #90 from KevinMarquette/addcommonfiles !Deploy
Browse files Browse the repository at this point in the history
Add common files to project
  • Loading branch information
KevinMarquette committed Mar 16, 2019
2 parents 717f44f + 2960834 commit ef5c4a2
Show file tree
Hide file tree
Showing 48 changed files with 1,662 additions and 1,165 deletions.
44 changes: 43 additions & 1 deletion .gitignore
@@ -1 +1,43 @@
/output/
/output/
/debug*.ps1
/temp*.ps1

# Most of these heavily cannibalized by Travis Drake from https://gist.github.com/kmorcinek/2710267

# C# VS build detritus
/.vs/
/*/[Bb]in/
/*/[Oo]bj/
**/packages/*

# Except this, this needs to be checked in when present
!**/packages/build/

# More C# / Visual Studio detritus
*.suo
*.user
*.sln.docstates
*.psess
*.vsp
*.vspx
project.lock.json
_UpgradeReport_Files/
UpgradeLog*.XML
UpgradeLog*.htm

# SASS Compiler cache
.sass-cache

# Mac OS stuff
.DS_Store*
Icon?

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/
26 changes: 21 additions & 5 deletions .vscode/settings.json
@@ -1,12 +1,28 @@
// Place your settings in this file to overwrite default and user settings.
{
"powershell.codeFormatting.openBraceOnSameLine": false,
"powershell.codeFormatting.newLineAfterOpenBrace": true,
"powershell.codeFormatting.preset": "Allman",
//-------- Editor configuration --------
"editor.insertSpaces": true,
"editor.tabSize": 4,
"files.defaultLanguage": "powershell",

//-------- Files configuration --------
"files.autoGuessEncoding": false,
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"search.exclude": {
"**/Tests/Data*": true
},

//-------- PowerShell configuration --------
"powershell.codeFormatting.alignPropertyValuePairs": true,
"powershell.codeFormatting.preset": "Allman",
"powershell.scriptAnalysis.settingsPath": "./ScriptAnalyzerSettings.psd1",

//-------- Language configuration --------
"[json]": {
"editor.tabSize": 2
},

"[xml]": {
"editor.tabSize": 2
}
}
}
95 changes: 95 additions & 0 deletions .vscode/tasks.json
@@ -0,0 +1,95 @@
// Available variables which can be used inside of strings:
// ${workspaceRoot}: The root folder of the team
// ${file}: The current opened file
// ${relativeFile}: The current opened file relative to workspaceRoot
// ${fileBasename}: The current opened file's basename
// ${fileDirname}: The current opened file's dirname
// ${fileExtname}: The current opened file's extension
// ${cwd}: The current working directory of the spawned process
{
"version": "2.0.0",
"windows": {
"options": {
"shell": {
"executable": "powershell.exe",
"args": [ "-NoProfile", "-ExecutionPolicy", "Bypass", "-Command" ]
}
}
},
"linux": {
"options": {
"shell": {
"executable": "/usr/bin/pwsh",
"args": [ "-NoProfile", "-Command" ]
}
}
},
"osx": {
"options": {
"shell": {
"executable": "/usr/local/bin/pwsh",
"args": [ "-NoProfile", "-Command" ]
}
}
},
"tasks": [
{
"label": "Default",
"type": "shell",
"problemMatcher": [ "$msCompile" ],
"group": {
"kind": "build",
"isDefault": true
},
"command": "Invoke-Build -Task Default -File './Module.build.ps1'"
},
{
"label": "Analyze",
"type": "shell",
"problemMatcher": [ "$msCompile" ],
"command": "Invoke-Build -Task Analyze -File './Module.build.ps1'"
},
{
"label": "Build",
"type": "shell",
"problemMatcher": [ "$msCompile" ],
"command": "Invoke-Build -Task Build -File './Module.build.ps1'"
},
{
"label": "Clean",
"type": "shell",
"problemMatcher": [ "$msCompile" ],
"command": "Invoke-Build -Task Clean -File './Module.build.ps1'"
},
{
"label": "Helpify",
"type": "shell",
"problemMatcher": [ "$msCompile" ],
"command": "Invoke-Build -Task Helpify -File './Module.build.ps1'"
},
{
"label": "Install",
"type": "shell",
"problemMatcher": [ "$msCompile" ],
"command": "Invoke-Build -Task Install -File './Module.build.ps1'"
},
{
"label": "Test",
"type": "shell",
"problemMatcher": [ "$msCompile" ],
"command": "Invoke-Build -Task Test -File './Module.build.ps1'"
},
{
"label": "Uninstall",
"type": "shell",
"problemMatcher": [ "$msCompile" ],
"command": "Invoke-Build -Task Uninstall -File './Module.build.ps1'"
},
{
"label": "?",
"type": "shell",
"problemMatcher": [],
"command": "Invoke-Build -Task ? -File './Module.build.ps1'"
}
]
}
17 changes: 17 additions & 0 deletions BuildTasks/Analyze.Task.ps1
@@ -0,0 +1,17 @@
task Analyze {
$params = @{
IncludeDefaultRules = $true
Path = $ManifestPath
Settings = "$BuildRoot\ScriptAnalyzerSettings.psd1"
Severity = 'Warning'
}

"Analyzing $ManifestPath..."
$results = Invoke-ScriptAnalyzer @params
if ($results)
{
'One or more PSScriptAnalyzer errors/warnings were found.'
'Please investigate or add the required SuppressMessage attribute.'
$results | Format-Table -AutoSize
}
}
18 changes: 18 additions & 0 deletions BuildTasks/BuildManifest.Task.ps1
@@ -0,0 +1,18 @@

taskx BuildManifest @{
Inputs = (Get-ChildItem -Path $Source -Recurse -File)
Outputs = $ManifestPath
Jobs = {
"Updating [$ManifestPath]..."
Copy-Item -Path "$Source\$ModuleName.psd1" -Destination $ManifestPath

$functions = Get-ChildItem -Path "$ModuleName\Public" -Recurse -Filter *.ps1 -ErrorAction 'Ignore' |
Where-Object 'Name' -notmatch 'Tests'

if ($functions)
{
'Setting FunctionsToExport...'
Set-ModuleFunctions -Name $ManifestPath -FunctionsToExport $functions.BaseName
}
}
}

0 comments on commit ef5c4a2

Please sign in to comment.