Skip to content

Commit

Permalink
Merge pull request #1 from editor-tools/ghfvs-package
Browse files Browse the repository at this point in the history
Packaging Rothko
  • Loading branch information
shana committed Nov 15, 2017
2 parents ff23501 + 8ed259c commit 3dfd53f
Show file tree
Hide file tree
Showing 409 changed files with 151,164 additions and 6,966 deletions.
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
74 changes: 74 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at haacked@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
6 changes: 5 additions & 1 deletion ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### New in 0.0.2

* Signing key for GHfVS

### 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/editor-tools/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
6 changes: 3 additions & 3 deletions SolutionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using System.Reflection;

[assembly: AssemblyProductAttribute("Rothko")]
[assembly: AssemblyVersionAttribute("0.0.1")]
[assembly: AssemblyFileVersionAttribute("0.0.1")]
[assembly: AssemblyVersionAttribute("0.0.2")]
[assembly: AssemblyFileVersionAttribute("0.0.2")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "0.0.1";
internal const string Version = "0.0.2";
}
}
28 changes: 28 additions & 0 deletions Tests/DirectoryInfoTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System.IO;
using Xunit;
using DirectoryInfo = Rothko.DirectoryInfo;

public class DirectoryInfoTests
{
public class TheCreateMethod
{
[Fact]
public void CreatesMissingParentDirectories()
{
using (var tempDir = DisposableDirectory.CreateRandomDirectory())
{
var path = Path.Combine(tempDir.FullPath, "foo", "bar", "baz");
var directory = new DirectoryInfo(path);
Assert.False(Directory.Exists(Path.Combine(tempDir.FullPath, "foo")));
Assert.False(Directory.Exists(Path.Combine(tempDir.FullPath, "foo", "bar")));
Assert.False(Directory.Exists(path));

directory.Create();

Assert.True(Directory.Exists(Path.Combine(tempDir.FullPath, "foo")));
Assert.True(Directory.Exists(Path.Combine(tempDir.FullPath, "foo", "bar")));
Assert.True(Directory.Exists(path));
}
}
}
}
34 changes: 34 additions & 0 deletions Tests/Helpers/DisposableDirectory.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using System;
using System.IO;

public sealed class DisposableDirectory : IDisposable
{
readonly DirectoryInfo directory;

public static DisposableDirectory CreateRandomDirectory()
{
return CreateDirectory(GetRandomRothkoTemporaryFolder());
}

public static DisposableDirectory CreateDirectory(string path)
{
return new DisposableDirectory(new DirectoryInfo(path));
}

DisposableDirectory(DirectoryInfo directory)
{
this.directory = directory;
}

public string FullPath { get { return directory.FullName; } }

public void Dispose()
{
directory.Delete(true);
}

static string GetRandomRothkoTemporaryFolder()
{
return Path.Combine(Path.GetTempPath(), "__RothkoTestFolder-REMOVE-ME", Path.GetRandomFileName());
}
}
2 changes: 0 additions & 2 deletions Tests/NullGuardTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ public void CheckOSVersionImplementation()
{
var environment = new Environment();

Assert.NotNull(environment.OSVersion.Edition);
Assert.NotNull(environment.OSVersion.Name);
Assert.True(environment.OSVersion.ToString().Length > 7);
}
}
Expand Down
26 changes: 16 additions & 10 deletions Tests/Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" />
<Import Project="..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand All @@ -14,7 +14,7 @@
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>3e89ca51</NuGetPackageImportStamp>
<NuGetPackageImportStamp>668ee80e</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -44,19 +44,25 @@
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.assert, Version=2.0.0.2929, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll</HintPath>
<Reference Include="xunit.assert, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.assert.2.1.0\lib\portable-net45+win8+wp8+wpa81\xunit.assert.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.core, Version=2.0.0.2929, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\xunit.extensibility.core.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll</HintPath>
<Reference Include="xunit.core, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.extensibility.core.2.1.0\lib\portable-net45+win8+wp8+wpa81\xunit.core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.execution.desktop, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="DirectoryInfoTests.cs" />
<Compile Include="Helpers\DisposableDirectory.cs" />
<Compile Include="NullGuardTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Expand All @@ -74,7 +80,7 @@
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.0.0\build\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props'))" />
<Error Condition="!Exists('..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.1.0\build\portable-net45+win8+wp8+wpa81\xunit.core.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
9 changes: 5 additions & 4 deletions Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="xunit" version="2.0.0" targetFramework="net45" />
<package id="xunit" version="2.1.0" targetFramework="net45" />
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
<package id="xunit.assert" version="2.0.0" targetFramework="net45" />
<package id="xunit.core" version="2.0.0" targetFramework="net45" />
<package id="xunit.extensibility.core" version="2.0.0" targetFramework="net45" />
<package id="xunit.assert" version="2.1.0" targetFramework="net45" />
<package id="xunit.core" version="2.1.0" targetFramework="net45" />
<package id="xunit.extensibility.core" version="2.1.0" targetFramework="net45" />
<package id="xunit.extensibility.execution" version="2.1.0" targetFramework="net45" />
</packages>
2 changes: 0 additions & 2 deletions script/build.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@echo off
"tools\nuget\nuget.exe update -self"
"tools\nuget\nuget.exe" "install" "FAKE.Core" "-OutputDirectory" "tools" "-ExcludeVersion" "-version" "2.2.0"

:Build
cls
Expand Down
40 changes: 34 additions & 6 deletions script/build.fsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
#r @"..\tools\FAKE.Core\tools\FakeLib.dll"
open Fake
open Fake.XUnit2Helper
open Fake.Git.Information

let commit = getCurrentSHA1(".")

let authors = ["Phil Haack"]

// project name and description
let projectName = "Rothko"
let projectDescription = "Abstractions!"
let projectSummary = projectDescription // TODO: write a summary
let projectSummary = "This package is a modified signed build of Rothko from https://github.com/editor-tools/Rothko/commit/" + commit

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

RestorePackages()
Expand All @@ -19,16 +24,16 @@ 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"
[ Attribute.Product projectName
Attribute.Version releaseNotes.AssemblyVersion
Attribute.FileVersion releaseNotes.AssemblyVersion]
Attribute.FileVersion releaseNotes.AssemblyVersion ]
)

Target "BuildApp" (fun _ ->
Expand All @@ -37,19 +42,42 @@ Target "BuildApp" (fun _ ->
)

Target "UnitTests" (fun _ ->
!! "./Tests/bin/**/Tests.dll"
|> xUnit (fun p ->
!! "./Tests/bin/Release/**/Tests.dll"
|> xUnit2 (fun p ->
{p with
XmlOutput = true
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 + "-ghfvs"
ReleaseNotes = toLines releaseNotes.Notes
AccessKey = getBuildParamOrDefault "nugetkey" ""
Publish = hasBuildParam "nugetkey" }) "Rothko.nuspec"
)


Target "Default" DoNothing

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

RunTargetOrDefault "Default"
Loading

0 comments on commit 3dfd53f

Please sign in to comment.