Permalink
Browse files

Moved psake-ps2 changes from master to psake-ps2 branch.

  • Loading branch information...
1 parent 705a723 commit 62b5b17bf0adc126f83f4e7e02b95f2dc7337471 @jmatos jmatos committed with JamesKovacs Oct 3, 2009
@@ -1,13 +1,13 @@
-task default -depends Test
-
-task Test -depends Compile, Clean -PreAction {"Pre-Test"} -Action {
- "Test"
-} -PostAction {"Post-Test"}
-
-task Compile -depends Clean {
- "Compile"
-}
-
-task Clean {
- "Clean"
+task default -depends Test
+
+task Test -depends Compile, Clean -PreAction {"Pre-Test"} -Action {
+ "Test"
+} -PostAction {"Post-Test"}
+
+task Compile -depends Clean {
+ "Compile"
+}
+
+task Clean {
+ "Clean"
}
@@ -0,0 +1,36 @@
+properties {
+ $x = 1
+}
+
+FormatTaskName "[{0}]"
+
+task default -depends Verify
+
+task Verify -description "This task verifies psake's variables" {
+
+ #Verify the exported module variables
+ cd variable:
+ Assert (Test-Path "psake") "variable psake was not exported from module"
+
+ Assert ($psake.ContainsKey("build_success")) "psake variable does not contain 'build_success'"
+ Assert ($psake.ContainsKey("use_exit_on_error")) "psake variable does not contain 'use_exit_on_error'"
+ Assert ($psake.ContainsKey("log_error")) "psake variable does not contain 'log_error'"
+ Assert ($psake.ContainsKey("version")) "psake variable does not contain 'version'"
+ Assert ($psake.ContainsKey("build_script_file")) "psake variable does not contain 'build_script_file'"
+ Assert ($psake.ContainsKey("framework_version")) "psake variable does not contain 'framework_version'"
+
+ Assert (!$psake.build_success) 'psake.build_success should be $false'
+ Assert (!$psake.use_exit_on_error) 'psake.use_exit_on_error should be $false'
+ Assert (!$psake.log_error) 'psake.log_error should be $false'
+ Assert (![string]::IsNullOrEmpty($psake.version)) 'psake.version was null or empty'
+ Assert ($psake.build_script_file -ne $null) '$psake.build_script_file was null'
+ Assert ($psake.build_script_file.Name -eq "VerifyVariables.ps1") ("psake variable: {0} was not equal to 'VerifyVariables.ps1'" -f $psake.build_script_file.Name)
+ Assert (![string]::IsNullOrEmpty($psake.framework_version)) 'psake variable: $psake.framework_version was null or empty'
+
+ #Verify script-level variables
+ Assert ($tasks.Count -ne 0) 'psake variable: $tasks had length zero'
+ Assert ($properties.Count -ne 0) 'psake variable: $properties had length zero'
+ Assert ($includes.Count -eq 0) 'psake variable: $includes should have had length zero'
+ Assert ($formatTaskNameString -eq "[{0}]") 'psake variable: $formatTaskNameString was not set correctly'
+ Assert ($currentTaskName -eq "Verify") 'psake variable: $currentTaskName was not set correctly'
+}
@@ -1,11 +1,11 @@
-task default -depends Test
-
-task Test -depends Compile, Clean -PreAction {"Pre-Test"} -PostAction {"Post-Test"}
-
-task Compile -depends Clean {
- "Compile"
-}
-
-task Clean {
- "Clean"
+task default -depends Test
+
+task Test -depends Compile, Clean -PreAction {"Pre-Test"} -PostAction {"Post-Test"}
+
+task Compile -depends Clean {
+ "Compile"
+}
+
+task Clean {
+ "Clean"
}
@@ -1,5 +1,5 @@
-task default {
- "Starting to do stuff..."
- "Adding stuff... 1 + 1 =" + (1+1)
- "Stuff done!"
+task default {
+ "Starting to do stuff..."
+ "Adding stuff... 1 + 1 =" + (1+1)
+ "Stuff done!"
}
@@ -0,0 +1,5 @@
+task default -depends Test
+
+task Test -depends Compile, Clean {
+ Write-Host "Running PSake"
+}
@@ -1,13 +1,13 @@
-task default -depends A,B,C
-
-task A {
- "TaskA"
-}
-
-task B -postcondition { return $false } {
- "TaskB"
-}
-
-task C {
- "TaskC"
+task default -depends A,B,C
+
+task A {
+ "TaskA"
+}
+
+task B -postcondition { return $false } {
+ "TaskB"
+}
+
+task C {
+ "TaskC"
}
View
@@ -1,19 +1,19 @@
-properties {
- $testMessage = 'Executed Test!'
- $compileMessage = 'Executed Compile!'
- $cleanMessage = 'Executed Clean!'
-}
-
-task default -depends Test
-
-task Test -depends Compile, Clean {
- $testMessage
-}
-
-task Compile -depends Clean {
- $compileMessage
-}
-
-task Clean {
- $cleanMessage
+properties {
+ $testMessage = 'Executed Test!'
+ $compileMessage = 'Executed Compile!'
+ $cleanMessage = 'Executed Clean!'
+}
+
+task default -depends Test
+
+task Test -depends Compile, Clean {
+ $testMessage
+}
+
+task Compile -depends Clean {
+ $compileMessage
+}
+
+task Clean {
+ $cleanMessage
}
@@ -1,4 +1,4 @@
-task default -depends DisplayNotice
-task DisplayNotice {
- msbuild /version
+task default -depends DisplayNotice
+task DisplayNotice {
+ msbuild /version
}
@@ -1,6 +1,6 @@
-task default -depends doStuff
-task doStuff {
- "Starting to do stuff..."
- "Adding stuff... 1 + 1 =" + (1+1)
- "Stuff done!"
+task default -depends doStuff
+task doStuff {
+ "Starting to do stuff..."
+ "Adding stuff... 1 + 1 =" + (1+1)
+ "Stuff done!"
}
@@ -1,13 +1,13 @@
-task default -depends A,B,C
-
-task A {
- "TaskA"
-}
-
-task B -postcondition { return $true } {
- "TaskB"
-}
-
-task C {
- "TaskC"
+task default -depends A,B,C
+
+task A {
+ "TaskA"
+}
+
+task B -postcondition { return $true } {
+ "TaskB"
+}
+
+task C {
+ "TaskC"
}
@@ -1,13 +1,13 @@
-task default -depends A,B,C
-
-task A {
- "TaskA"
-}
-
-task B -precondition { return $false } {
- "TaskB"
-}
-
-task C -precondition { return $true } {
- "TaskC"
+task default -depends A,B,C
+
+task A {
+ "TaskA"
+}
+
+task B -precondition { return $false } {
+ "TaskB"
+}
+
+task C -precondition { return $true } {
+ "TaskC"
}
@@ -0,0 +1,17 @@
+TaskSetup {
+ "executing task setup"
+}
+
+Task default -depends Compile, Test, Deploy
+
+Task Compile {
+ "Compiling"
+}
+
+Task Test -depends Compile {
+ "Testing"
+}
+
+Task Deploy -depends Test {
+ "Deploying"
+}
@@ -1,4 +1,4 @@
-SakeBottle.jpg
-An American produced bottle of Ginjo Sake.
-Shawn Clark Lazyeights Photography http://lazyeights.net/cpg/displayimage.php?pos=-122
+SakeBottle.jpg
+An American produced bottle of Ginjo Sake.
+Shawn Clark Lazyeights Photography http://lazyeights.net/cpg/displayimage.php?pos=-122
This work is licensed under the Creative Commons Attribution 2.5 License (http://creativecommons.org/licenses/by/2.5/).
View
@@ -1,6 +1,6 @@
-.svn
-package
-images\.svn
-images\psake.pdn
-images\SakeBottle.jpg
+.svn
+package
+images\.svn
+images\psake.pdn
+images\SakeBottle.jpg
examples\.svn
View
@@ -1,3 +1,3 @@
-include 'psake_packager.ps1'
-
+include 'psake_packager.ps1'
+
task default -depends validate-psake,package-psake,deploy-psake
@@ -1,42 +1,42 @@
-task validate-psake -description 'Run example psake scripts to validate behavior' {
- trap {
- Set-Location 'package'
- throw;
- }
- Set-Location '..\'
- .\psake-buildTester.ps1
- Set-Location 'package'
-}
-
-task package-psake -description 'Packages all psake scripts, docs, and example scripts into a zip file' -depends update-psake-version {
- $version = (cat Version.inc)
- $zipFile = "psake v$version.zip"
-
- if (test-path $zipFile) {
- Remove-Item $zipFile
- }
-
- .\7za a "$zipFile" ..\ -r "-x@Excluded.txt"
-}
-
-task update-psake-version -description 'Updates version references in psake script' {
- $previousVersion = New-Object System.Version (cat Version.inc)
- $newVersion = New-Object System.Version $previousVersion.Major,($previousVersion.Minor+1)
-
- $first = $true
- $outputFile = '..\psake.ps1'
- foreach ($line in (cat ..\psake.ps1)) {
- $fileLine = [regex]::Replace($line, $previousVersion, $newVersion);
- if ($first) {
- $fileLine | Out-File $outputFile
- $first = $false
- } else {
- $fileLine | Out-File $outputFile -append
- }
- }
-
- $newVersion.ToString() | Out-File Version.inc
-}
-
-task deploy-psake -description 'Deploys to code.google.com/p/psake' {
+task validate-psake -description 'Run example psake scripts to validate behavior' {
+ trap {
+ Set-Location 'package'
+ throw;
+ }
+ Set-Location '..\'
+ .\psake-buildTester.ps1
+ Set-Location 'package'
+}
+
+task package-psake -description 'Packages all psake scripts, docs, and example scripts into a zip file' -depends update-psake-version {
+ $version = (cat Version.inc)
+ $zipFile = "psake v$version.zip"
+
+ if (test-path $zipFile) {
+ Remove-Item $zipFile
+ }
+
+ .\7za a "$zipFile" ..\ -r "-x@Excluded.txt"
+}
+
+task update-psake-version -description 'Updates version references in psake script' {
+ $previousVersion = New-Object System.Version (cat Version.inc)
+ $newVersion = New-Object System.Version $previousVersion.Major,($previousVersion.Minor+1)
+
+ $first = $true
+ $outputFile = '..\psake.ps1'
+ foreach ($line in (cat ..\psake.ps1)) {
+ $fileLine = [regex]::Replace($line, $previousVersion, $newVersion);
+ if ($first) {
+ $fileLine | Out-File $outputFile
+ $first = $false
+ } else {
+ $fileLine | Out-File $outputFile -append
+ }
+ }
+
+ $newVersion.ToString() | Out-File Version.inc
+}
+
+task deploy-psake -description 'Deploys to code.google.com/p/psake' {
}
Oops, something went wrong.

0 comments on commit 62b5b17

Please sign in to comment.