Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Sep 6, 2017
2 parents 11a5e22 + 7135e2c commit 888ed29
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 36 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

This NuGet package contains code for parsing Team Foundation Server URLs.

[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/bbtsoftwareag/TfsUrlParser/blob/feature/build/LICENSE)
[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/bbtsoftware/TfsUrlParser/blob/master/LICENSE)

## Information

| | Stable | Pre-release |
|:--:|:--:|:--:|
|GitHub Release|-|[![GitHub release](https://img.shields.io/github/release/bbtsoftwareag/TfsUrlParser.svg)](https://github.com/bbtsoftwareag/TfsUrlParser/releases/latest)|
|GitHub Release|-|[![GitHub release](https://img.shields.io/github/release/bbtsoftware/TfsUrlParser.svg)](https://github.com/bbtsoftware/TfsUrlParser/releases/latest)|
|NuGet|[![NuGet](https://img.shields.io/nuget/v/TfsUrlParser.svg)](https://www.nuget.org/packages/TfsUrlParser)|[![NuGet](https://img.shields.io/nuget/vpre/TfsUrlParser.svg)](https://www.nuget.org/packages/TfsUrlParser)|

## Build Status

|Develop|Master|
|:--:|:--:|
|[![Build status](https://ci.appveyor.com/api/projects/status/i4evodvrv7qc9e6y/branch/develop?svg=true)](https://ci.appveyor.com/project/BBTSoftwareAG/tfsurlparser/branch/develop)|[![Build status](https://ci.appveyor.com/api/projects/status/i4evodvrv7qc9e6y?svg=true)](https://ci.appveyor.com/project/BBTSoftwareAG/tfsurlparser)|
|[![Build status](https://ci.appveyor.com/api/projects/status/i4evodvrv7qc9e6y/branch/develop?svg=true)](https://ci.appveyor.com/project/BBTSoftwareAG/tfsurlparser/branch/develop)|[![Build status](https://ci.appveyor.com/api/projects/status/i4evodvrv7qc9e6y/branch/master?svg=true)](https://ci.appveyor.com/project/BBTSoftwareAG/tfsurlparser/branch/master)|

## Code Coverage

Expand Down
9 changes: 5 additions & 4 deletions nuspec/nuget/TfsUrlParser.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@
<owners>bbtsoftware, pascalberger</owners>
<summary>Provides a parser for Team Foundation Server (TFS) URLs.</summary>
<description>Provides a parser to get repository information from a Team Foundation Server (TFS) URLs.</description>
<licenseUrl>https://github.com/bbtsoftwareag/TfsUrlParser/blob/develop/LICENSE</licenseUrl>
<projectUrl>https://github.com/bbtsoftwareag/TfsUrlParser/</projectUrl>
<iconUrl>https://raw.githubusercontent.com/bbtsoftwareag/TfsUrlParser/fdaa354eef80c05070c93ef14b6774abe7eeac73/nuspec/nuget/icon.png</iconUrl>
<licenseUrl>https://github.com/bbtsoftware/TfsUrlParser/blob/develop/LICENSE</licenseUrl>
<projectUrl>https://github.com/bbtsoftware/TfsUrlParser/</projectUrl>
<iconUrl>https://raw.githubusercontent.com/bbtsoftware/TfsUrlParser/fdaa354eef80c05070c93ef14b6774abe7eeac73/nuspec/nuget/icon.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>Copyright © 2017 BBT Software AG, Root/Zermatt, Switzerland</copyright>
<tags>TeamFoundationServer TFS Git Parser</tags>
<releaseNotes>https://github.com/bbtsoftware/TfsUrlParser/releases/tag/1.1.0</releaseNotes>
</metadata>
<files>
<file src="TfsUrlParser.dll" target="lib\net40" />
<file src="TfsUrlParser.pdb" target="lib\net40" />
<file src="TfsUrlParser.xml" target="lib\net40" />
</files>
</package>
</package>
4 changes: 2 additions & 2 deletions setup.cake
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ BuildParameters.SetParameters(
buildSystem: BuildSystem,
sourceDirectoryPath: "./src",
title: "TfsUrlParser",
repositoryOwner: "bbtsoftwareag",
repositoryOwner: "bbtsoftware",
repositoryName: "TfsUrlParser",
appVeyorAccountName: "bbtsoftwareag",
appVeyorAccountName: "BBTSoftwareAG",
shouldPublishMyGet: false);

BuildParameters.PrintParameters(Context);
Expand Down
19 changes: 18 additions & 1 deletion src/TfsUrlParser.Tests/RepositoryDescriptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,106 +31,123 @@ public void Should_Throw_If_No_Valid_Url(string repoUrl, string expectedMessage)
[Theory]
[InlineData(
@"http://myserver:8080/tfs/defaultcollection/myproject/_git/myrepository",
@"http://myserver:8080/",
"defaultcollection",
@"http://myserver:8080/tfs/defaultcollection",
"myproject",
"myrepository")]
[InlineData(
@"http://tfs.myserver/defaultcollection/myproject/_git/myrepository",
@"http://tfs.myserver/",
"defaultcollection",
@"http://tfs.myserver/defaultcollection",
"myproject",
"myrepository")]
[InlineData(
@"http://mytenant.visualstudio.com/defaultcollection/myproject/_git/myrepository",
@"http://mytenant.visualstudio.com/",
"defaultcollection",
@"http://mytenant.visualstudio.com/defaultcollection",
"myproject",
"myrepository")]
[InlineData(
@"http://tfs.foo.com/foo/foo/_git/foo",
@"http://tfs.foo.com/",
"foo",
@"http://tfs.foo.com/foo",
"foo",
"foo")]
[InlineData(
@"http://mytenant.visualstudio.com/defaultcollection/myproject/_git/myrepository/somethingelse",
@"http://mytenant.visualstudio.com/",
"defaultcollection",
@"http://mytenant.visualstudio.com/defaultcollection",
"myproject",
"myrepository")]
[InlineData(
@"https://myserver:8080/tfs/defaultcollection/myproject/_git/myrepository",
@"https://myserver:8080/",
"defaultcollection",
@"https://myserver:8080/tfs/defaultcollection",
"myproject",
"myrepository")]
[InlineData(
@"https://tfs.myserver/defaultcollection/myproject/_git/myrepository",
@"https://tfs.myserver/",
"defaultcollection",
@"https://tfs.myserver/defaultcollection",
"myproject",
"myrepository")]
[InlineData(
@"https://mytenant.visualstudio.com/defaultcollection/myproject/_git/myrepository",
@"https://mytenant.visualstudio.com/",
"defaultcollection",
@"https://mytenant.visualstudio.com/defaultcollection",
"myproject",
"myrepository")]
[InlineData(
@"https://mytenant.visualstudio.com/defaultcollection/myproject/_git/myrepository/somethingelse",
@"https://mytenant.visualstudio.com/",
"defaultcollection",
@"https://mytenant.visualstudio.com/defaultcollection",
"myproject",
"myrepository")]
[InlineData(
@"https://tfs.foo.com/foo/foo/_git/foo",
@"https://tfs.foo.com/",
"foo",
@"https://tfs.foo.com/foo",
"foo",
"foo")]
[InlineData(
@"ssh://myserver:8080/tfs/defaultcollection/myproject/_git/myrepository",
@"ssh://myserver:8080/",
"defaultcollection",
@"https://myserver:8080/tfs/defaultcollection",
"myproject",
"myrepository")]
[InlineData(
@"ssh://tfs.myserver/defaultcollection/myproject/_git/myrepository",
@"ssh://tfs.myserver/",
"defaultcollection",
@"https://tfs.myserver/defaultcollection",
"myproject",
"myrepository")]
[InlineData(
@"ssh://mytenant.visualstudio.com/defaultcollection/myproject/_git/myrepository",
@"ssh://mytenant.visualstudio.com/",
"defaultcollection",
@"https://mytenant.visualstudio.com/defaultcollection",
"myproject",
"myrepository")]
[InlineData(
@"ssh://mytenant.visualstudio.com/defaultcollection/myproject/_git/myrepository/somethingelse",
@"ssh://mytenant.visualstudio.com/",
"defaultcollection",
@"https://mytenant.visualstudio.com/defaultcollection",
"myproject",
"myrepository")]
[InlineData(
@"ssh://tfs.foo.com/foo/foo/_git/foo",
@"ssh://tfs.foo.com/",
"foo",
@"https://tfs.foo.com/foo",
"foo",
"foo")]
[InlineData(
@"ssh://foo:bar@myserver:8080/tfs/defaultcollection/myproject/_git/myrepository",
@"ssh://myserver:8080/",
"defaultcollection",
@"https://myserver:8080/tfs/defaultcollection",
"myproject",
"myrepository")]
public void Should_Parse_Repo_Url(string repoUrl, string collectionName, string collectionurl, string projectName, string repositoryName)
public void Should_Parse_Repo_Url(string repoUrl, string serverUrl, string collectionName, string collectionurl, string projectName, string repositoryName)
{
// Given / When
var repositoryDescription = new RepositoryDescription(new Uri(repoUrl));

// Then
repositoryDescription.ServerUrl.ToString().ShouldBe(serverUrl);
repositoryDescription.CollectionName.ShouldBe(collectionName);
repositoryDescription.CollectionUrl.ShouldBe(new Uri(collectionurl));
repositoryDescription.ProjectName.ShouldBe(projectName);
Expand Down
4 changes: 2 additions & 2 deletions src/TfsUrlParser.Tests/TfsUrlParser.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
<CodeAnalysisRuleSet>..\TfsUrlParser.Tests.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Shouldly, Version=2.8.2.0, Culture=neutral, PublicKeyToken=6042cbcb05cbc941, processorArchitecture=MSIL">
<HintPath>..\packages\Shouldly.2.8.2\lib\net451\Shouldly.dll</HintPath>
<Reference Include="Shouldly, Version=2.8.3.0, Culture=neutral, PublicKeyToken=6042cbcb05cbc941, processorArchitecture=MSIL">
<HintPath>..\packages\Shouldly.2.8.3\lib\net451\Shouldly.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion src/TfsUrlParser.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Shouldly" version="2.8.2" targetFramework="net452" />
<package id="Shouldly" version="2.8.3" targetFramework="net452" />
<package id="xunit" version="2.2.0" targetFramework="net452" />
<package id="xunit.abstractions" version="2.0.1" targetFramework="net452" />
<package id="xunit.assert" version="2.2.0" targetFramework="net452" />
Expand Down
6 changes: 6 additions & 0 deletions src/TfsUrlParser/RepositoryDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public RepositoryDescription(Uri repoUrl)

var splitLastPart = splitPath[1].Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);

this.ServerUrl = new Uri(repoUrl.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped));
this.CollectionName = splitFirstPart.Reverse().Skip(1).Take(1).Single();
this.CollectionUrl =
new Uri(
Expand All @@ -48,6 +49,11 @@ public RepositoryDescription(Uri repoUrl)
this.RepositoryName = splitLastPart.First();
}

/// <summary>
/// Gets the Url of the Team Foundation Server.
/// </summary>
public Uri ServerUrl { get; }

/// <summary>
/// Gets the name of the Team Foundation Server collection.
/// </summary>
Expand Down
30 changes: 11 additions & 19 deletions src/TfsUrlParser/TfsUrlParser.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\System.Runtime.InteropServices.Analyzers.1.0.1\build\System.Runtime.InteropServices.Analyzers.props" Condition="Exists('..\packages\System.Runtime.InteropServices.Analyzers.1.0.1\build\System.Runtime.InteropServices.Analyzers.props')" />
<Import Project="..\packages\System.Runtime.Analyzers.1.0.1\build\System.Runtime.Analyzers.props" Condition="Exists('..\packages\System.Runtime.Analyzers.1.0.1\build\System.Runtime.Analyzers.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -52,31 +50,25 @@
<Compile Include="RepositoryDescription.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="packages.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\Desktop.Analyzers.1.1.0\analyzers\dotnet\cs\Desktop.Analyzers.dll" />
<Analyzer Include="..\packages\Desktop.Analyzers.1.1.0\analyzers\dotnet\cs\Desktop.CSharp.Analyzers.dll" />
<Analyzer Include="..\packages\Microsoft.AnalyzerPowerPack.1.0.1\analyzers\dotnet\cs\Microsoft.AnalyzerPowerPack.Common.dll" />
<Analyzer Include="..\packages\Microsoft.AnalyzerPowerPack.1.0.1\analyzers\dotnet\cs\Microsoft.AnalyzerPowerPack.CSharp.dll" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
<Analyzer Include="..\packages\System.Runtime.Analyzers.1.0.1\analyzers\dotnet\cs\System.Runtime.Analyzers.dll" />
<Analyzer Include="..\packages\System.Runtime.Analyzers.1.0.1\analyzers\dotnet\cs\System.Runtime.CSharp.Analyzers.dll" />
<Analyzer Include="..\packages\System.Runtime.InteropServices.Analyzers.1.0.1\analyzers\dotnet\cs\System.Runtime.InteropServices.Analyzers.dll" />
<Analyzer Include="..\packages\System.Runtime.InteropServices.Analyzers.1.0.1\analyzers\dotnet\cs\System.Runtime.InteropServices.CSharp.Analyzers.dll" />
<Analyzer Include="..\packages\Microsoft.AnalyzerPowerPack.1.1.0\analyzers\dotnet\cs\Microsoft.AnalyzerPowerPack.Common.dll" />
<Analyzer Include="..\packages\Microsoft.AnalyzerPowerPack.1.1.0\analyzers\dotnet\cs\Microsoft.AnalyzerPowerPack.CSharp.dll" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.2\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\packages\StyleCop.Analyzers.1.0.2\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
<Analyzer Include="..\packages\System.Runtime.Analyzers.1.1.0\analyzers\dotnet\cs\System.Runtime.Analyzers.dll" />
<Analyzer Include="..\packages\System.Runtime.Analyzers.1.1.0\analyzers\dotnet\cs\System.Runtime.CSharp.Analyzers.dll" />
<Analyzer Include="..\packages\System.Runtime.InteropServices.Analyzers.1.1.0\analyzers\dotnet\cs\System.Runtime.InteropServices.Analyzers.dll" />
<Analyzer Include="..\packages\System.Runtime.InteropServices.Analyzers.1.1.0\analyzers\dotnet\cs\System.Runtime.InteropServices.CSharp.Analyzers.dll" />
<Analyzer Include="..\packages\System.Security.Cryptography.Hashing.Algorithms.Analyzers.1.1.0\analyzers\dotnet\cs\System.Security.Cryptography.Hashing.Algorithms.Analyzers.dll" />
<Analyzer Include="..\packages\System.Security.Cryptography.Hashing.Algorithms.Analyzers.1.1.0\analyzers\dotnet\cs\System.Security.Cryptography.Hashing.Algorithms.CSharp.Analyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use 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\System.Runtime.Analyzers.1.0.1\build\System.Runtime.Analyzers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Runtime.Analyzers.1.0.1\build\System.Runtime.Analyzers.props'))" />
<Error Condition="!Exists('..\packages\System.Runtime.InteropServices.Analyzers.1.0.1\build\System.Runtime.InteropServices.Analyzers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\System.Runtime.InteropServices.Analyzers.1.0.1\build\System.Runtime.InteropServices.Analyzers.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.
<Target Name="BeforeBuild">
Expand Down
8 changes: 4 additions & 4 deletions src/TfsUrlParser/packages.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Desktop.Analyzers" version="1.1.0" targetFramework="net40" />
<package id="Microsoft.AnalyzerPowerPack" version="1.0.1" targetFramework="net40" />
<package id="Microsoft.AnalyzerPowerPack" version="1.1.0" targetFramework="net40" />
<package id="Microsoft.CodeAnalysis.FxCopAnalyzers" version="1.1.0" targetFramework="net40" />
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="net40" developmentDependency="true" />
<package id="System.Runtime.Analyzers" version="1.0.1" targetFramework="net40" />
<package id="System.Runtime.InteropServices.Analyzers" version="1.0.1" targetFramework="net40" />
<package id="StyleCop.Analyzers" version="1.0.2" targetFramework="net40" developmentDependency="true" />
<package id="System.Runtime.Analyzers" version="1.1.0" targetFramework="net40" />
<package id="System.Runtime.InteropServices.Analyzers" version="1.1.0" targetFramework="net40" />
<package id="System.Security.Cryptography.Hashing.Algorithms.Analyzers" version="1.1.0" targetFramework="net40" />
</packages>

0 comments on commit 888ed29

Please sign in to comment.