Skip to content

Commit

Permalink
Creating NuGet packages as part of the build
Browse files Browse the repository at this point in the history
Changing the build to use semantic versioning
  • Loading branch information
jbogard committed Jul 3, 2011
1 parent 0c8ba33 commit 7545783
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 322 deletions.
7 changes: 7 additions & 0 deletions LICENSE.txt
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2010 Jimmy Bogard

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
55 changes: 54 additions & 1 deletion default.ps1
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,5 @@
$framework = '4.0' $framework = '4.0'
$version = '2.0.0'


properties { properties {
$base_dir = resolve-path . $base_dir = resolve-path .
Expand All @@ -9,7 +10,7 @@ properties {
$test_dir = "$build_dir\test" $test_dir = "$build_dir\test"
$result_dir = "$build_dir\results" $result_dir = "$build_dir\results"
$lib_dir = "$base_dir\lib" $lib_dir = "$base_dir\lib"
$buildNumber = if ($env:build_number -ne $NULL) { $env:build_number } else { '2.0.9999.0' } $buildNumber = if ($env:build_number -ne $NULL) { $version + '.' + $env:build_number } else { $version + '.0' }
$config = "debug" $config = "debug"
$framework_dir = Get-FrameworkDirectory $framework_dir = Get-FrameworkDirectory
} }
Expand Down Expand Up @@ -52,6 +53,13 @@ task dist {
copy_files "$build_dir\$config\AutoMapper" "$build_dir\dist" $exclude copy_files "$build_dir\$config\AutoMapper" "$build_dir\dist" $exclude
zip_directory "$build_dir\dist" "$dist_dir\AutoMapper-unmerged.zip" zip_directory "$build_dir\dist" "$dist_dir\AutoMapper-unmerged.zip"
copy-item "$build_dir\dist-merged\AutoMapper.dll" "$dist_dir" copy-item "$build_dir\dist-merged\AutoMapper.dll" "$dist_dir"
create-merged-nuspec "$buildNumber"
create-unmerged-nuspec "$buildNumber"

exec { & $tools_dir\NuGet.exe pack $build_dir\AutoMapper.nuspec }
exec { & $tools_dir\NuGet.exe pack $build_dir\AutoMapper.UnMerged.nuspec }

move-item "*.nupkg" "$dist_dir"
} }


# ------------------------------------------------------------------------------------------------------------- # -------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -122,4 +130,49 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompanyAttribute("""")] [assembly: AssemblyCompanyAttribute("""")]
[assembly: AssemblyConfigurationAttribute(""release"")] [assembly: AssemblyConfigurationAttribute(""release"")]
[assembly: AssemblyInformationalVersionAttribute(""$version"")]" | out-file $filename -encoding "ASCII" [assembly: AssemblyInformationalVersionAttribute(""$version"")]" | out-file $filename -encoding "ASCII"
}

function global:create-merged-nuspec()
{
"<?xml version=""1.0""?>
<package xmlns=""http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"">
<metadata>
<id>AutoMapper</id>
<version>$version</version>
<authors>Jimmy Bogard</authors>
<owners>Jimmy Bogard</owners>
<licenseUrl>http://automapper.codeplex.com/license</licenseUrl>
<projectUrl>http://automapper.codeplex.com</projectUrl>
<iconUrl>https://s3.amazonaws.com/automapper/icon.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A convention-based object-object mapper. AutoMapper uses a fluent configuration API to define an object-object mapping strategy. AutoMapper uses a convention-based matching algorithm to match up source to destination values. Currently, AutoMapper is geared towards model projection scenarios to flatten complex object models to DTOs and other simple objects, whose design is better suited for serialization, communication, messaging, or simply an anti-corruption layer between the domain and application layer.</description>
</metadata>
<files>
<file src=""$build_dir\dist-merged\AutoMapper.dll"" target=""lib"" />
</files>
</package>" | out-file $build_dir\AutoMapper.nuspec -encoding "ASCII"
}

function global:create-unmerged-nuspec()
{
"<?xml version=""1.0""?>
<package xmlns=""http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"">
<metadata>
<id>AutoMapper.UnMerged</id>
<version>$version</version>
<authors>Jimmy Bogard</authors>
<owners>Jimmy Bogard</owners>
<licenseUrl>http://automapper.codeplex.com/license</licenseUrl>
<projectUrl>http://automapper.codeplex.com</projectUrl>
<iconUrl>https://s3.amazonaws.com/automapper/icon.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A convention-based object-object mapper. AutoMapper uses a fluent configuration API to define an object-object mapping strategy. AutoMapper uses a convention-based matching algorithm to match up source to destination values. Currently, AutoMapper is geared towards model projection scenarios to flatten complex object models to DTOs and other simple objects, whose design is better suited for serialization, communication, messaging, or simply an anti-corruption layer between the domain and application layer.</description>
<dependencies>
<dependency id=""Castle.Core"" version=""2.5.1"" />
</dependencies>
</metadata>
<files>
<file src=""$build_dir\dist\AutoMapper.dll"" target=""lib"" />
</files>
</package>" | out-file $build_dir\AutoMapper.UnMerged.nuspec -encoding "ASCII"
} }
59 changes: 0 additions & 59 deletions src/AutoMapper.3.5.sln

This file was deleted.

10 changes: 5 additions & 5 deletions src/CommonAssemblyInfo.cs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------


[assembly: ComVisibleAttribute(false)] [assembly: ComVisibleAttribute(false)]
[assembly: AssemblyVersionAttribute("2.0.9999.0")] [assembly: AssemblyVersionAttribute("2.0.0.0")]
[assembly: AssemblyFileVersionAttribute("2.0.9999.0")] [assembly: AssemblyFileVersionAttribute("2.0.0.0")]
[assembly: AssemblyCopyrightAttribute("Copyright Jimmy Bogard 2008-2010")] [assembly: AssemblyCopyrightAttribute("Copyright Jimmy Bogard 2008-2011")]
[assembly: AssemblyProductAttribute("AutoMapper")] [assembly: AssemblyProductAttribute("AutoMapper")]
[assembly: AssemblyTrademarkAttribute("8aa331f7b0a98312ce7630a40ffad732db8771ed")] [assembly: AssemblyTrademarkAttribute("f56f10a7a68ca2b8e55de85a11dfc40d19cec928")]
[assembly: AssemblyCompanyAttribute("")] [assembly: AssemblyCompanyAttribute("")]
[assembly: AssemblyConfigurationAttribute("release")] [assembly: AssemblyConfigurationAttribute("release")]
[assembly: AssemblyInformationalVersionAttribute("2.0.9999.0")] [assembly: AssemblyInformationalVersionAttribute("2.0.0.0")]
Loading

0 comments on commit 7545783

Please sign in to comment.