Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
GeertvanHorrik committed Apr 19, 2014
2 parents a361981 + 29a915f commit 7dc321f
Show file tree
Hide file tree
Showing 14 changed files with 256 additions and 43 deletions.
30 changes: 23 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ GitHubLink

![GitHubLink](design/logo/logo_64.png)

GitHubLink let's users step through your code hosted on GitHub! **This makes symbol servers obsolete** which saves you both time with uploading source files with symbols and the user no longer has to specify custom symbol servers (such as symbolsource.org).
GitHubLink let's users step through your code hosted on GitHub! **Help making .NET open source projects more accessible by enabling this for your .NET projects, it's just a single additional step in your build**. See the list of [projects using GitHubLink](#ProjectsUsingGitHubLink).

GitHubLink makes symbol servers obsolete which saves you both time with uploading source files with symbols and the user no longer has to specify custom symbol servers (such as symbolsource.org).

![Stepping through external source code](doc/images/GitHubLink_example.gif)

The idea is based on the [SourceLink project](https://github.com/ctaggart/SourceLink "SourceLink project"). However it requires FAKE and not everyone likes to write code in F#. GitHubLink is available as console application and can be references as assembly as well to be used in other .NET assemblies.

The advantage of GitHubLink is that it is fully customized for GitHub. It also works with GitHub urls so it **does not require a local git repository to work**. This makes it perfectly usable in continuous integration servers such as [Continua CI](http://www.finalbuilder.com/Continua-CI "Continua CI").

The idea is based on the <a href="https://github.com/ctaggart/SourceLink" target="_blank">SourceLink project</a>. However it requires FAKE and not everyone likes to write code in F#. GitHubLink is available as console application and can be references as assembly as well to be used in other .NET assemblies.

The advantage of GitHubLink is that it is fully customized for GitHub. It also works with GitHub urls so it **does not require a local git repository to work**. This makes it perfectly usable in continuous integration servers such as <a href="http://www.finalbuilder.com/Continua-CI" target="_blank">Continua CI</a>.

Updating all the pdb files is very fast. A solution with over 85 projects will be handled in less than 30 seconds.

Expand Down Expand Up @@ -92,24 +95,37 @@ The releases will be available as separate executable download on the [releases

## Get it via Chocolatey ##

If you want to install the tool on your (build) computer, the package is available via [Chocolatey](https://chocolatey.org/). To install, use the following command:
If you want to install the tool on your (build) computer, the package is available via <a href="https://chocolatey.org/" target="_blank">Chocolatey</a>. To install, use the following command:

cinst GitHubLink

## Get it via NuGet ##

If you want to reference the assembly to use it in code, the recommended way to get it is via [NuGet](http://www.nuget.org/).
If you want to reference the assembly to use it in code, the recommended way to get it is via <a href="http://www.nuget.org/" target="_blank">NuGet</a>.

**Note that getting GitHubLink via NuGet will add it as a reference to the project**

# How does it work #

The SrcSrv tool (Srcsrv.dll) enables a client to retrieve the exact version of the source files that were used to build an application. Because the source code for a module can change between versions and over the course of years, it is important to look at the source code as it existed when the version of the module in question was built.

For more information, see the [official documentation of SrcSrv](http://msdn.microsoft.com/en-us/library/windows/hardware/ff558791(v=vs.85).aspx).
For more information, see the <a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff558791(v=vs.85).aspx" target="_blank">official documentation of SrcSrv</a>.

GitHubLink creates a source index file and updates the PDB file so it will retrieve the files from the GitHub file handler.

<a name="ProjectsUsingGitHubLink"></a>
# Projects using GitHubLink #

Below is a list of projects already using GitHubLink.

- <a href="http://www.catelproject.com" target="_blank">Catel</a>
- <a href="https://github.com/GeertvanHorrik/GitHubLink" target="_blank">GitHubLink</a>

Are you using GitHubLink in your projects? Let us know and we will add your project to the list.

*Note that you can also create a pull request on this document and add it yourself.*


# Icon #

Link by Dominic Whittle from The Noun Project
31 changes: 29 additions & 2 deletions doc/history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Project website: https://github.com/GeertvanHorrik/GitHubLink
**********************************************************

==================
Version 1.1.0
Version 1.2.0
==================

Release date:
Expand All @@ -22,7 +22,34 @@ Release date:

Added/fixed:
============
xx
(*) #7 Show relative paths to make to file names easier to read
(x) #5 When an error occurs, the console application will no longer wait for a key input press to prevent
it from blocking a build

Roadmap:
========
See https://github.com/GeertvanHorrik/GitHubLink

Known issues:
=============
See https://github.com/GeertvanHorrik/GitHubLink

**********************************************************


==================
Version 1.1.0
==================

Release date:
=============
2014/04/19

Added/fixed:
============
(+) #1 Created Chocolatey package for easier deployment
(+) #2 Added support for VB projects
(+) #3 Created NuGet package for deployment when being referenced from code

Roadmap:
========
Expand Down
55 changes: 48 additions & 7 deletions src/GitHubLink.Test/ContextFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@
namespace GitHubLink.Test
{
using Catel;
using Catel.Test;
using Microsoft.VisualStudio.TestTools.UnitTesting;

public class ContextFacts
{
#region Nested type: TheDefaultValues

[TestClass]
public class TheDefaultValues
{
#region Methods

[TestMethod]
public void SetsRightDefaultValues()
{
Expand All @@ -26,10 +23,54 @@ public void SetsRightDefaultValues()
Assert.AreEqual("Release", context.ConfigurationName);
Assert.IsFalse(context.IsHelp);
}

#endregion
}

#endregion
[TestClass]
public class TheValidateContextMethod
{
[TestMethod]
public void ThrowsExceptionForMissingSolutionDirectory()
{
var context = new Context();

ExceptionTester.CallMethodAndExpectException<GitHubLinkException>(() => context.ValidateContext());
}

[TestMethod]
public void ThrowsExceptionForMissingConfigurationName()
{
var context = new Context
{
SolutionDirectory = @"c:\source\githublink",
ConfigurationName = string.Empty
};

ExceptionTester.CallMethodAndExpectException<GitHubLinkException>(() => context.ValidateContext());
}

[TestMethod]
public void ThrowsExceptionForMissingTargetUrl()
{
var context = new Context
{
SolutionDirectory = @"c:\source\githublink",
};

ExceptionTester.CallMethodAndExpectException<GitHubLinkException>(() => context.ValidateContext());
}

[TestMethod]
public void SucceedsForValidContext()
{
var context = new Context
{
SolutionDirectory = @"c:\source\githublink",
TargetUrl = "https://github.com/geertvanhorrik/githublink"
};

// should not throw
context.ValidateContext();
}
}
}
}
47 changes: 47 additions & 0 deletions src/GitHubLink.Test/Extensions/ContextExtensionsFacts.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ContextExtensionsFacts.cs" company="CatenaLogic">
// Copyright (c) 2012 - 2014 CatenaLogic. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace GitHubLink.Test.Extensions
{
using Microsoft.VisualStudio.TestTools.UnitTesting;

public class ContextExtensionsFacts
{
#region Nested type: TheGetRelativePathMethod

[TestClass]
public class TheGetRelativePathMethod
{
[TestMethod]
public void ReturnsRelativePathWithDirectoryDownwards()
{
var context = new Context
{
SolutionDirectory = @"c:\source\githublink"
};

var relativePath = context.GetRelativePath(@"c:\source\githublink\src\subdir1\somefile.cs");

Assert.AreEqual(@"src\subdir1\somefile.cs", relativePath);
}

[TestMethod]
public void ReturnsRelativePathWithDirectoryUpwards()
{
var context = new Context
{
SolutionDirectory = @"c:\source\githublink"
};

var relativePath = context.GetRelativePath(@"c:\source\catel\src\subdir1\somefile.cs");

Assert.AreEqual(@"..\catel\src\subdir1\somefile.cs", relativePath);
}
}

#endregion
}
}
12 changes: 6 additions & 6 deletions src/GitHubLink.Test/Extensions/StringExtensionsFacts.github.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class TheGetGitHubCompanyNameMethod
[TestMethod]
public void ReturnsValidCompany()
{
var company = GitHubLink.StringExtensions.GetGitHubCompanyName("https://github.com/GeertvanHorrik/GitHubLink");
var company = StringExtensions.GetGitHubCompanyName("https://github.com/GeertvanHorrik/GitHubLink");

Assert.AreEqual("GeertvanHorrik", company);
}
Expand All @@ -28,7 +28,7 @@ public class TheGetGitHubProjectNameMethod
[TestMethod]
public void ReturnsValidProject()
{
var project = GitHubLink.StringExtensions.GetGitHubProjectName("https://github.com/GeertvanHorrik/GitHubLink");
var project = StringExtensions.GetGitHubProjectName("https://github.com/GeertvanHorrik/GitHubLink");

Assert.AreEqual("GitHubLink", project);
}
Expand All @@ -40,15 +40,15 @@ public class TheGetGitHubProjectUrlMethod
[TestMethod]
public void ReturnsValidUrl()
{
var company = GitHubLink.StringExtensions.GetGitHubProjectUrl("https://github.com/GeertvanHorrik/GitHubLink");
var company = StringExtensions.GetGitHubProjectUrl("https://github.com/GeertvanHorrik/GitHubLink");

Assert.AreEqual("https://github.com/GeertvanHorrik/GitHubLink", company);
}

[TestMethod]
public void ReturnsValidUrlWhenGitIsAppended()
{
var company = GitHubLink.StringExtensions.GetGitHubProjectUrl("https://github.com/GeertvanHorrik/GitHubLink.git");
var company = StringExtensions.GetGitHubProjectUrl("https://github.com/GeertvanHorrik/GitHubLink.git");

Assert.AreEqual("https://github.com/GeertvanHorrik/GitHubLink", company);
}
Expand All @@ -60,7 +60,7 @@ public class TheGetGitHubCompanyUrlMethod
[TestMethod]
public void ReturnsValidUrl()
{
var company = GitHubLink.StringExtensions.GetGitHubCompanyUrl("https://github.com/GeertvanHorrik/GitHubLink");
var company = StringExtensions.GetGitHubCompanyUrl("https://github.com/GeertvanHorrik/GitHubLink");

Assert.AreEqual("https://github.com/GeertvanHorrik", company);
}
Expand All @@ -72,7 +72,7 @@ public class TheGetGitHubRawUrlMethod
[TestMethod]
public void ReturnsValidUrl()
{
var company = GitHubLink.StringExtensions.GetGitHubRawUrl("https://github.com/GeertvanHorrik/GitHubLink");
var company = StringExtensions.GetGitHubRawUrl("https://github.com/GeertvanHorrik/GitHubLink");

Assert.AreEqual("https://raw.github.com/GeertvanHorrik/GitHubLink", company);
}
Expand Down
1 change: 1 addition & 0 deletions src/GitHubLink.Test/GitHubLink.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<ItemGroup>
<Compile Include="ArgumentParserFacts.cs" />
<Compile Include="ContextFacts.cs" />
<Compile Include="Extensions\ContextExtensionsFacts.cs" />
<Compile Include="Extensions\StringExtensionsFacts.github.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Expand Down
46 changes: 46 additions & 0 deletions src/GitHubLink.sln
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,45 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{D435DFD9-F
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitHubLink.Test", "GitHubLink.Test\GitHubLink.Test.csproj", "{ED2B9579-59D2-40F2-BC5E-F4DC3DAB9A56}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{2A773B1D-106C-4583-8021-9AC0BB3E5408}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "design", "design", "{0A177E6C-1C04-416D-9473-82EE9A9ACFB4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "FinalBuilder", "FinalBuilder", "{8EABCB0D-E792-4700-BDF9-E488CF2AB4A2}"
ProjectSection(SolutionItems) = preProject
..\deployment\FinalBuilder\GitHubLink.CreatePackages.fbp7 = ..\deployment\FinalBuilder\GitHubLink.CreatePackages.fbp7
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Chocolatey", "Chocolatey", "{9765817D-03DD-4879-8A43-CB3086B6743F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "template", "template", "{BEEC31FD-7021-47BA-AB54-A5B4C7C23F7E}"
ProjectSection(SolutionItems) = preProject
..\deployment\Chocolatey\template\GitHubLink.nuspec = ..\deployment\Chocolatey\template\GitHubLink.nuspec
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "template", "template", "{75559B70-907C-4375-A44B-8195B5027B3C}"
ProjectSection(SolutionItems) = preProject
..\deployment\NuGet\template\GitHubLink.nuspec = ..\deployment\NuGet\template\GitHubLink.nuspec
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{5BC2D5A6-10B0-425B-BAB3-5AB3DFDC24B2}"
ProjectSection(SolutionItems) = preProject
..\deployment\Chocolatey\template\tools\chocolateyInstall.ps1 = ..\deployment\Chocolatey\template\tools\chocolateyInstall.ps1
..\deployment\Chocolatey\template\tools\chocolateyUninstall.ps1 = ..\deployment\Chocolatey\template\tools\chocolateyUninstall.ps1
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "logo", "logo", "{CADD04D7-0CC0-48BB-B3EC-F82E34895982}"
ProjectSection(SolutionItems) = preProject
..\design\logo\logo.ico = ..\design\logo\logo.ico
..\design\logo\logo_1024.png = ..\design\logo\logo_1024.png
..\design\logo\logo_128.png = ..\design\logo\logo_128.png
..\design\logo\logo_16.png = ..\design\logo\logo_16.png
..\design\logo\logo_256.png = ..\design\logo\logo_256.png
..\design\logo\logo_32.png = ..\design\logo\logo_32.png
..\design\logo\logo_512.png = ..\design\logo\logo_512.png
..\design\logo\logo_64.png = ..\design\logo\logo_64.png
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -57,5 +96,12 @@ Global
{A5FCE4FA-083A-4814-B38C-2AED9C37647F} = {A6694C2C-1A8A-49F0-B404-1BBB4D081808}
{D435DFD9-F741-4FCA-A65A-28B7D251983D} = {A6694C2C-1A8A-49F0-B404-1BBB4D081808}
{ED2B9579-59D2-40F2-BC5E-F4DC3DAB9A56} = {D435DFD9-F741-4FCA-A65A-28B7D251983D}
{2A773B1D-106C-4583-8021-9AC0BB3E5408} = {99836492-466A-44E3-A92B-72CE3744F61C}
{8EABCB0D-E792-4700-BDF9-E488CF2AB4A2} = {99836492-466A-44E3-A92B-72CE3744F61C}
{9765817D-03DD-4879-8A43-CB3086B6743F} = {99836492-466A-44E3-A92B-72CE3744F61C}
{BEEC31FD-7021-47BA-AB54-A5B4C7C23F7E} = {9765817D-03DD-4879-8A43-CB3086B6743F}
{75559B70-907C-4375-A44B-8195B5027B3C} = {2A773B1D-106C-4583-8021-9AC0BB3E5408}
{5BC2D5A6-10B0-425B-BAB3-5AB3DFDC24B2} = {BEEC31FD-7021-47BA-AB54-A5B4C7C23F7E}
{CADD04D7-0CC0-48BB-B3EC-F82E34895982} = {0A177E6C-1C04-416D-9473-82EE9A9ACFB4}
EndGlobalSection
EndGlobal
15 changes: 10 additions & 5 deletions src/GitHubLink/Context.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ namespace GitHubLink

public class Context
{
private static ILog Log = LogManager.GetCurrentClassLogger();
private static readonly ILog Log = LogManager.GetCurrentClassLogger();

public Context()
private readonly Lazy<string> _tempDirectory = new Lazy<string>(() =>
{
TempDirectory = Path.Combine(Path.GetTempPath(), "SourceLink", Guid.NewGuid().ToString());
Directory.CreateDirectory(TempDirectory);
var tempDirectory = Path.Combine(Path.GetTempPath(), "SourceLink", Guid.NewGuid().ToString());
Directory.CreateDirectory(tempDirectory);

return tempDirectory;
});

public Context()
{
ConfigurationName = "Release";
}

Expand All @@ -27,7 +32,7 @@ public Context()

public string SolutionDirectory { get; set; }
public string ConfigurationName { get; set; }
public string TempDirectory { get; private set; }
public string TempDirectory { get { return _tempDirectory.Value; } }

public string TargetUrl { get; set; }
public string TargetBranch { get; set; }
Expand Down
Loading

0 comments on commit 7dc321f

Please sign in to comment.