Permalink
Browse files

Creating NuGet packages as part of the build

Changing the build to use semantic versioning
  • Loading branch information...
1 parent 0c8ba33 commit 75457834ed67c2f042c7e3e2a05d87da04b5aa28 @jbogard jbogard committed Jul 3, 2011
Showing with 66 additions and 322 deletions.
  1. +7 −0 LICENSE.txt
  2. +54 −1 default.ps1
  3. +0 −59 src/AutoMapper.3.5.sln
  4. +5 −5 src/CommonAssemblyInfo.cs
  5. +0 −257 template.ps1
  6. BIN tools/NuGet.exe
View
@@ -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.
View
@@ -1,4 +1,5 @@
$framework = '4.0'
+$version = '2.0.0'
properties {
$base_dir = resolve-path .
@@ -9,7 +10,7 @@ properties {
$test_dir = "$build_dir\test"
$result_dir = "$build_dir\results"
$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"
$framework_dir = Get-FrameworkDirectory
}
@@ -52,6 +53,13 @@ task dist {
copy_files "$build_dir\$config\AutoMapper" "$build_dir\dist" $exclude
zip_directory "$build_dir\dist" "$dist_dir\AutoMapper-unmerged.zip"
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"
}
# -------------------------------------------------------------------------------------------------------------
@@ -122,4 +130,49 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCompanyAttribute("""")]
[assembly: AssemblyConfigurationAttribute(""release"")]
[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"
}
@@ -1,59 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual Studio 2008
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests", "UnitTests\UnitTests.csproj", "{002075C5-6517-4794-BC99-9B17B9E884E7}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0691ABF2-B3C7-43BF-9862-2D8D1299CE58}"
- ProjectSection(SolutionItems) = preProject
- ..\.gitignore = ..\.gitignore
- ..\AutoMapper.build = ..\AutoMapper.build
- ..\AutoMapper.exclude = ..\AutoMapper.exclude
- ..\default.ps1 = ..\default.ps1
- ..\go.bat = ..\go.bat
- ..\template.ps1 = ..\template.ps1
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoMapper", "AutoMapper\AutoMapper.csproj", "{DDF551F9-B27D-4283-BFA0-E7068E05967D}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoMapperSamples", "AutoMapperSamples\AutoMapperSamples.csproj", "{277C689D-B1C1-43EA-B20D-C1155C4B2EA7}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmark", "Benchmark\Benchmark.csproj", "{B8051389-CB47-46FB-B234-9D49506704AA}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- AutomatedDebug|Any CPU = AutomatedDebug|Any CPU
- AutomatedRelease|Any CPU = AutomatedRelease|Any CPU
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {002075C5-6517-4794-BC99-9B17B9E884E7}.AutomatedDebug|Any CPU.ActiveCfg = AutomatedDebug|Any CPU
- {002075C5-6517-4794-BC99-9B17B9E884E7}.AutomatedDebug|Any CPU.Build.0 = AutomatedDebug|Any CPU
- {002075C5-6517-4794-BC99-9B17B9E884E7}.AutomatedRelease|Any CPU.ActiveCfg = AutomatedRelease|Any CPU
- {002075C5-6517-4794-BC99-9B17B9E884E7}.AutomatedRelease|Any CPU.Build.0 = AutomatedRelease|Any CPU
- {002075C5-6517-4794-BC99-9B17B9E884E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {002075C5-6517-4794-BC99-9B17B9E884E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {002075C5-6517-4794-BC99-9B17B9E884E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {002075C5-6517-4794-BC99-9B17B9E884E7}.Release|Any CPU.Build.0 = Release|Any CPU
- {DDF551F9-B27D-4283-BFA0-E7068E05967D}.AutomatedDebug|Any CPU.ActiveCfg = AutomatedDebug|Any CPU
- {DDF551F9-B27D-4283-BFA0-E7068E05967D}.AutomatedDebug|Any CPU.Build.0 = AutomatedDebug|Any CPU
- {DDF551F9-B27D-4283-BFA0-E7068E05967D}.AutomatedRelease|Any CPU.ActiveCfg = AutomatedRelease|Any CPU
- {DDF551F9-B27D-4283-BFA0-E7068E05967D}.AutomatedRelease|Any CPU.Build.0 = AutomatedRelease|Any CPU
- {DDF551F9-B27D-4283-BFA0-E7068E05967D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DDF551F9-B27D-4283-BFA0-E7068E05967D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DDF551F9-B27D-4283-BFA0-E7068E05967D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DDF551F9-B27D-4283-BFA0-E7068E05967D}.Release|Any CPU.Build.0 = Release|Any CPU
- {277C689D-B1C1-43EA-B20D-C1155C4B2EA7}.AutomatedDebug|Any CPU.ActiveCfg = Debug|Any CPU
- {277C689D-B1C1-43EA-B20D-C1155C4B2EA7}.AutomatedRelease|Any CPU.ActiveCfg = Release|Any CPU
- {277C689D-B1C1-43EA-B20D-C1155C4B2EA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {277C689D-B1C1-43EA-B20D-C1155C4B2EA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {277C689D-B1C1-43EA-B20D-C1155C4B2EA7}.Release|Any CPU.Build.0 = Release|Any CPU
- {B8051389-CB47-46FB-B234-9D49506704AA}.AutomatedDebug|Any CPU.ActiveCfg = Debug|Any CPU
- {B8051389-CB47-46FB-B234-9D49506704AA}.AutomatedRelease|Any CPU.ActiveCfg = Release|Any CPU
- {B8051389-CB47-46FB-B234-9D49506704AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B8051389-CB47-46FB-B234-9D49506704AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B8051389-CB47-46FB-B234-9D49506704AA}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
@@ -13,11 +13,11 @@
//------------------------------------------------------------------------------
[assembly: ComVisibleAttribute(false)]
-[assembly: AssemblyVersionAttribute("2.0.9999.0")]
-[assembly: AssemblyFileVersionAttribute("2.0.9999.0")]
-[assembly: AssemblyCopyrightAttribute("Copyright Jimmy Bogard 2008-2010")]
+[assembly: AssemblyVersionAttribute("2.0.0.0")]
+[assembly: AssemblyFileVersionAttribute("2.0.0.0")]
+[assembly: AssemblyCopyrightAttribute("Copyright Jimmy Bogard 2008-2011")]
[assembly: AssemblyProductAttribute("AutoMapper")]
-[assembly: AssemblyTrademarkAttribute("8aa331f7b0a98312ce7630a40ffad732db8771ed")]
+[assembly: AssemblyTrademarkAttribute("f56f10a7a68ca2b8e55de85a11dfc40d19cec928")]
[assembly: AssemblyCompanyAttribute("")]
[assembly: AssemblyConfigurationAttribute("release")]
-[assembly: AssemblyInformationalVersionAttribute("2.0.9999.0")]
+[assembly: AssemblyInformationalVersionAttribute("2.0.0.0")]
Oops, something went wrong.

0 comments on commit 7545783

Please sign in to comment.