Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Simplify nuget package creation.

  • Loading branch information...
commit 0800f8aeab940a20d44e1f9e5f972c84b56efb62 1 parent 86d5414
@plioi authored
View
59 default.ps1
@@ -1,21 +1,25 @@
Framework '4.0'
properties {
- $project = 'Parsley'
+ $project = "Parsley"
$birthYear = 2011
$maintainers = "Patrick Lioi"
+ $description = "A monadic parser combinator library inspired by Haskell's Parsec library."
$configuration = 'Release'
$src = resolve-path '.\src'
$build = if ($env:build_number -ne $NULL) { $env:build_number } else { '0' }
$version = [IO.File]::ReadAllText('.\VERSION.txt') + '.' + $build
-
- $basedir = resolve-path '.\'
- $package_dir = "$basedir\package"
}
task default -depends Test
+task Package -depends Test {
+ rd .\package -recurse -force -ErrorAction SilentlyContinue | out-null
+ mkdir .\package -ErrorAction SilentlyContinue | out-null
+ exec { & $src\.nuget\NuGet.exe pack $src\$project\$project.csproj -Symbols -Prop Configuration=$configuration -OutputDirectory .\package }
+}
+
task Test -depends Compile {
$xunitRunner = join-path $src "packages\xunit.runners.1.9.1\tools\xunit.console.clr4.exe"
exec { & $xunitRunner $src\$project.Test\bin\$configuration\$project.Test.dll }
@@ -40,50 +44,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyVersion(""$version"")]
[assembly: AssemblyFileVersion(""$version"")]
[assembly: AssemblyCopyright(""$copyright"")]
+[assembly: AssemblyCompany(""$maintainers"")]
+[assembly: AssemblyDescription(""$description"")]
[assembly: AssemblyConfiguration(""$configuration"")]" | out-file "$src\CommonAssemblyInfo.cs" -encoding "ASCII"
-}
-
-task Package -depends Test {
- delete_directory $package_dir
- copy_files "$src\$project\bin\$configuration\" $package_dir
-
- $nuspec_file = "$package_dir\$project.nuspec"
- create-nuspec "$version" "$nuspec_file"
- exec { & $src\.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-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=""$src\**\*.cs"" target=""src"" />
- </files>
-</package>" | out-file $filename -encoding "ASCII"
}
View
2  src/CommonAssemblyInfo.cs
@@ -6,4 +6,6 @@
[assembly: AssemblyVersion("0.0.5.0")]
[assembly: AssemblyFileVersion("0.0.5.0")]
[assembly: AssemblyCopyright("Copyright (c) 2011-2013 Patrick Lioi")]
+[assembly: AssemblyCompany("Patrick Lioi")]
+[assembly: AssemblyDescription("A monadic parser combinator library inspired by Haskell's Parsec library.")]
[assembly: AssemblyConfiguration("Release")]
View
3  src/Parsley/Parsley.csproj
@@ -71,6 +71,9 @@
<Compile Include="TokenKind.cs" />
<Compile Include="Value.cs" />
</ItemGroup>
+ <ItemGroup>
+ <None Include="Parsley.nuspec" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
View
15 src/Parsley/Parsley.nuspec
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<package>
+ <metadata>
+ <id>$id$</id>
+ <version>$version$</version>
+ <title>$title$</title>
+ <authors>$author$</authors>
+ <owners>$author$</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>
+ <description>$description$</description>
+ </metadata>
+</package>
Please sign in to comment.
Something went wrong with that request. Please try again.