Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Examples and documentation updates + bugfixes #18

Merged
merged 6 commits into from

2 participants

@whut
Owner

Thanks for accepting my previous pull request https://github.com/JamesKovacs/psake/pull/9

Here are commits that update documentation and examples to follow changes in that pull request.

There is also a commit that restores possibility to set framework version through $framework global variable and another that fixes typo in variable name. ColoredOutput is now $true by default to show error messages in red, as previously

whut added some commits
@whut whut Added example of task precondition and postcondition and another of T…
…askSetup and TearDown

Also reworded assert messages in two examples to show correct usage
55a09e6
@whut whut Fixed checkvariables example after recent changes
Also simplified and added showing some more properties
a15c2c7
@whut whut Restored ability to set framework version through global framework va…
…riable

Also fixed mixed tabs and spaces
32912ec
@whut whut Updated documentation of Invoke-Psake after recent changes
Also added Framework as related link to other psake functions
5a74222
@whut whut Fixed typo in one function added in d706e52 cc2a34f
@whut whut coloredOutput is true by default
This way by default error messages will be showed in red, as before
6d2583c
@whut
Owner

Hey, is someone there to discuss this pull request?

@lanwin
Owner

Yep its in review on my machine. But i got a mac recently and did not found the time to do it :-)

@whut
Owner

Hey!

@lanwin lanwin merged commit 6d2583c into psake:master
@lanwin
Owner

Ah sorry :-) applied

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 5, 2011
  1. @whut

    Added example of task precondition and postcondition and another of T…

    whut authored
    …askSetup and TearDown
    
    Also reworded assert messages in two examples to show correct usage
  2. @whut

    Fixed checkvariables example after recent changes

    whut authored
    Also simplified and added showing some more properties
  3. @whut

    Restored ability to set framework version through global framework va…

    whut authored
    …riable
    
    Also fixed mixed tabs and spaces
  4. @whut

    Updated documentation of Invoke-Psake after recent changes

    whut authored
    Also added Framework as related link to other psake functions
  5. @whut
  6. @whut

    coloredOutput is true by default

    whut authored
    This way by default error messages will be showed in red, as before
