-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 37ef181
Showing
108 changed files
with
6,188 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
# Custom for Visual Studio | ||
*.cs diff=csharp | ||
|
||
# Standard to msysgit | ||
*.doc diff=astextplain | ||
*.DOC diff=astextplain | ||
*.docx diff=astextplain | ||
*.DOCX diff=astextplain | ||
*.dot diff=astextplain | ||
*.DOT diff=astextplain | ||
*.pdf diff=astextplain | ||
*.PDF diff=astextplain | ||
*.rtf diff=astextplain | ||
*.RTF diff=astextplain |
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,55 @@ | ||
# Windows image file caches | ||
Thumbs.db | ||
ehthumbs.db | ||
|
||
# Folder config file | ||
Desktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
# ========================= | ||
# Operating System Files | ||
# ========================= | ||
|
||
# OSX | ||
# ========================= | ||
|
||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
# ========================= | ||
# Build custom | ||
# ========================= | ||
Credentials | ||
Working | ||
Releases | ||
Temp |
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,63 @@ | ||
Getting started | ||
=============== | ||
Builder is a human friendly build automation solution. If you are looking for better control over your build process beyond what your IDE churns out, but don't want to deal with the XML drama, this is just the tool! | ||
|
||
Nothing beats an example: | ||
|
||
*Your regular MSBuild csproject* | ||
|
||
```xml | ||
<?xml version="1.0" encoding="utf-16"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Target Name="Compile"> | ||
<Message Text="I am compiling!" /> | ||
</Target> | ||
<Target Name="Finish" DependsOnTargets="Compile"> | ||
<Message Text="All done!" /> | ||
</Target> | ||
</Project | ||
``` | ||
|
||
*turns into this...* | ||
|
||
```powershell | ||
task default -depends Finish | ||
|
||
task Compile { | ||
say 'I am compiling!' | ||
} | ||
|
||
task Finish -depends Compile { | ||
say 'All done!' | ||
} | ||
``` | ||
|
||
|
||
Basics | ||
------ | ||
Similar to build toolchains such as Ant, NAnt, Rake or MSBuild, Builder works by automatically resolving the run order of interdependent scripts we call "tasks". | ||
|
||
Take the example above: | ||
- default depends on Finish | ||
- Compile depends on nothing | ||
- Finish depends on Compile | ||
|
||
Builder is hardcoded to look for the 'default' task. It will resolve the build order as follows: | ||
1. Compile | ||
2. Finish | ||
|
||
|
||
So why Builder? | ||
------------------ | ||
Existing toolchains work great, except when you open up the make file with a text editor and sees the angular brackets. Sure, a good IDE will take most of the pain away, but you lose flexibility and fine control. | ||
|
||
Builder offers a domain specific language (DSL) specifically designed for build jobs. It also brings in the full power of Powershell and .NET, which is a step up from writing bash scripts and make files. Don't think that this is a Windows/.NET ecosystem thing though, because Builder itself is totally toolchain neutral, so it doesn't really matter what your build platform or programming language is! | ||
|
||
|
||
Show me the money | ||
----------------- | ||
There isn't a ton of API/documentation, because this is the kind of stuff that is best learnt by examples. | ||
Just look through the build scripts under (../Source/Builder.Tests/Samples)[Source/Builder.Tests/Samples]. It doesn't take more than 15 minutes to become a build automation wizard :D | ||
|
||
|
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,22 @@ | ||
Conditional tasks | ||
================= | ||
You can add preconditions to your tasks. A task that does not satisfy its precondition will be skipped. | ||
|
||
```powershell | ||
task default -depends A, B, C | ||
task A { | ||
"TaskA" | ||
} | ||
task B -precondition { $false } { | ||
"TaskB" | ||
} | ||
task C -precondition { $true } { | ||
"TaskC" | ||
} | ||
``` | ||
|
||
Here task A and C will run, but not B. | ||
|
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,89 @@ | ||
Error Handling | ||
============== | ||
By default, any error encountered inside a `task` block will terminate your build process (or when an external program returns non-zero exit code). | ||
|
||
You can override this behavior using the `ContinueOnError` parameter, in which case it will continue on to the next available task. | ||
|
||
Here's an example: | ||
|
||
```powershell | ||
task default -depends TaskA | ||
task TaskA -depends TaskB { | ||
"Task A ran!" | ||
} | ||
task TaskB -depends TaskC -ContinueOnError { | ||
"Task B ran!" | ||
die "I failed on purpose!" | ||
} | ||
task TaskC { | ||
"Task C ran!" | ||
} | ||
``` | ||
|
||
When you run the above build script, you should get this output: | ||
|
||
``` | ||
Executing task: TaskC | ||
Task C ran! | ||
Executing task: TaskB | ||
Task B ran! | ||
----------------------------------------------------------------- | ||
Error in Task [TaskB] I failed on purpose! | ||
----------------------------------------------------------------- | ||
Executing task: TaskA | ||
Task A ran! | ||
Build Succeeded! | ||
``` | ||
|
||
|
||
Last wills | ||
---------- | ||
Wills are akin to the `finally` part of a `try catch finally` block. It is a script block that executes whenever an error occurs, just before the task or build script "dies". | ||
|
||
Let's modify the example above: | ||
|
||
```powershell | ||
will { | ||
say ("Task '{0}' is about to die..." -f $1) | ||
} | ||
task default -depends TaskA | ||
task TaskA -depends TaskB { | ||
"Task A ran!" | ||
} | ||
task TaskB -depends TaskC -ContinueOnError { | ||
"Task B ran!" | ||
die "I failed on purpose!" | ||
} | ||
task TaskC { | ||
"Task C ran!" | ||
} | ||
``` | ||
|
||
When you run the above build script, you should get this output: | ||
|
||
``` | ||
Executing task: TaskC | ||
Task C ran! | ||
Executing task: TaskB | ||
Task B ran! | ||
Task 'TaskB' is about to die... | ||
----------------------------------------------------------------- | ||
Error in Task [TaskB] I failed on purpose! | ||
----------------------------------------------------------------- | ||
Executing task: TaskA | ||
Task A ran! | ||
Build Succeeded! | ||
``` | ||
|
||
You can have multiple will blocks, in which case they will execute in the order they appear whenever an exception occurs. | ||
|
||
*Tips*: you can let a task die without executing the will. Just use the `-NoWill` parameter. |
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,29 @@ | ||
Include | ||
======= | ||
Use `include` to access functions that are in another script file. | ||
|
||
Let's say this is the content of `build_utils.ps1` | ||
```powershell | ||
function foo { | ||
write-host hi | ||
} | ||
function bar { | ||
write-host bye | ||
} | ||
``` | ||
|
||
You can use `foo` and `bar` in your build script: | ||
|
||
```powershell | ||
include ".\build_utils.ps1" | ||
task default -depends Compile | ||
Task Compile { | ||
foo | ||
bar | ||
} | ||
``` | ||
|
||
*Tips*: You can have multiple `include` statements inside your build script. |
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,23 @@ | ||
The MIT License | ||
=============== | ||
|
||
Copyright 2017 Lizoc Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included | ||
in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Oops, something went wrong.