Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 53fb91e003
Fetching contributors…

Cannot retrieve contributors at this time

110 lines (93 sloc) 4.006 kb
properties {
$projectConfig = "Release"
$base_dir = resolve-path .\
$source_dir = "$base_dir\src"
$build_dir = "$base_dir\build"
$test_dir = "$base_dir\src\Parsley.Test\bin\$projectConfig"
$package_dir = "$base_dir\package"
$defaultVersion = "0.0.3"
if(-not $version)
{
$version = $defaultVersion
}
$buildNumber = $version + '.0'
}
$framework = '4.0'
FormatTaskName "------------------------------
-- {0}
------------------------------"
task default -depends Compile, Test, Package
task Init {
delete_directory $build_dir
}
task CommonAssemblyInfo {
create-commonAssemblyInfo "$buildNumber" "$source_dir\CommonAssemblyInfo.cs"
}
task Compile -depends Init, CommonAssemblyInfo {
msbuild /t:clean /v:q /nologo /p:Configuration=$projectConfig $source_dir\Parsley.sln
msbuild /t:build /v:q /nologo /p:Configuration=$projectConfig $source_dir\Parsley.sln
}
task Test -depends Compile {
exec { & $base_dir\tools\xunit.runners.1.9.0.1566\xunit.console.clr4.exe "$test_dir\Parsley.Test.dll" }
}
task Package -depends Compile {
delete_directory $package_dir
copy_files "$source_dir\Parsley\bin\$projectConfig\" $package_dir
$nuspec_file = "$package_dir\Parsley.nuspec"
create-nuspec "$version" "$nuspec_file"
exec { & $source_dir\.nuget\NuGet.exe pack $nuspec_file -Symbols -OutputDirectory $package_dir }
}
function global:copy_files($source,$destination,$exclude=@()) {
create_directory $destination
Get-ChildItem $source -Recurse -Exclude $exclude | Copy-Item -Destination {Join-Path $destination $_.FullName.Substring($source.length)}
}
function global:delete_directory($directory_name) {
rd $directory_name -recurse -force -ErrorAction SilentlyContinue | out-null
}
function global:create_directory($directory_name) {
mkdir $directory_name -ErrorAction SilentlyContinue | out-null
}
function global:create-commonAssemblyInfo($buildNumber,$filename) {
$date = Get-Date
"using System;
using System.Reflection;
using System.Runtime.InteropServices;
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: ComVisible(false)]
[assembly: AssemblyVersion(""$buildNumber"")]
[assembly: AssemblyFileVersion(""$buildNumber"")]
[assembly: AssemblyCopyright(""Copyright Patrick Lioi 2011-" + $date.Year + """)]
[assembly: AssemblyProduct(""Parsley"")]
[assembly: AssemblyConfiguration(""release"")]
[assembly: AssemblyInformationalVersion(""$buildNumber"")]" | out-file $filename -encoding "ASCII"
}
function global:create-nuspec($version,$filename) {
"<?xml version=""1.0""?>
<package xmlns=""http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"">
<metadata>
<id>Parsley</id>
<version>$version</version>
<authors>Patrick Lioi</authors>
<owners>Patrick Lioi</owners>
<licenseUrl>https://github.com/plioi/parsley/blob/master/LICENSE.txt</licenseUrl>
<projectUrl>https://github.com/plioi/parsley</projectUrl>
<iconUrl>https://github.com/plioi/parsley/raw/master/parsley.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<summary>A text parsing library.</summary>
<description>Parsley is a monadic parser combinator library inspired by Haskell's Parsec library. It can parse context-sensitive, infinite look-ahead grammars but it performs best on predictive LL[1] grammars.</description>
</metadata>
<files>
<file src=""$package_dir\*.dll"" target=""lib\net40"" />
<file src=""$package_dir\*.pdb"" target=""lib\net40"" />
<file src=""$source_dir\**\*.cs"" target=""src"" />
</files>
</package>" | out-file $filename -encoding "ASCII"
}
Jump to Line
Something went wrong with that request. Please try again.