This page is out of date. Refresh to see the latest.
View
207 en-US/psake.psm1-help.xml
@@ -77,8 +77,8 @@
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false (ByValue)" position="2">
<maml:name>framework</maml:name>
<maml:description>
- <maml:para>The version of the .NET framework you want to build. You can append x86 or x64 to force a specific framework. If not specified, x86 or x64 will be detected based on the bitness of the PowerShell process.
-Possible values: '1.0', '1.1', '2.0', '2.0x86', '2.0x64', '3.0', '3.0x86', '3.0x64', '3.5', '3.5x86', '3.5x64', '4.0', '4.0x86', '4.0x6'</maml:para>
+ <maml:para>The version of the .NET framework you want to use during build. You can append x86 or x64 to force a specific framework. If not specified, x86 or x64 will be detected based on the bitness of the PowerShell process.
+Possible values: '1.0', '1.1', '2.0', '2.0x86', '2.0x64', '3.0', '3.0x86', '3.0x64', '3.5', '3.5x86', '3.5x64', '4.0', '4.0x86', '4.0x64'</maml:para>
</maml:description>
<command:parameterValue required="false" variableLength="false">String</command:parameterValue>
<dev:type>
@@ -173,13 +173,16 @@ Possible values: '1.0', '1.1', '2.0', '2.0x86', '2.0x64', '3.0', '3.0x86', '3.0x
<maml:alert>
<maml:para>---- $psake variable ----</maml:para>
<maml:para>When the psake module is loaded a variable called $psake is created which is a hashtable
-containing some variables that can be used to configure psake:
+containing some variables:
-$psake.build_success = $false # indicates that the current build was successful
-$psake.version = "4.2" # contains the current version of psake
-$psake.build_script_file = $null # contains a System.IO.FileInfo for the current build file
-$psake.build_script_dir # contains the fully qualified path to the current build file
-$psake.framework_version = "" # contains the framework version # for the current build
+$psake.version # contains the current version of psake
+$psake.context # holds onto the current state of all variables
+$psake.run_by_psake_build_tester # indicates that build is being run by psake-BuildTester
+$psake.config_default # contains default configuration
+ # can be overriden in psake-config.ps1 in directory with psake.psm1 or in directory with current build script
+$psake.build_success # indicates that the current build was successful
+$psake.build_script_file # contains a System.IO.FileInfo for the current build script
+$psake.build_script_dir # contains the fully qualified path to the current build script
You should see the following when you display the contents of the $psake variable right after importing psake
@@ -188,13 +191,15 @@ PS projects:\psake> $psake
Name Value
---- -----
+run_by_psake_build_tester False
version 4.2
+build_success False
build_script_file
build_script_dir
-build_success False
-framework_version
+config_default @{framework=3.5; ...
+context {}
-After a build is executed the following $psake values are updated (build_script_file, build_script_dir, build_success, and framework_version)
+After a build is executed the following $psake values are updated: build_script_file, build_script_dir, build_success
PS projects:\psake> Invoke-psake .\examples\default.ps1
Executing task: Clean
@@ -220,11 +225,14 @@ PS projects:\psake> $psake
Name Value
---- -----
+build_script_file YOUR_PATH\examples\default.ps1
+run_by_psake_build_tester False
+build_script_dir YOUR_PATH\examples
+context {}
version 4.2
-build_script_file C:\Users\Jorge\Documents\Projects\psake\examples\default.ps1
-build_script_dir C:\Users\Jorge\Documents\Projects\psake\examples
build_success True
-framework_version 3.5
+config_default @{framework=3.5; ...
+
</maml:para>
<maml:para></maml:para>
</maml:alert>
@@ -427,6 +435,10 @@ task TestProperties {
<maml:linkText>Assert</maml:linkText>
<maml:uri />
</maml:navigationLink>
+ <maml:navigationLink>
+ <maml:linkText>Framework</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
</maml:relatedLinks>
</command:command>
@@ -574,6 +586,10 @@ Build Succeeded</maml:para>
<maml:linkText>Assert</maml:linkText>
<maml:uri />
</maml:navigationLink>
+ <maml:navigationLink>
+ <maml:linkText>Framework</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
</maml:relatedLinks>
</command:command>
@@ -721,11 +737,146 @@ Build Succeeded</maml:para>
<maml:linkText>Assert</maml:linkText>
<maml:uri />
</maml:navigationLink>
+ <maml:navigationLink>
+ <maml:linkText>Framework</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
+ <command:name>Framework</command:name>
+ <maml:description>
+ <maml:para>Sets the version of the .NET framework you want to use during build.</maml:para>
+ </maml:description>
+ <maml:copyright>
+ <maml:para />
+ </maml:copyright>
+ <command:verb></command:verb>
+ <command:noun></command:noun>
+ <dev:version />
+ </command:details>
+ <maml:description>
+ <maml:para>This function will accept a string containing version of the .NET framework to use during build. Possible values: '1.0', '1.1', '2.0', '2.0x86', '2.0x64', '3.0', '3.0x86', '3.0x64', '3.5', '3.5x86', '3.5x64', '4.0', '4.0x86', '4.0x64'. Default is '3.5*', where x86 or x64 will be detected based on the bitness of the PowerShell process.</maml:para>
+ </maml:description>
+ <command:syntax>
+ <command:syntaxItem>
+ <command:name>Framework</command:name>
+ <command:parameter require="false" variableLength="false" globbing="false" pipelineInput="false" postion="0">
+ <maml:name>framework</maml:name>
+ <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
+ </command:parameter>
+ </command:syntaxItem>
+ </command:syntax>
+ <command:parameters>
+ <command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false (ByValue)" position="0">
+ <maml:name>framework</maml:name>
+ <maml:description>
+ <maml:para>Version of the .NET framework to use during build.</maml:para>
+ </maml:description>
+ <command:parameterValue required="true" variableLength="false">string</command:parameterValue>
+ <dev:type>
+ <maml:name>string</maml:name>
+ <maml:uri />
+ </dev:type>
+ <dev:defaultValue></dev:defaultValue>
+ </command:parameter>
+ </command:parameters>
+ <command:inputTypes>
+ <command:inputType>
+ <dev:type>
+ <maml:name>None</maml:name>
+ <maml:uri />
+ <maml:description>
+ <maml:para />
+ </maml:description>
+ </dev:type>
+ <maml:description />
+ </command:inputType>
+ </command:inputTypes>
+ <command:returnValues>
+ <command:returnValue>
+ <dev:type>
+ <maml:name>None</maml:name>
+ <maml:uri />
+ <maml:description>
+ <maml:para></maml:para>
+ </maml:description>
+ </dev:type>
+ <maml:description />
+ </command:returnValue>
+ </command:returnValues>
+ <command:terminatingErrors />
+ <command:nonTerminatingErrors />
+ <maml:alertSet>
+ <maml:title></maml:title>
+ <maml:alert>
+ <maml:para></maml:para>
+ </maml:alert>
+ </maml:alertSet>
+ <command:examples>
+ <command:example>
+ <maml:title>-------------- EXAMPLE 1 --------------</maml:title>
+ <dev:code>
+Framework "4.0"
+
+Task default -depends Compile
+
+Task Compile -depends Clean {
+ msbuild /version
+}</dev:code>
+ <dev:remarks>
+ <maml:para>Description</maml:para>
+ <maml:para>-----------</maml:para>
+ <maml:para>The script above will output detailed version of msbuid v4</maml:para>
+ <maml:para />
+ </dev:remarks>
+ <command:commandLines>
+ <command:commandLine>
+ <command:commandText />
+ </command:commandLine>
+ </command:commandLines>
+ </command:example>
+ </command:examples>
+ <maml:relatedLinks>
+ <maml:navigationLink>
+ <maml:linkText>Task</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
+ <maml:navigationLink>
+ <maml:linkText>Include</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
+ <maml:navigationLink>
+ <maml:linkText>Properties</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
+ <maml:navigationLink>
+ <maml:linkText>Invoke-psake</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
+ <maml:navigationLink>
+ <maml:linkText>FormatTaskName</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
+ <maml:navigationLink>
+ <maml:linkText>TaskSetup</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
+ <maml:navigationLink>
+ <maml:linkText>TaskTearDown</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
+ <maml:navigationLink>
+ <maml:linkText>Assert</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
+ </maml:relatedLinks>
+ </command:command>
+
+ <command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
+ <command:details>
<command:name>FormatTaskName</command:name>
<maml:description>
<maml:para>This function allows you to change how psake renders the task name during a build.</maml:para>
@@ -906,6 +1057,10 @@ Task TaskC {
<maml:linkText>Assert</maml:linkText>
<maml:uri />
</maml:navigationLink>
+ <maml:navigationLink>
+ <maml:linkText>Framework</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
</maml:relatedLinks>
</command:command>
@@ -1043,6 +1198,10 @@ Task Clean {
<maml:linkText>Assert</maml:linkText>
<maml:uri />
</maml:navigationLink>
+ <maml:navigationLink>
+ <maml:linkText>Framework</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
</maml:relatedLinks>
</command:command>
@@ -1185,6 +1344,10 @@ Task Clean {
<maml:linkText>Assert</maml:linkText>
<maml:uri />
</maml:navigationLink>
+ <maml:navigationLink>
+ <maml:linkText>Framework</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
</maml:relatedLinks>
</command:command>
@@ -1485,6 +1648,10 @@ Total: 00:00:00.0782496</dev:code>
<maml:linkText>Assert</maml:linkText>
<maml:uri />
</maml:navigationLink>
+ <maml:navigationLink>
+ <maml:linkText>Framework</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
</maml:relatedLinks>
</command:command>
@@ -1657,6 +1824,10 @@ The solution is to wrap the condition in () so that PS will evaluate it first.
<maml:uri />
</maml:navigationLink>
</maml:relatedLinks>
+ <maml:navigationLink>
+ <maml:linkText>Framework</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
@@ -1800,6 +1971,10 @@ The solution is to wrap the condition in () so that PS will evaluate it first.
<maml:uri />
</maml:navigationLink>
</maml:relatedLinks>
+ <maml:navigationLink>
+ <maml:linkText>Framework</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
@@ -1930,6 +2105,10 @@ The solution is to wrap the condition in () so that PS will evaluate it first.
<maml:linkText>TaskTearDown</maml:linkText>
<maml:uri />
</maml:navigationLink>
+ <maml:navigationLink>
+ <maml:linkText>Framework</maml:linkText>
+ <maml:uri />
+ </maml:navigationLink>
</maml:relatedLinks>
</command:command>
</helpItems>
View
51 examples/checkvariables.ps1
@@ -1,34 +1,33 @@
Properties {
- $x = 1
- $y = 2
+ $x = 1
+ $y = 2
}
FormatTaskName "[{0}]"
Task default -Depends Verify
-Task Verify -Description "This task verifies psake's variables" {
-
- $assertions = @(
- ((Test-Path 'variable:\psake'), "'psake' variable was not exported from module"),
- (($variable:psake.ContainsKey("build_success")), "psake variable does not contain 'build_success'"),
- (($variable:psake.ContainsKey("version")), "psake variable does not contain 'version'"),
- (($variable:psake.ContainsKey("build_script_file")), "psake variable does not contain 'build_script_file'"),
- (($variable:psake.ContainsKey("framework_version")), "psake variable does not contain 'framework_version'"),
- ((!$variable:psake.build_success), 'psake.build_success should be $false'),
- ((![string]::IsNullOrEmpty($variable:psake.version)), 'psake.version was null or empty'),
- (($variable:psake.build_script_file -ne $null), '$psake.build_script_file was null'),
- (($variable:psake.build_script_file.Name -eq "checkvariables.ps1"), ("psake variable: {0} was not equal to 'VerifyVariables.ps1'" -f $psake.build_script_file.Name)),
- ((![string]::IsNullOrEmpty($variable:psake.framework_version)), 'psake variable: $psake.framework_version was null or empty'),
- (($variable:psake.context.Peek().tasks.Count -ne 0), 'psake variable: $tasks had length zero'),
- (($variable:psake.context.Peek().properties.Count -ne 0), 'psake variable: $properties had length zero'),
- (($variable:psake.context.Peek().includes.Count -eq 0), 'psake variable: $includes should have had length zero'),
- (($variable:psake.context.Peek().formatTaskNameString -ne ""), 'psake variable: $formatTaskNameString was not set correctly'),
- (($variable:psake.context.Peek().currentTaskName -eq "Verify"), 'psake variable: $currentTaskName was not set correctly')
- )
-
- foreach ($assertion in $assertions)
- {
- Assert ( $assertion[0] ) $assertion[1]
- }
+Task Verify -Description "This task verifies psake's variables" {
+
+ Assert (Test-Path 'variable:\psake') "psake variable was not exported from module"
+
+ Assert ($psake.ContainsKey("version")) "psake variable does not contain 'version'"
+ Assert ($psake.ContainsKey("context")) "psake variable does not contain 'context'"
+ Assert ($psake.ContainsKey("build_success")) "psake variable does not contain 'build_success'"
+ Assert ($psake.ContainsKey("build_script_file")) "psake variable does not contain 'build_script_file'"
+ Assert ($psake.ContainsKey("build_script_dir")) "psake variable does not contain 'build_script_dir'"
+
+ Assert (![string]::IsNullOrEmpty($psake.version)) '$psake.version was null or empty'
+ Assert ($psake.context -ne $null) '$psake.context was null'
+ Assert (!$psake.build_success) '$psake.build_success should be $false'
+ Assert ($psake.build_script_file -ne $null) '$psake.build_script_file was null'
+ Assert ($psake.build_script_file.Name -eq "checkvariables.ps1") ("psake variable: {0} was not equal to 'checkvariables.ps1'" -f $psake.build_script_file.Name)
+ Assert (![string]::IsNullOrEmpty($psake.build_script_dir)) '$psake.build_script_dir was null or empty'
+
+ Assert ($psake.context.Peek().tasks.Count -ne 0) "psake context variable 'tasks' had length zero"
+ Assert ($psake.context.Peek().properties.Count -ne 0) "psake context variable 'properties' had length zero"
+ Assert ($psake.context.Peek().includes.Count -eq 0) "psake context variable 'includes' should have had length zero"
+ Assert ($psake.context.Peek().config -ne $null) "psake context variable 'config' was null"
+
+ Assert ($psake.context.Peek().currentTaskName -eq "Verify") 'psake variable: $currentTaskName was not set correctly'
}
View
8 examples/msbuild40.ps1
@@ -0,0 +1,8 @@
+Framework "4.0"
+# Framework "4.0x64"
+
+task default -depends ShowMsBuildVersion
+
+task ShowMsBuildVersion {
+ msbuild /version
+}
View
2  examples/parameters.ps1
@@ -5,5 +5,5 @@
task default -depends TestParams
task TestParams {
- Assert ($my_property -ne $null) '$my_property should not be null'
+ Assert ($my_property -ne $null) "`$my_property should not be null. Run with -parameters @{'p1' = 'v1'; 'p2' = 'v2'}"
}
View
18 examples/preandpostcondition.ps1
@@ -0,0 +1,18 @@
+properties {
+ $runTaskA = $false
+ $taskBSucceded = $true
+}
+
+task default -depends TaskC
+
+task TaskA -precondition { $runTaskA -eq $true } {
+ "TaskA executed"
+}
+
+task TaskB -postcondition { $taskBSucceded -eq $true } {
+ "TaskB executed"
+}
+
+task TaskC -depends TaskA,TaskB {
+ "TaskC executed."
+}
View
10 examples/properties.ps1
@@ -1,13 +1,13 @@
properties {
- $x = $null
- $y = $null
- $z = $null
+ $x = $null
+ $y = $null
+ $z = $null
}
task default -depends TestProperties
task TestProperties {
- Assert ($x -ne $null) "x should not be null"
- Assert ($y -ne $null) "y should not be null"
+ Assert ($x -ne $null) "x should not be null. Run with -properties @{'x' = '1'; 'y' = '2'}"
+ Assert ($y -ne $null) "y should not be null. Run with -properties @{'x' = '1'; 'y' = '2'}"
Assert ($z -eq $null) "z should be null"
}
View
17 examples/tasksetupandteardown.ps1
@@ -0,0 +1,17 @@
+TaskSetup {
+ "Executing task setup"
+}
+
+TaskTearDown {
+ "Executing task tear down"
+}
+
+Task default -depends TaskB
+
+Task TaskA {
+ "TaskA executed"
+}
+
+Task TaskB -depends TaskA {
+ "TaskB executed"
+}
View
2  psake-config.ps1
@@ -7,7 +7,7 @@ $config.framework = "3.5";
$config.taskNameFormat="Executing {0}";
$config.exitCode="1";
$config.verboseError=$true;
-$config.coloredOutput = $false;
+$config.coloredOutput = $true;
$config.modules=(new-object psobject -property @{ autoload=$false })
-------------------------------------------------------------------
View
43 psake.psm1
@@ -239,6 +239,15 @@ function TaskTearDown {
}
# .ExternalHelp psake.psm1-help.xml
+function Framework {
+ [CmdletBinding()]
+ param(
+ [Parameter(Position=0,Mandatory=1)][string]$framework
+ )
+ $psake.context.Peek().config.framework = $framework
+}
+
+# .ExternalHelp psake.psm1-help.xml
function Invoke-psake {
[CmdletBinding()]
param(
@@ -252,13 +261,11 @@ function Invoke-psake {
)
try {
if (-not $nologo) {
- "psake version {0}`nCopyright (c) 2010 James Kovacs`n" -f $psake.version
- }
- <#
- If the default.ps1 file exists and the given "buildfile" isn 't found assume that the given
- $buildFile is actually the target Tasks to execute in the default.ps1 script.
- #>
-
+ "psake version {0}`nCopyright (c) 2010 James Kovacs`n" -f $psake.version
+ }
+
+ # If the default.ps1 file exists and the given "buildfile" isn 't found assume that the given
+ # $buildFile is actually the target Tasks to execute in the default.ps1 script.
if ($buildFile -and !(test-path $buildFile) -and (test-path $psake.config_default.buildFileName)) {
$taskList = $buildFile.Split(', ')
$buildFile = $psake.config_default.buildFileName
@@ -271,7 +278,6 @@ function Invoke-psake {
$psake.build_script_dir = $psake.build_script_file.DirectoryName
$psake.build_success = $false
-
$psake.context.push(@{
"taskSetupScriptBlock" = {};
"taskTearDownScriptBlock" = {};
@@ -294,8 +300,16 @@ function Invoke-psake {
set-location $psake.build_script_dir
+ $frameworkOldValue = $framework
. $psake.build_script_file.FullName
+ $currentContext = $psake.context.Peek()
+
+ if ($framework -ne $frameworkOldValue) {
+ write-coloredoutput $msgs.warning_deprecated_framework_variable -foregroundcolor Yellow
+ $currentContext.config.framework = $framework
+ }
+
if ($docs) {
Write-Documentation
Cleanup-Environment
@@ -304,8 +318,6 @@ function Invoke-psake {
Configure-BuildEnvironment
- $currentContext = $psake.context.Peek()
-
while ($currentContext.includes.Count -gt 0) {
$includeFilename = $currentContext.includes.Dequeue()
. $includeFilename
@@ -468,7 +480,7 @@ function Get-CurrentConfigurationOrDefault() {
function Create-ConfigurationForNewContext {
param(
- [string] $buildFileName,
+ [string] $buildFile,
[string] $framework
)
@@ -684,6 +696,7 @@ convertfrom-stringdata @'
error_invalid_module_dir = Unable to load modules from directory: {0}
error_invalid_module_path = Unable to load module at path: {0}
error_loading_module = Error loading module: {0}
+ warning_deprecated_framework_variable = Warning: Using global variable $framework to set .NET framework version used is deprecated. Instead use Framework function or configuration file psake-config.ps1
postcondition_failed = Postcondition failed for {0}
precondition_was_false = Precondition was false not executing {0}
continue_on_error = Error in Task [{0}] {1}
@@ -703,16 +716,16 @@ $psake.config_default = new-object psobject -property @{
taskNameFormat = "Executing {0}";
exitCode = "1";
verboseError = $false;
- coloredOutput = $false;
+ coloredOutput = $true;
modules = (new-object PSObject -property @{
autoload = $false
})
-} # contains default configuration, can be overriden in psake-config.ps1 in directory with psake.psm1
+} # contains default configuration, can be overriden in psake-config.ps1 in directory with psake.psm1 or in directory with current build script
$psake.build_success = $false # indicates that the current build was successful
-$psake.build_script_file = $null # contains a System.IO.FileInfo for the current build file
+$psake.build_script_file = $null # contains a System.IO.FileInfo for the current build script
$psake.build_script_dir = "" # contains a string with fully-qualified path to current build script
Load-Configuration
-export-modulemember -function invoke-psake, invoke-task, task, properties, include, formattaskname, tasksetup, taskteardown, assert, exec -variable psake
+export-modulemember -function invoke-psake, invoke-task, task, properties, include, formattaskname, tasksetup, taskteardown, framework, assert, exec -variable psake
View
4 specs/writing_psake_variables_should_pass.ps1
@@ -25,11 +25,11 @@ task Verify -description "This task verifies psake's variables" {
$config = $psake.context.peek().config
Assert ($config) '$psake.config is $null'
- Assert ($config.buildFileName -eq $psake.build_script_file.FullName) ('$psake.context.peek().config.buildFileName not equal to "{0}"' -f $psake.build_script_file.FullName)
+ Assert ((new-object "System.IO.FileInfo" $config.buildFileName).FullName -eq $psake.build_script_file.FullName) ('$psake.context.peek().config.buildFileName not equal to "{0}"' -f $psake.build_script_file.FullName)
Assert ($config.framework -eq "3.5") '$psake.context.peek().config.framework not equal to "3.5"'
Assert ($config.taskNameFormat -eq "Executing {0}") '$psake.context.peek().config.taskNameFormat not equal to "Executing {0}"'
Assert ($config.exitCode -eq "1") '$psake.context.peek().config.ExitCode not equal to "1"'
Assert (!$config.verboseError) '$psake.context.peek().config.verboseError should be $false'
- Assert (!$config.coloredOutput) '$psake.context.peek().config.coloredOutput should be $false'
+ Assert ($config.coloredOutput) '$psake.context.peek().config.coloredOutput should be $false'
Assert ($config.modules) '$psake.context.peek().config.modules is $null'
}
Something went wrong with that request. Please try again.