-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support script blocks as File, resolve #78
- Loading branch information
1 parent
794c78a
commit 4963636
Showing
16 changed files
with
197 additions
and
100 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
## How to assemble builds using script blocks | ||
|
||
- [app1.ps1](app1.ps1) adds before/after tasks to a build script before invoking. | ||
- [app2.ps1](app2.ps1) sets custom build blocks for a build script. | ||
- [app3.ps1](app3.ps1) creates and invokes some test tasks. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
<# | ||
.Synopsis | ||
Import a build and alter tasks. | ||
#> | ||
|
||
Invoke-Build Test { | ||
# import build script | ||
. ./my.build.ps1 | ||
|
||
# alter task `Test` | ||
task BeforeTest -Before Test { | ||
Write-Host '@BeforeTest' | ||
} | ||
|
||
# alter task `Test` | ||
task AfterTest -After Test { | ||
Write-Host '@AfterTest' | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
<# | ||
.Synopsis | ||
Import a build and set build blocks. | ||
#> | ||
|
||
Invoke-Build Test { | ||
# import build script | ||
. ./my.build.ps1 | ||
|
||
# set build block | ||
Set-BuildHeader { | ||
param($Path) | ||
Write-Build Cyan "Task $Path" | ||
Write-Build Magenta "# Synopsis: $(Get-BuildSynopsis $Task)" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
<# | ||
.Synopsis | ||
Inline build with some tests. | ||
#> | ||
|
||
$MyFile = $MyInvocation.MyCommand.Path | ||
$MyRoot = Split-Path $MyFile | ||
|
||
Invoke-Build * -Summary { | ||
task TestBuildFile { | ||
$BuildFile | ||
equals $BuildFile $MyFile | ||
} | ||
task TestBuildRoot { | ||
$BuildRoot | ||
equals $BuildRoot $MyRoot | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
# Synopsis: Some task. | ||
task Test { | ||
Write-Host '@Test' | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.