Skip to content

Commit

Permalink
Create a nuget package
Browse files Browse the repository at this point in the history
  • Loading branch information
haacked committed Oct 14, 2014
1 parent e268287 commit 9d79869
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 3 deletions.
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 2014</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
18 changes: 18 additions & 0 deletions packaging/LICENSE-MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Copyright (c) 2012 Phil Haack

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.
38 changes: 38 additions & 0 deletions packaging/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Rothko

We all know the .NET Framework APIs for dealing with the file system are not
designed with testability in mind. Also, I wasn't happy with the existing
libraries for providing an abstraction for such things. I wanted one that was:

* Modern - Included the `Enumerate*` methods for example.
* Interface based - Using Abstract base classes as the abstraction is blech.
* Easy to port to - So it had to follow the existing APIs closely.

Rothko is this library. It provides abstractions for:

* File system.
* Registry
* Environment.

The starting point for Rothko is the `OperatingSystemFacade` class. From there
you can get to the other abstractions.

* `IFileSystem`
* `IEnvironment`
* `IRegistry`

# Goals

The goal is to use this in GitHub for Windows as well as any other
applications where testability is important.

A secondary goal is to make it very easy to port code using the core .NET
Framework APIs to port over to Rothko. The interfaces map closely to the
.NET Framework's, except in a few places where I wouldn't be able to live with
myself if I didn't modernize the library. For example, I updated methods
that return arrays to return `IEnumerable` (or derived interface) instead.

Once these low level abstractions are implemented, I plan to add a set of
_Facade_ classes that provide a more usable API that we all wished had been
there all along. These _Facade_ classes will simply delegate to the
lower-level abstractions.
3 changes: 3 additions & 0 deletions packaging/ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### New in 0.0.1

* Initial alpha release
Binary file added packaging/Rothko.0.0.1-alpha.nupkg
Binary file not shown.
Binary file added packaging/lib/net45/rothko.dll
Binary file not shown.
25 changes: 24 additions & 1 deletion script/build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ let projectSummary = projectDescription // TODO: write a summary

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

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

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

open Fake.AssemblyInfoFile
Expand All @@ -44,6 +45,28 @@ Target "UnitTests" (fun _ ->
OutputDir = testResultsDir })
)

Target "CreatePackage" (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"
Expand Down

0 comments on commit 9d79869

Please sign in to comment.