Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added psake-based build script for packing and pushing NuGet package

  • Loading branch information...
commit 1b5650041865c442adebba53e6cebe747854c040 1 parent b620a13
Tim Jones tgjones authored
0  build/NuGet/DotLiquid.nuspec → build/DotLiquid.nuspec
View
File renamed without changes
0  build/NuGet/LICENSE.txt → build/LICENSE.txt
View
File renamed without changes
BIN  build/MSBuildCommunityTasks/ICSharpCode.SharpZipLib.dll
View
Binary file not shown
104 build/MSBuildCommunityTasks/MSBuild.Community.Tasks.Targets
View
@@ -1,104 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <!-- $Id: MSBuild.Community.Tasks.Targets 303 2007-02-23 15:49:46Z pwelter34 $ -->
-
- <PropertyGroup>
- <MSBuildCommunityTasksPath Condition="'$(MSBuildCommunityTasksPath)' == ''">$(MSBuildExtensionsPath)\MSBuildCommunityTasks</MSBuildCommunityTasksPath>
- <MSBuildCommunityTasksLib>$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.dll</MSBuildCommunityTasksLib>
- </PropertyGroup>
-
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.AspNet.InstallAspNet" />
-
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.AssemblyInfo" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Attrib" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SqlExecute" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.FileUpdate" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.FtpUpload" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.FxCop" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.GacUtil" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.GetSolutionProjects" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.ILMerge" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Mail" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Move" />
-
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Math.Add" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Math.Divide" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Math.Modulo" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Math.Multiple" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Math.Subtract" />
-
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.NDoc" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.NUnit" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Prompt" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.RegistryRead" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.RegistryWrite" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.RegexMatch" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.RegexReplace" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Script" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.ServiceController" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.ServiceQuery" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Sleep" />
-
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.IIS.AppPoolController" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.IIS.AppPoolCreate" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.IIS.AppPoolDelete" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.IIS.WebDirectoryCreate" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.IIS.WebDirectoryDelete" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.IIS.WebDirectoryScriptMap" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.IIS.WebDirectorySetting" />
-
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Install.InstallAssembly" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Install.UninstallAssembly" />
-
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Schema.TaskSchema" />
-
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SqlServer.ExecuteDDL" />
-
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssAdd" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssCheckin" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssCheckout" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssClean" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssDiff" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssGet" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssHistory" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssLabel" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.SourceSafe.VssUndoCheckout" />
-
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Subversion.SvnCheckout" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Subversion.SvnClient" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Subversion.SvnCopy" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Subversion.SvnCommit" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Subversion.SvnExport" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Subversion.SvnInfo" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Subversion.SvnUpdate" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Subversion.SvnVersion" />
-
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Tfs.TfsVersion" />
-
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.TemplateFile" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Time" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Unzip" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Version" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.WebDownload" />
-
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Xml.XmlMassUpdate" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Xml.XmlQuery" />
-
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.XmlRead" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.XmlUpdate" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Xslt" />
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.Zip" />
-
- <UsingTask AssemblyFile="$(MSBuildCommunityTasksLib)" TaskName="MSBuild.Community.Tasks.JavaScript.JSCompress" />
-
- <ItemGroup>
- <FxCopRuleAssemblies Include="UsageRules.dll"/>
- <FxCopRuleAssemblies Include="SecurityRules.dll"/>
- <FxCopRuleAssemblies Include="PortabilityRules.dll"/>
- <FxCopRuleAssemblies Include="PerformanceRules.dll"/>
- <FxCopRuleAssemblies Include="MobilityRules.dll"/>
- <FxCopRuleAssemblies Include="InteroperabilityRules.dll"/>
- <FxCopRuleAssemblies Include="GlobalizationRules.dll"/>
- <FxCopRuleAssemblies Include="DesignRules.dll"/>
- </ItemGroup>
-</Project>
BIN  build/MSBuildCommunityTasks/MSBuild.Community.Tasks.dll
View
Binary file not shown
6,506 build/MSBuildCommunityTasks/MSBuild.Community.Tasks.xml
View
0 additions, 6,506 deletions not shown
BIN  build/TeamCityBuild.msbuild
View
Binary file not shown
5 build/compile.ps1
View
@@ -0,0 +1,5 @@
+task Default -depends Compile
+
+task Compile {
+ exec { msbuild /t:Clean /t:Build /p:Configuration=$config /v:q /nologo $source_dir\$solution_file }
+}
53 build/package.ps1
View
@@ -0,0 +1,53 @@
+properties {
+ $nuget_dir = "$base_dir\src\packages\NuGet.CommandLine.1.5.21005.9019\tools"
+}
+
+task Default -depends Package
+
+task Package {
+ create_directory "$package_dir"
+
+ # Copy NuSpec template files to package dir
+ cp "$build_dir\DotLiquid.nuspec" "$package_dir"
+ cp "$build_dir\LICENSE.txt" "$package_dir"
+
+ # Copy binary files to package dir
+ copy_files "$source_dir\DotLiquid\bin\$config-3.5" "$package_dir\lib\NET35" "*.dll","*.pdb"
+ copy_files "$source_dir\DotLiquid\bin\$config" "$package_dir\lib\NET40" "*.dll","*.pdb"
+
+ # Copy source files to package dir
+ copy_files "$source_dir\DotLiquid" "$package_dir\src\DotLiquid" "*.cs"
+
+ $version = "1.6.2"
+
+ # Build the NuGet package
+ exec { & $nuget_dir\NuGet.exe pack -Symbols -Version "$version" -OutputDirectory "$package_dir" "$package_dir\DotLiquid.nuspec" }
+
+ # Push NuGet package to nuget.org
+ exec { & $nuget_dir\NuGet.exe push "$package_dir\DotLiquid.$version.nupkg" }
+}
+
+# Helper functions
+
+function global:create_directory($directory_name)
+{
+ mkdir $directory_name -ErrorAction SilentlyContinue | out-null
+}
+
+function global:copy_files($source, $destination, $include = @(), $exclude = @()) {
+ create_directory $destination
+
+ $items = Get-ChildItem $source -Recurse -Include $include -Exclude $exclude
+ foreach ($item in $items) {
+ $dir = $item.DirectoryName.Replace($source,$destination)
+ $target = $item.FullName.Replace($source,$destination)
+
+ if (!(test-path($dir))) {
+ create_directory $dir
+ }
+
+ if (!(test-path($target))) {
+ cp -path $item.FullName -destination $target
+ }
+ }
+}
9 build/test.ps1
View
@@ -0,0 +1,9 @@
+properties {
+ $nunit_dir = "$base_dir\src\packages\NUnit.2.5.10.11092\tools"
+}
+
+task Default -depends Test
+
+task Test {
+ exec { & $nunit_dir\nunit-console-x86.exe $source_dir/DotLiquid.Tests/$bin_folder/DotLiquid.Tests.dll /nologo /nodots /xml=$source_dir/DotLiquid.Tests/$bin_folder/DotLiquid.Tests.TestResults.xml }
+}
36 default.ps1
View
@@ -0,0 +1,36 @@
+# Thanks to AutoMapper for the inspiration for this build file.
+
+$global:config = 'Release'
+
+properties {
+ $base_dir = resolve-path .
+ $source_dir = "$base_dir\src"
+ $build_dir = "$base_dir\build"
+ $package_dir = "$base_dir\package"
+}
+
+task Default -depends Clean, Compile, Test, Package
+
+task Clean {
+ delete_directory "$package_dir"
+}
+
+task Compile -depends Clean {
+ Invoke-Psake "$build_dir\compile.ps1" -framework 3.5 -parameters @{"solution_file"="DotLiquid-2008.sln"}
+ Invoke-Psake "$build_dir\compile.ps1" -framework 4.0 -parameters @{"solution_file"="DotLiquid.sln"}
+}
+
+task Test -depends Compile {
+ Invoke-Psake "$build_dir\test.ps1" -framework 3.5 -parameters @{"bin_folder"="bin/$config-3.5"}
+ Invoke-Psake "$build_dir\test.ps1" -framework 4.0 -parameters @{"bin_folder"="bin/$config"}
+}
+
+task Package {
+ Invoke-Psake "$build_dir\package.ps1" -framework 4.0
+}
+
+# Helper functions
+
+function global:delete_directory($directory_name) {
+ rd $directory_name -recurse -force -ErrorAction SilentlyContinue | out-null
+}
1  psake.bat
View
@@ -0,0 +1 @@
+powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "& {Import-Module '.\src\packages\psake.4.0.1.0\tools\psake.psm1'; invoke-psake .\default.ps1 %*; if ($lastexitcode -ne 0) {write-host "ERROR: $lastexitcode" -fore RED; exit $lastexitcode} }"
Please sign in to comment.
Something went wrong with that request. Please try again.