Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare NuGet package creation #33

Merged
merged 1 commit into from
Apr 17, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ local.properties

## TODO: If you have NuGet Package Restore enabled, uncomment this
packages/
# output folder for building NuGet packages
packaging/

# Visual C++ cache files
ipch/
Expand Down
2 changes: 1 addition & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
### New in 0.0.1

* Initial release
* Initial alpha release
18 changes: 18 additions & 0 deletions Rothko.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>@project@</id>
<version>@build.number@</version>
<authors>@authors@</authors>
<owners>@authors@</owners>
<summary>@summary@</summary>
<licenseUrl>https://github.com/haacked/rothko/blob/master/LICENSE.txt</licenseUrl>
<projectUrl>https://github.com/haacked/rothko</projectUrl>
<iconUrl>https://cloud.githubusercontent.com/assets/19977/4635932/4483417a-53de-11e4-8aad-7f06b2d3c46a.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>@description@</description>
<releaseNotes>@releaseNotes@</releaseNotes>
<copyright>Copyright Phil Haack 2015</copyright>
<tags>dotnet abstractions</tags>
</metadata>
</package>
4 changes: 3 additions & 1 deletion Rothko.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rothko", "src\Rothko.csproj", "{4A84E568-CA86-4510-8CD0-90D3EF9B65F9}"
EndProject
Expand All @@ -10,6 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Meta", "Meta", "{1F038D9F-9
CodeAnalysisDictionary.xml = CodeAnalysisDictionary.xml
LICENSE-MIT.txt = LICENSE-MIT.txt
README.md = README.md
ReleaseNotes.md = ReleaseNotes.md
Rothko.ruleset = Rothko.ruleset
EndProjectSection
EndProject
Expand All @@ -19,6 +20,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{2DC1E33B
ProjectSection(SolutionItems) = preProject
script\build.cmd = script\build.cmd
script\build.fsx = script\build.fsx
Rothko.nuspec = Rothko.nuspec
EndProjectSection
EndProject
Global
Expand Down
28 changes: 26 additions & 2 deletions script/build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ let projectSummary = projectDescription // TODO: write a summary

// directories
let buildDir = "./src/bin"
let packagingDir = "./packaging/"
let testResultsDir = "./testresults"

RestorePackages()
Expand All @@ -20,13 +21,13 @@ let releaseNotes =
|> ReleaseNotesHelper.parseReleaseNotes

Target "Clean" (fun _ ->
CleanDirs [buildDir; testResultsDir]
CleanDirs [buildDir; packagingDir; testResultsDir]
)

open Fake.AssemblyInfoFile

Target "AssemblyInfo" (fun _ ->
CreateCSharpAssemblyInfo ".\SolutionInfo.cs"
CreateCSharpAssemblyInfo "./SolutionInfo.cs"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked like most other paths in the script were using / over \ so I just changed this for that reason.

[ Attribute.Product projectName
Attribute.Version releaseNotes.AssemblyVersion
Attribute.FileVersion releaseNotes.AssemblyVersion]
Expand All @@ -45,12 +46,35 @@ Target "UnitTests" (fun _ ->
OutputDir = testResultsDir })
)

Target "Package" (fun _ ->
let net45Dir = packagingDir @@ "lib/net45/"
CleanDirs [net45Dir]

CopyFile net45Dir (buildDir @@ "Release/rothko.dll")
CopyFiles packagingDir ["LICENSE-MIT.txt"; "README.md"; "ReleaseNotes.md"]

NuGet (fun p ->
{p with
Authors = authors
Project = projectName
Description = projectDescription
OutputPath = packagingDir
Summary = projectSummary
WorkingDir = packagingDir
Version = releaseNotes.AssemblyVersion
ReleaseNotes = toLines releaseNotes.Notes
AccessKey = getBuildParamOrDefault "nugetkey" ""
Publish = hasBuildParam "nugetkey" }) "Rothko.nuspec"
)


Target "Default" DoNothing

"Clean"
==> "AssemblyInfo"
==> "BuildApp"
==> "UnitTests"
==> "Default"
==> "Package"

RunTargetOrDefault "Default"