diff --git a/.gitignore b/.gitignore
index 0763c92..0fa3c20 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,12 @@
*.user
*.sln.docstates
+.nuget/
+tools/FAKE/
+build-log.xml
+Nuget.key
+TestResult.xml
+
# Build results
[Bb]in/
[Cc]lientbin/
@@ -16,6 +22,7 @@
bin
obj
[Ll]ib/
+*.ide/
*_i.c
*_p.c
*.ilk
diff --git a/LICENSE b/LICENSE
index 750a25c..0c8ff6f 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2014 Geert van Horrik
+Copyright (c) 2014 CatenaLogic
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/NextVersion.txt b/NextVersion.txt
deleted file mode 100644
index 359a5b9..0000000
--- a/NextVersion.txt
+++ /dev/null
@@ -1 +0,0 @@
-2.0.0
\ No newline at end of file
diff --git a/README.md b/README.md
index a2461ff..3d53b8a 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,8 @@ GitLink
GitLink let's users step through your code hosted on GitHub! **Help make .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 GitLink](#projects-using-gitlink).
+
+
--
**Important note**
@@ -28,8 +30,14 @@ When using GitLink, the user no longer has to specify symbol servers. He/she onl

+# Troubleshooting
+
**Note that Visual Studio 2012 needs to run elevated in order to download the source server files due to a bug in Visual Studio 2012.**
+If the source stepping is not working, double check that Visual Studio has a valid symbol cache directory to store the source files being downloaded:
+
+
+
# Supported git providers
GitLink supports the following providers out of the box (will auto-detect based on the url):
@@ -51,7 +59,7 @@ Providers currently being worked on:
It is also possible to specify a custom url provider.
-# Using GitLink as command line tool #
+# Using GitLink as command line tool
Using GitLink via the command line is very simple:
@@ -60,44 +68,55 @@ Using GitLink via the command line is very simple:
Below are a few examples.
-## Running for the default branch ##
+## Running for the default branch
GitLink.exe c:\source\catel -u https://github.com/catel/catel
This will use the default branch (which is in most cases **master**). You can find out the default branch by checking what branch is loaded by default on the GitHub page.
-## Running for a specific branch ##
+## Running for a specific branch
GitLink.exe c:\source\catel -u https://github.com/catel/catel -b develop
This will use the develop branch.
-## Running for a specific branch and configuration ##
+## Running for a specific branch and configuration
GitLink.exe c:\source\catel -u https://github.com/catel/catel -b develop -c debug
This will use the develop branch and the debug configuration.
-## Getting help ##
+## Running for a specific solution only
+
+Sometimes a repository contains more than 1 solution file. By default, all solutions will be processed. To only process a single solution file, use the *-f* option:
+
+ GitLink.exe c:\source\catel -u https://github.com/catel/catel -f Catel.sln
+
+## Ignoring projects
+
+When specific projects should be ignored, use the *-ignore* option. This option accepts a comma separated list of projects to ignore:
+
+ GitLink.exe c:\source\catel -u https://github.com/catel/catel -f Catel.sln -ignore Catel.Core.WP80,Catel.MVVM.WP80
+
+## Getting help
When you need help about GitLink, use the following command line:
GitLink.exe -help
-## Logging to a file ##
+## Logging to a file
When you need to log the information to a file, use the following command line:
GitLink.exe c:\source\catel -u https://github.com/catel/catel -b develop -l GitLinkLog.log
-
-# Using GitLink in code #
+# Using GitLink in code
GitLink is built with 2 usages in mind: command line and code reference. Though most people will use the command line version, it is possible to reference the executable and use the logic in code.
The command line implementation uses the same available API.
-## Creating a context ##
+## Creating a context
To link files to a Git project, a context must be created. The command line version does this by using the *ArgumentParser* class. It is also possible to create a context from scratch as shown in the example below:
@@ -114,33 +133,33 @@ It is possible to create a context based on command line arguments:
var context = ArgumentParser.Parse(@"c:\source\catel -u https://github.com/catel/catel -b develop");
```
-## Linking a context ##
+## Linking a context
Once a context is created, the *Linker* class can be used to actually link the files:
Linker.Link(context);
-# How to get GitLink #
+# How to get GitLink
-There are three general ways to get GitLink:.
+There are three general ways to get GitLink:
-## Get it from GitHub ##
+## Get it from GitHub
The releases will be available as separate executable download on the [releases tab](https://github.com/CatenaLogic/GitLink/releases) of the project.
-## Get it via Chocolatey ##
+## Get it via Chocolatey
If you want to install the tool on your (build) computer, the package is available via Chocolatey. To install, use the following command:
choco install GitLink
-## Get it via NuGet ##
+## 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.
**Note that getting GitLink via NuGet will add it as a reference to the project**
-# How does it work #
+# 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.
@@ -149,18 +168,27 @@ For more information, see the
-# Projects using GitLink #
+# Projects using GitLink
Below is a list of projects already using GitLink (alphabetically ordered).
- Catel
- eXpand
+- Fluent.Ribbon
- GitLink
+- Orc.AutomaticSupport
+- Orc.Collections
+- Orc.Controls
- Orc.CsvHelper
+- Orc.Feedback
- Orc.FilterBuilder
+- Orc.LicenseManager
- Orc.ProjectManagement
- Orc.Sort
+- Orc.Squirrel
+- Orc.WorkspaceManagement
- Orchestra
+- OxyPlot
- Romantic Web
- xUnit.net
- xUnit.net Visual Studio Runner
@@ -170,6 +198,6 @@ Are you using GitLink in your projects? Let us know and we will add your project
*Note that you can also create a pull request on this document and add it yourself.*
-# Icon #
+# Icon
Link by Dominic Whittle from The Noun Project
diff --git a/deployment/Chocolatey/template/GitLink/GitLink.nuspec b/deployment/Chocolatey/template/GitLink/GitLink.nuspec
index 1def9ce..658b187 100644
--- a/deployment/Chocolatey/template/GitLink/GitLink.nuspec
+++ b/deployment/Chocolatey/template/GitLink/GitLink.nuspec
@@ -19,6 +19,6 @@
en-US
https://github.com/CatenaLogic/GitLink/
https://github.com/CatenaLogic/GitLink/blob/develop/LICENSE
- https://raw.githubusercontent.com/CatenaLogic/GitLink/develop/design/logo/logo_64.png
+ https://raw.githubusercontent.com/CatenaLogic/GitLink/develop/design/logo/logo_128.png
\ No newline at end of file
diff --git a/deployment/Chocolatey/template/GitLink/tools/chocolateyInstall.ps1 b/deployment/Chocolatey/template/GitLink/tools/chocolateyInstall.ps1
deleted file mode 100644
index b0defc6..0000000
--- a/deployment/Chocolatey/template/GitLink/tools/chocolateyInstall.ps1
+++ /dev/null
@@ -1,2 +0,0 @@
-Generate-BinFile "ghl" "$packageFolder\Tools\GitLink.exe"
-Write-ChocolateySuccess "GitLink"
\ No newline at end of file
diff --git a/deployment/Chocolatey/template/GitLink/tools/chocolateyUninstall.ps1 b/deployment/Chocolatey/template/GitLink/tools/chocolateyUninstall.ps1
deleted file mode 100644
index 8850bbb..0000000
--- a/deployment/Chocolatey/template/GitLink/tools/chocolateyUninstall.ps1
+++ /dev/null
@@ -1,3 +0,0 @@
-Remove-BinFile "gl" "$packageFolder\Tools\GitLink.exe"
-Remove-BinFile "GitLink" "$packageFolder\Tools\GitLink.exe"
-Write-ChocolateySuccess "GitLink"
\ No newline at end of file
diff --git a/doc/history.txt b/doc/history.txt
index f4afdcc..2ab482b 100644
--- a/doc/history.txt
+++ b/doc/history.txt
@@ -10,67 +10,4 @@ For more information about issues or new feature requests, please visit:
Project website: https://github.com/CatenaLogic/GitLink/
-**********************************************************
-
-==================
-Version 1.4.0
-==================
-
-Release date:
-=============
-2014/xx/xx
-
-Added/fixed:
-============
-(x) #8 Console stays red after an error occurs
-
-**********************************************************
-
-
-==================
-Version 1.2.0/1.3.0
-==================
-
-Release date:
-=============
-2014/04/20
-
-Added/fixed:
-============
-(*) #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
-
-**********************************************************
-
-
-==================
-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
-
-**********************************************************
-
-
-==================
-Version 1.0.0
-==================
-
-Release date:
-=============
-2014/04/17
-
-Added/fixed:
-============
-First initial release
-
-**********************************************************
+**********************************************************
\ No newline at end of file
diff --git a/doc/images/visualstudio_symbolslocation.png b/doc/images/visualstudio_symbolslocation.png
new file mode 100644
index 0000000..ca417ff
Binary files /dev/null and b/doc/images/visualstudio_symbolslocation.png differ
diff --git a/lib/repositories.config b/lib/repositories.config
index cd1a1b1..8114fe5 100644
--- a/lib/repositories.config
+++ b/lib/repositories.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/scripts - Build - Debug.bat b/scripts - Build - Debug.bat
new file mode 100644
index 0000000..b1ae2b9
--- /dev/null
+++ b/scripts - Build - Debug.bat
@@ -0,0 +1,10 @@
+@echo off
+
+IF NOT "%VS110COMNTOOLS%" == "" (call "%VS110COMNTOOLS%vsvars32.bat")
+IF NOT "%VS120COMNTOOLS%" == "" (call "%VS120COMNTOOLS%vsvars32.bat")
+IF NOT "%VS130COMNTOOLS%" == "" (call "%VS130COMNTOOLS%vsvars32.bat")
+IF NOT "%VS140COMNTOOLS%" == "" (call "%VS140COMNTOOLS%vsvars32.bat")
+
+
+for /F %%A in ('dir /b src\*.sln') do call devenv src\%%A /build "Debug"
+pause
\ No newline at end of file
diff --git a/scripts - Build - Release.bat b/scripts - Build - Release.bat
new file mode 100644
index 0000000..d5d0265
--- /dev/null
+++ b/scripts - Build - Release.bat
@@ -0,0 +1,10 @@
+@echo off
+
+IF NOT "%VS110COMNTOOLS%" == "" (call "%VS110COMNTOOLS%vsvars32.bat")
+IF NOT "%VS120COMNTOOLS%" == "" (call "%VS120COMNTOOLS%vsvars32.bat")
+IF NOT "%VS130COMNTOOLS%" == "" (call "%VS130COMNTOOLS%vsvars32.bat")
+IF NOT "%VS140COMNTOOLS%" == "" (call "%VS140COMNTOOLS%vsvars32.bat")
+
+
+for /F %%A in ('dir /b src\*.sln') do call devenv src\%%A /build "Release"
+pause
\ No newline at end of file
diff --git a/src/GitLink.Test/ApprovalTestsConfig.cs b/src/GitLink.Tests/ApprovalTestsConfig.cs
similarity index 100%
rename from src/GitLink.Test/ApprovalTestsConfig.cs
rename to src/GitLink.Tests/ApprovalTestsConfig.cs
diff --git a/src/GitLink.Test/ArgumentParserFacts.cs b/src/GitLink.Tests/ArgumentParserFacts.cs
similarity index 56%
rename from src/GitLink.Test/ArgumentParserFacts.cs
rename to src/GitLink.Tests/ArgumentParserFacts.cs
index 850a843..c6149b4 100644
--- a/src/GitLink.Test/ArgumentParserFacts.cs
+++ b/src/GitLink.Tests/ArgumentParserFacts.cs
@@ -5,7 +5,7 @@
// --------------------------------------------------------------------------------------------------------------------
-namespace GitLink.Test
+namespace GitLink.Tests
{
using Catel.Test;
using NUnit.Framework;
@@ -44,6 +44,14 @@ public void CorrectlyParsesHelp()
Assert.IsTrue(context.IsHelp);
}
+ [TestCase]
+ public void CorrectlyParsesSolutionFile()
+ {
+ var context = ArgumentParser.ParseArguments("solutionDirectory -u http://github.com/CatenaLogic/GitLink -f someSolution");
+
+ Assert.AreEqual("someSolution", context.SolutionFile);
+ }
+
[TestCase]
public void CorrectlyParsesUrlAndBranchName()
{
@@ -65,9 +73,40 @@ public void CorrectlyParsesUrlAndConfiguration()
}
[TestCase]
- public void ThrowsExceptionForInvalidNumberOfArguments()
+ public void CorrectlyParsesUrlAndConfigurationAndPlatform()
+ {
+ var context = ArgumentParser.ParseArguments("solutionDirectory -u http://github.com/CatenaLogic/GitLink -c someConfiguration -p \"Any CPU\"");
+
+ Assert.AreEqual("solutionDirectory", context.SolutionDirectory);
+ Assert.AreEqual("http://github.com/CatenaLogic/GitLink", context.TargetUrl);
+ Assert.AreEqual("someConfiguration", context.ConfigurationName);
+ Assert.AreEqual("Any CPU", context.PlatformName);
+ }
+
+ [TestCase]
+ public void CorrectlyParsesUrlAndConfigurationWithDebug()
{
- ExceptionTester.CallMethodAndExpectException(() => ArgumentParser.ParseArguments("solutionDirectory -l logFilePath extraArg"));
+ var context = ArgumentParser.ParseArguments("solutionDirectory -u http://github.com/CatenaLogic/GitLink -debug -c someConfiguration");
+
+ Assert.AreEqual("solutionDirectory", context.SolutionDirectory);
+ Assert.AreEqual("http://github.com/CatenaLogic/GitLink", context.TargetUrl);
+ Assert.AreEqual("someConfiguration", context.ConfigurationName);
+ Assert.IsTrue(context.IsDebug);
+ }
+
+ [TestCase]
+ public void CorrectlyParsesIgnoredProjects()
+ {
+ var context = ArgumentParser.ParseArguments("solutionDirectory -u http://github.com/CatenaLogic/GitLink -debug -c someConfiguration -ignore test1,test2");
+
+ Assert.AreEqual("solutionDirectory", context.SolutionDirectory);
+ Assert.AreEqual("http://github.com/CatenaLogic/GitLink", context.TargetUrl);
+ Assert.AreEqual("someConfiguration", context.ConfigurationName);
+ Assert.IsTrue(context.IsDebug);
+
+ Assert.AreEqual(2, context.IgnoredProjects.Count);
+ Assert.AreEqual("test1", context.IgnoredProjects[0]);
+ Assert.AreEqual("test2", context.IgnoredProjects[1]);
}
[TestCase]
diff --git a/src/GitLink.Test/ContextFacts.cs b/src/GitLink.Tests/ContextFacts.cs
similarity index 75%
rename from src/GitLink.Test/ContextFacts.cs
rename to src/GitLink.Tests/ContextFacts.cs
index 094d7a8..e5a771e 100644
--- a/src/GitLink.Test/ContextFacts.cs
+++ b/src/GitLink.Tests/ContextFacts.cs
@@ -5,8 +5,9 @@
// --------------------------------------------------------------------------------------------------------------------
-namespace GitLink.Test
+namespace GitLink.Tests
{
+ using System;
using Catel.Test;
using GitLink.Providers;
using NUnit.Framework;
@@ -72,6 +73,23 @@ public void SucceedsForValidContext()
// should not throw
context.ValidateContext();
}
+
+ [TestCase(@".", @"c:\")]
+ [TestCase(@"C:\MyDirectory\", @"C:\MyDirectory\")]
+ [TestCase(@"C:\MyDirectory\..", @"C:\")]
+ [TestCase(@"C:\MyDirectory\..\TestDirectory\", @"C:\TestDirectory\")]
+ public void ExpandsDirectoryIfRequired(string solutionDirectory, string expectedValue)
+ {
+ Environment.CurrentDirectory = @"c:\";
+
+ var context = new Context(new ProviderManager());
+ context.TargetUrl = "https://github.com/CatenaLogic/GitLink.git";
+ context.SolutionDirectory = solutionDirectory;
+
+ context.ValidateContext();
+
+ Assert.AreEqual(expectedValue, context.SolutionDirectory);
+ }
}
}
}
\ No newline at end of file
diff --git a/src/GitLink.Test/Extensions/ContextExtensionsFacts.cs b/src/GitLink.Tests/Extensions/ContextExtensionsFacts.cs
similarity index 97%
rename from src/GitLink.Test/Extensions/ContextExtensionsFacts.cs
rename to src/GitLink.Tests/Extensions/ContextExtensionsFacts.cs
index 2f9842a..2e6222c 100644
--- a/src/GitLink.Test/Extensions/ContextExtensionsFacts.cs
+++ b/src/GitLink.Tests/Extensions/ContextExtensionsFacts.cs
@@ -5,7 +5,7 @@
// --------------------------------------------------------------------------------------------------------------------
-namespace GitLink.Test.Extensions
+namespace GitLink.Tests.Extensions
{
using GitLink.Providers;
using NUnit.Framework;
diff --git a/src/GitLink.Test/GitLink.Test.csproj b/src/GitLink.Tests/GitLink.Tests.csproj
similarity index 94%
rename from src/GitLink.Test/GitLink.Test.csproj
rename to src/GitLink.Tests/GitLink.Tests.csproj
index b86987c..557d705 100644
--- a/src/GitLink.Test/GitLink.Test.csproj
+++ b/src/GitLink.Tests/GitLink.Tests.csproj
@@ -6,8 +6,8 @@
{ED2B9579-59D2-40F2-BC5E-F4DC3DAB9A56}
Library
Properties
- GitLink.Test
- GitLink.Test
+ GitLink.Tests
+ GitLink.Tests
v4.5
512
{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
@@ -21,7 +21,7 @@
true
full
false
- ..\..\output\debug\Test\
+ ..\..\output\debug\GitLink.Tests\
DEBUG;TRACE
prompt
4
@@ -29,7 +29,7 @@
pdbonly
true
- ..\..\output\release\Test\
+ ..\..\output\release\GitLink.Tests\
TRACE
prompt
4
@@ -41,9 +41,9 @@
..\..\lib\ApprovalUtilities.3.0.7\lib\net35\ApprovalUtilities.dll
-
+
False
- ..\..\lib\Catel.Core.4.0.0-unstable0497\lib\net45\Catel.Core.dll
+ ..\..\lib\Catel.Core.4.1.0-unstable0030\lib\net45\Catel.Core.dll
..\..\lib\NUnit.2.6.3\lib\nunit.framework.dll
diff --git a/src/GitLink.Test/GlobalInitialization.cs b/src/GitLink.Tests/GlobalInitialization.cs
similarity index 100%
rename from src/GitLink.Test/GlobalInitialization.cs
rename to src/GitLink.Tests/GlobalInitialization.cs
diff --git a/src/GitLink.Test/IntegrationTests/BitBucketIntegration.CorrectlyUpdatesPdbFiles.approved.txt b/src/GitLink.Tests/IntegrationTests/BitBucketIntegration.CorrectlyUpdatesPdbFiles.approved.txt
similarity index 100%
rename from src/GitLink.Test/IntegrationTests/BitBucketIntegration.CorrectlyUpdatesPdbFiles.approved.txt
rename to src/GitLink.Tests/IntegrationTests/BitBucketIntegration.CorrectlyUpdatesPdbFiles.approved.txt
diff --git a/src/GitLink.Test/IntegrationTests/BitBucketIntegration.cs b/src/GitLink.Tests/IntegrationTests/BitBucketIntegration.cs
similarity index 96%
rename from src/GitLink.Test/IntegrationTests/BitBucketIntegration.cs
rename to src/GitLink.Tests/IntegrationTests/BitBucketIntegration.cs
index 1361f56..3e9cbd7 100644
--- a/src/GitLink.Test/IntegrationTests/BitBucketIntegration.cs
+++ b/src/GitLink.Tests/IntegrationTests/BitBucketIntegration.cs
@@ -5,7 +5,7 @@
// --------------------------------------------------------------------------------------------------------------------
-namespace GitLink.Test.IntegrationTests
+namespace GitLink.Tests.IntegrationTests
{
using NUnit.Framework;
diff --git a/src/GitLink.Test/IntegrationTests/GitHubIntegration.CorrectlyUpdatesPdbFiles.approved.txt b/src/GitLink.Tests/IntegrationTests/GitHubIntegration.CorrectlyUpdatesPdbFiles.approved.txt
similarity index 100%
rename from src/GitLink.Test/IntegrationTests/GitHubIntegration.CorrectlyUpdatesPdbFiles.approved.txt
rename to src/GitLink.Tests/IntegrationTests/GitHubIntegration.CorrectlyUpdatesPdbFiles.approved.txt
diff --git a/src/GitLink.Test/IntegrationTests/GitHubIntegration.cs b/src/GitLink.Tests/IntegrationTests/GitHubIntegration.cs
similarity index 96%
rename from src/GitLink.Test/IntegrationTests/GitHubIntegration.cs
rename to src/GitLink.Tests/IntegrationTests/GitHubIntegration.cs
index caff986..2b08cfb 100644
--- a/src/GitLink.Test/IntegrationTests/GitHubIntegration.cs
+++ b/src/GitLink.Tests/IntegrationTests/GitHubIntegration.cs
@@ -5,7 +5,7 @@
// --------------------------------------------------------------------------------------------------------------------
-namespace GitLink.Test.IntegrationTests
+namespace GitLink.Tests.IntegrationTests
{
using NUnit.Framework;
diff --git a/src/GitLink.Test/IntegrationTests/IntegrationTestBase.cs b/src/GitLink.Tests/IntegrationTests/IntegrationTestBase.cs
similarity index 99%
rename from src/GitLink.Test/IntegrationTests/IntegrationTestBase.cs
rename to src/GitLink.Tests/IntegrationTests/IntegrationTestBase.cs
index d1dfcf1..720ff6f 100644
--- a/src/GitLink.Test/IntegrationTests/IntegrationTestBase.cs
+++ b/src/GitLink.Tests/IntegrationTests/IntegrationTestBase.cs
@@ -5,7 +5,7 @@
// --------------------------------------------------------------------------------------------------------------------
-namespace GitLink.Test.IntegrationTests
+namespace GitLink.Tests.IntegrationTests
{
using System;
using System.Diagnostics;
diff --git a/src/GitLink.Test/Properties/AssemblyInfo.cs b/src/GitLink.Tests/Properties/AssemblyInfo.cs
similarity index 94%
rename from src/GitLink.Test/Properties/AssemblyInfo.cs
rename to src/GitLink.Tests/Properties/AssemblyInfo.cs
index 2f7a90b..8d5277f 100644
--- a/src/GitLink.Test/Properties/AssemblyInfo.cs
+++ b/src/GitLink.Tests/Properties/AssemblyInfo.cs
@@ -12,11 +12,11 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
-[assembly: AssemblyTitle("GitLink.Test")]
+[assembly: AssemblyTitle("GitLink.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("GitLink.Test")]
+[assembly: AssemblyProduct("GitLink.Tests")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
diff --git a/src/GitLink.Test/Providers/BitBucketProviderFacts.cs b/src/GitLink.Tests/Providers/BitBucketProviderFacts.cs
similarity index 98%
rename from src/GitLink.Test/Providers/BitBucketProviderFacts.cs
rename to src/GitLink.Tests/Providers/BitBucketProviderFacts.cs
index 4d8e67c..c4c48ec 100644
--- a/src/GitLink.Test/Providers/BitBucketProviderFacts.cs
+++ b/src/GitLink.Tests/Providers/BitBucketProviderFacts.cs
@@ -5,7 +5,7 @@
// --------------------------------------------------------------------------------------------------------------------
-namespace GitLink.Test.Providers
+namespace GitLink.Tests.Providers
{
using GitLink.Providers;
using NUnit.Framework;
diff --git a/src/GitLink.Test/Providers/GitHubProviderFacts.cs b/src/GitLink.Tests/Providers/GitHubProviderFacts.cs
similarity index 98%
rename from src/GitLink.Test/Providers/GitHubProviderFacts.cs
rename to src/GitLink.Tests/Providers/GitHubProviderFacts.cs
index 2b2a582..45a9731 100644
--- a/src/GitLink.Test/Providers/GitHubProviderFacts.cs
+++ b/src/GitLink.Tests/Providers/GitHubProviderFacts.cs
@@ -5,7 +5,7 @@
// --------------------------------------------------------------------------------------------------------------------
-namespace GitLink.Test.Providers
+namespace GitLink.Tests.Providers
{
using GitLink.Providers;
using NUnit.Framework;
diff --git a/src/GitLink.Test/Providers/ProviderManagerFacts.cs b/src/GitLink.Tests/Providers/ProviderManagerFacts.cs
similarity index 97%
rename from src/GitLink.Test/Providers/ProviderManagerFacts.cs
rename to src/GitLink.Tests/Providers/ProviderManagerFacts.cs
index b1c3612..655d023 100644
--- a/src/GitLink.Test/Providers/ProviderManagerFacts.cs
+++ b/src/GitLink.Tests/Providers/ProviderManagerFacts.cs
@@ -5,7 +5,7 @@
// --------------------------------------------------------------------------------------------------------------------
-namespace GitLink.Test.Providers
+namespace GitLink.Tests.Providers
{
using System;
using GitLink.Providers;
diff --git a/src/GitLink.Test/packages.config b/src/GitLink.Tests/packages.config
similarity index 82%
rename from src/GitLink.Test/packages.config
rename to src/GitLink.Tests/packages.config
index c8550e6..879d312 100644
--- a/src/GitLink.Test/packages.config
+++ b/src/GitLink.Tests/packages.config
@@ -2,6 +2,6 @@
-
+
\ No newline at end of file
diff --git a/src/GitLink.sln b/src/GitLink.sln
index d58c36c..1fd8d69 100644
--- a/src/GitLink.sln
+++ b/src/GitLink.sln
@@ -22,9 +22,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{88214CBE-4B9
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{A5FCE4FA-083A-4814-B38C-2AED9C37647F}"
EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{D435DFD9-F741-4FCA-A65A-28B7D251983D}"
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{D435DFD9-F741-4FCA-A65A-28B7D251983D}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitLink.Test", "GitLink.Test\GitLink.Test.csproj", "{ED2B9579-59D2-40F2-BC5E-F4DC3DAB9A56}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitLink.Tests", "GitLink.Tests\GitLink.Tests.csproj", "{ED2B9579-59D2-40F2-BC5E-F4DC3DAB9A56}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{2A773B1D-106C-4583-8021-9AC0BB3E5408}"
EndProject
diff --git a/src/GitLink/ArgumentParser.cs b/src/GitLink/ArgumentParser.cs
index fddcae5..50fe23d 100644
--- a/src/GitLink/ArgumentParser.cs
+++ b/src/GitLink/ArgumentParser.cs
@@ -1,135 +1,179 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright (c) 2014 - 2014 CatenaLogic. All rights reserved.
-//
-// --------------------------------------------------------------------------------------------------------------------
-
-
-namespace GitLink
-{
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using Catel.Logging;
- using GitLink.Providers;
-
- public static class ArgumentParser
- {
- private static readonly ILog Log = LogManager.GetCurrentClassLogger();
-
- public static Context ParseArguments(string commandLineArguments)
- {
- return ParseArguments(commandLineArguments.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList(),
- new ProviderManager());
- }
-
- public static Context ParseArguments(params string[] commandLineArguments)
- {
- return ParseArguments(commandLineArguments.ToList(), new ProviderManager());
- }
-
- public static Context ParseArguments(List commandLineArguments, IProviderManager providerManager)
- {
- var context = new Context(providerManager);
-
- if (commandLineArguments.Count == 0)
- {
- Log.ErrorAndThrowException("Invalid number of arguments");
- }
-
- var firstArgument = commandLineArguments.First();
- if (IsHelp(firstArgument))
- {
- context.IsHelp = true;
- return context;
- }
-
- if (commandLineArguments.Count < 3)
- {
- Log.ErrorAndThrowException("Invalid number of arguments");
- }
-
- context.SolutionDirectory = firstArgument;
-
- var namedArguments = commandLineArguments.Skip(1).ToList();
-
- EnsureArgumentsEvenCount(commandLineArguments, namedArguments);
-
- for (var index = 0; index < namedArguments.Count; index = index + 2)
- {
- var name = namedArguments[index];
- var value = namedArguments[index + 1];
-
- if (IsSwitch("l", name))
- {
- context.LogFile = value;
- continue;
- }
-
- if (IsSwitch("c", name))
- {
- context.ConfigurationName = value;
- continue;
- }
-
- if (IsSwitch("u", name))
- {
- context.TargetUrl = value;
- continue;
- }
-
- if (IsSwitch("b", name))
- {
- context.TargetBranch = value;
- continue;
- }
-
- if (IsSwitch("s", name))
- {
- context.ShaHash = value;
- continue;
- }
-
- Log.ErrorAndThrowException("Could not parse command line parameter '{0}'.", name);
- }
-
- if (!string.IsNullOrEmpty(context.TargetUrl))
- {
- context.Provider = providerManager.GetProvider(context.TargetUrl);
- }
-
- return context;
- }
-
- private static bool IsSwitch(string switchName, string value)
- {
- if (value.StartsWith("-"))
- {
- value = value.Remove(0, 1);
- }
-
- if (value.StartsWith("/"))
- {
- value = value.Remove(0, 1);
- }
-
- return (string.Equals(switchName, value));
- }
-
- private static void EnsureArgumentsEvenCount(IEnumerable commandLineArguments, List namedArguments)
- {
- if (namedArguments.Count.IsOdd())
- {
- Log.ErrorAndThrowException("Could not parse arguments: '{0}'.", string.Join(" ", commandLineArguments));
- }
- }
-
- private static bool IsHelp(string singleArgument)
- {
- return (singleArgument == "?") ||
- IsSwitch("h", singleArgument) ||
- IsSwitch("help", singleArgument) ||
- IsSwitch("?", singleArgument);
- }
- }
+// --------------------------------------------------------------------------------------------------------------------
+//
+// Copyright (c) 2014 - 2014 CatenaLogic. All rights reserved.
+//
+// --------------------------------------------------------------------------------------------------------------------
+
+
+namespace GitLink
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using Catel.Collections;
+ using Catel.Logging;
+ using GitLink.Providers;
+
+ public static class ArgumentParser
+ {
+ private static readonly ILog Log = LogManager.GetCurrentClassLogger();
+
+ public static Context ParseArguments(string commandLineArguments)
+ {
+ return ParseArguments(commandLineArguments.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList(),
+ new ProviderManager());
+ }
+
+ public static Context ParseArguments(params string[] commandLineArguments)
+ {
+ return ParseArguments(commandLineArguments.ToList(), new ProviderManager());
+ }
+
+ public static Context ParseArguments(List commandLineArguments, IProviderManager providerManager)
+ {
+ var context = new Context(providerManager);
+
+ if (commandLineArguments.Count == 0)
+ {
+ Log.ErrorAndThrowException("Invalid number of arguments");
+ }
+
+ var firstArgument = commandLineArguments.First();
+ if (IsHelp(firstArgument))
+ {
+ context.IsHelp = true;
+ return context;
+ }
+
+ if (commandLineArguments.Count < 3)
+ {
+ Log.ErrorAndThrowException("Invalid number of arguments");
+ }
+
+ context.SolutionDirectory = firstArgument;
+
+ var namedArguments = commandLineArguments.Skip(1).ToList();
+ for (var index = 0; index < namedArguments.Count; index++)
+ {
+ var name = namedArguments[index];
+
+ // First check everything without values
+ if (IsSwitch("debug", name))
+ {
+ context.IsDebug = true;
+ continue;
+ }
+
+ // After this point, all arguments should have a value
+ index++;
+ var valueInfo = GetValue(namedArguments, index);
+ var value = valueInfo.Key;
+ index = index + (valueInfo.Value - 1);
+
+ if (IsSwitch("l", name))
+ {
+ context.LogFile = value;
+ continue;
+ }
+
+ if (IsSwitch("c", name))
+ {
+ context.ConfigurationName = value;
+ continue;
+ }
+
+ if (IsSwitch("p", name))
+ {
+ context.PlatformName = value;
+ continue;
+ }
+
+ if (IsSwitch("u", name))
+ {
+ context.TargetUrl = value;
+ continue;
+ }
+
+ if (IsSwitch("b", name))
+ {
+ context.TargetBranch = value;
+ continue;
+ }
+
+ if (IsSwitch("s", name))
+ {
+ context.ShaHash = value;
+ continue;
+ }
+
+ if (IsSwitch("f", name))
+ {
+ context.SolutionFile = value;
+ continue;
+ }
+
+ if (IsSwitch("ignore", name))
+ {
+ context.IgnoredProjects.AddRange(value.Split(new []{ ',' }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()));
+ continue;
+ }
+
+ Log.ErrorAndThrowException("Could not parse command line parameter '{0}'.", name);
+ }
+
+ if (!string.IsNullOrEmpty(context.TargetUrl))
+ {
+ context.Provider = providerManager.GetProvider(context.TargetUrl);
+ }
+
+ return context;
+ }
+
+ private static KeyValuePair GetValue(List arguments, int index)
+ {
+ var totalCounter = 1;
+
+ var value = arguments[index];
+
+ while (value.StartsWith("\""))
+ {
+ if (value.EndsWith("\""))
+ {
+ break;
+ }
+
+ index++;
+ value += " " + arguments[index];
+
+ totalCounter++;
+ }
+
+ value = value.Trim('\"');
+
+ return new KeyValuePair(value, totalCounter);
+ }
+
+ private static bool IsSwitch(string switchName, string value)
+ {
+ if (value.StartsWith("-"))
+ {
+ value = value.Remove(0, 1);
+ }
+
+ if (value.StartsWith("/"))
+ {
+ value = value.Remove(0, 1);
+ }
+
+ return (string.Equals(switchName, value));
+ }
+
+ private static bool IsHelp(string singleArgument)
+ {
+ return (singleArgument == "?") ||
+ IsSwitch("h", singleArgument) ||
+ IsSwitch("help", singleArgument) ||
+ IsSwitch("?", singleArgument);
+ }
+ }
}
\ No newline at end of file
diff --git a/src/GitLink/Context.cs b/src/GitLink/Context.cs
index 573a87a..f3419de 100644
--- a/src/GitLink/Context.cs
+++ b/src/GitLink/Context.cs
@@ -1,87 +1,110 @@
-// --------------------------------------------------------------------------------------------------------------------
-//
-// Copyright (c) 2014 - 2014 CatenaLogic. All rights reserved.
-//
-// --------------------------------------------------------------------------------------------------------------------
-
-
-namespace GitLink
-{
- using Catel;
- using Catel.Logging;
- using Providers;
-
- public class Context
- {
- private static readonly ILog Log = LogManager.GetCurrentClassLogger();
-
- private readonly IProviderManager _providerManager;
- private IProvider _provider;
-
- public Context(IProviderManager providerManager)
- {
- Argument.IsNotNull(() => providerManager);
-
- _providerManager = providerManager;
-
- Authentication = new Authentication();
- ConfigurationName = "Release";
- }
-
- public bool IsHelp { get; set; }
-
- public string LogFile { get; set; }
-
- public string SolutionDirectory { get; set; }
-
- public string ConfigurationName { get; set; }
-
- public Authentication Authentication { get; private set; }
-
- public IProvider Provider
- {
- get
- {
- if (_provider == null)
- {
- _provider = _providerManager.GetProvider(TargetUrl);
- }
-
- return _provider;
- }
- set
- {
- _provider = value;
- }
- }
-
- public string TargetUrl { get; set; }
-
- public string TargetBranch { get; set; }
-
- public string ShaHash { get; set; }
-
- public void ValidateContext()
- {
- if (string.IsNullOrEmpty(SolutionDirectory))
- {
- Log.ErrorAndThrowException("Solution directory is missing");
- }
-
- if (string.IsNullOrEmpty(ConfigurationName))
- {
- Log.ErrorAndThrowException("Configuration name is missing");
- }
-
- if (string.IsNullOrEmpty(TargetUrl))
- {
- Log.ErrorAndThrowException("Target url is missing");
- }
-
- if (Provider == null)
- {
- Log.ErrorAndThrowException("Cannot determine git provider");
- }
- }
- }
+// --------------------------------------------------------------------------------------------------------------------
+//
+// Copyright (c) 2014 - 2014 CatenaLogic. All rights reserved.
+//
+// --------------------------------------------------------------------------------------------------------------------
+
+
+namespace GitLink
+{
+ using System;
+ using System.Collections.Generic;
+ using Catel;
+ using Catel.IO;
+ using Catel.Logging;
+ using Providers;
+
+ public class Context
+ {
+ private static readonly ILog Log = LogManager.GetCurrentClassLogger();
+
+ private readonly IProviderManager _providerManager;
+ private IProvider _provider;
+
+ public Context(IProviderManager providerManager)
+ {
+ Argument.IsNotNull(() => providerManager);
+
+ _providerManager = providerManager;
+
+ Authentication = new Authentication();
+ ConfigurationName = "Release";
+ PlatformName = "AnyCPU";
+ IgnoredProjects = new List();
+ }
+
+ public bool IsHelp { get; set; }
+
+ public bool IsDebug { get; set; }
+
+ public string LogFile { get; set; }
+
+ public string SolutionDirectory { get; set; }
+
+ public string ConfigurationName { get; set; }
+
+ public string PlatformName { get; set; }
+
+ public Authentication Authentication { get; private set; }
+
+ public IProvider Provider
+ {
+ get
+ {
+ if (_provider == null)
+ {
+ _provider = _providerManager.GetProvider(TargetUrl);
+ }
+
+ return _provider;
+ }
+ set
+ {
+ _provider = value;
+ }
+ }
+
+ public string TargetUrl { get; set; }
+
+ public string TargetBranch { get; set; }
+
+ public string ShaHash { get; set; }
+
+ public string SolutionFile { get; set; }
+
+ public List IgnoredProjects { get; private set; }
+
+ public void ValidateContext()
+ {
+ if (!string.IsNullOrWhiteSpace(SolutionDirectory))
+ {
+ SolutionDirectory = Path.GetFullPath(SolutionDirectory, Environment.CurrentDirectory);
+ }
+
+ if (string.IsNullOrEmpty(SolutionDirectory))
+ {
+ Log.ErrorAndThrowException("Solution directory is missing");
+ }
+
+ if (string.IsNullOrEmpty(ConfigurationName))
+ {
+ Log.ErrorAndThrowException("Configuration name is missing");
+ }
+
+ if (string.IsNullOrEmpty(PlatformName))
+ {
+ Log.ErrorAndThrowException("Platform name is missing");
+ }
+
+ if (string.IsNullOrEmpty(TargetUrl))
+ {
+ Log.ErrorAndThrowException("Target url is missing");
+ }
+
+ if (Provider == null)
+ {
+ Log.ErrorAndThrowException("Cannot determine git provider");
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/GitLink/Extensions/ProjectExtensions.cs b/src/GitLink/Extensions/ProjectExtensions.cs
index 93c09bc..9e580f6 100644
--- a/src/GitLink/Extensions/ProjectExtensions.cs
+++ b/src/GitLink/Extensions/ProjectExtensions.cs
@@ -20,30 +20,31 @@ public static class ProjectExtensions
{
private static readonly ILog Log = LogManager.GetCurrentClassLogger();
- public static string GetProjectName(this Project project)
+ public static bool ShouldBeIgnored(this Project project, IEnumerable projectsToIgnore)
{
Argument.IsNotNull(() => project);
- var projectName = GetProjectPropertyValue(project, "MSBuildProjectName");
- return projectName ?? Path.GetFileName(project.FullPath);
+ var projectName = GetProjectName(project).ToLower();
+
+ foreach (var projectToIgnore in projectsToIgnore)
+ {
+ var lowerCaseProjectToIgnore = projectToIgnore.ToLower();
+
+ if (string.Equals(projectName, lowerCaseProjectToIgnore))
+ {
+ return true;
+ }
+ }
+
+ return false;
}
- public static string GetProjectPropertyValue(this Project project, string propertyName)
+ public static string GetProjectName(this Project project)
{
Argument.IsNotNull(() => project);
- Argument.IsNotNullOrWhitespace(() => propertyName);
-
- var projectNameProperty = (from property in project.Properties
- where string.Equals(property.Name, "MSBuildProjectName")
- select property).FirstOrDefault();
- if (projectNameProperty == null)
- {
- Log.Debug("Failed to get property 'MSBuildProjectName', returning null");
- return null;
- }
-
- return projectNameProperty.EvaluatedValue;
+ var projectName = project.GetPropertyValue("MSBuildProjectName");
+ return projectName ?? Path.GetFileName(project.FullPath);
}
public static void CreateSrcSrv(this Project project, string rawUrl, string revision, Dictionary paths)
@@ -68,7 +69,9 @@ public static Dictionary VerifyPdbFiles(this Project project, IE
{
Argument.IsNotNull(() => project);
- using (var pdb = new GitLink.Pdb.PdbFile(Path.ChangeExtension(project.GetOutputFile(), ".pdb")))
+ var pdbFile = GetOutputPdbFile(project);
+
+ using (var pdb = new PdbFile(pdbFile))
{
return pdb.VerifyPdbFiles(files);
}
@@ -96,17 +99,90 @@ public static string GetOutputFile(this Project project)
{
Argument.IsNotNull(() => project);
- string extension = ".dll";
+ var targetDirectory = GetTargetDirectory(project);
+ var targetFileName = GetTargetFileName(project);
+
+ var outputFile = Path.Combine(targetDirectory, targetFileName);
+ outputFile = Path.GetFullPath(outputFile);
+
+ return outputFile;
+ }
+
+ public static string GetTargetDirectory(this Project project)
+ {
+ Argument.IsNotNull(() => project);
+
+ var targetDirectory = project.GetPropertyValue("TargetDir");
+ if (string.IsNullOrWhiteSpace(targetDirectory))
+ {
+ var relativeTargetDirectory = GetRelativeTargetDirectory(project);
+ targetDirectory = Path.Combine(project.DirectoryPath, relativeTargetDirectory);
+ }
+
+ return targetDirectory;
+ }
+
+ public static string GetRelativeTargetDirectory(this Project project)
+ {
+ Argument.IsNotNull(() => project);
+
+ var projectOutputDirectory = project.GetPropertyValue("OutputPath");
+ if (string.IsNullOrWhiteSpace(projectOutputDirectory))
+ {
+ projectOutputDirectory = project.GetPropertyValue("OutDir");
+ }
+
+ return projectOutputDirectory;
+ }
+
+ public static string GetTargetFileName(this Project project)
+ {
+ Argument.IsNotNull(() => project);
+
+ var targetFileName = project.GetPropertyValue("TargetFileName");
+ if (string.IsNullOrWhiteSpace(targetFileName))
+ {
+ var assemblyName = project.GetPropertyValue("AssemblyName");
+ var extension = GetTargetExtension(project);
+
+ targetFileName = string.Format("{0}{1}", assemblyName, extension);
+ }
+
+ return targetFileName;
+ }
+
+ public static string GetTargetExtension(this Project project)
+ {
+ Argument.IsNotNull(() => project);
+
+ var extension = project.GetPropertyValue("TargetExt");
+ if (string.IsNullOrWhiteSpace(extension))
+ {
+ extension = ".dll";
+
+ var outputType = project.GetPropertyValue("OutputType").ToLower();
+ if (outputType.Contains("exe") || outputType.Contains("winexe"))
+ {
+ extension = ".exe";
+ }
+ }
+
+ return extension;
+ }
+
+ public static void DumpProperties(this Project project)
+ {
+ Log.Debug("");
+ Log.Debug("Properties for project '{0}'", project.FullPath);
+ Log.Debug("-----------------------------------------------------------");
- string outputType = project.GetProperty("OutputType").EvaluatedValue;
- if (outputType.Contains("Exe") || outputType.Contains("WinExe"))
+ foreach (var property in project.Properties)
{
- extension = ".exe";
+ Log.Debug(" {0} => {1} ({2})", property.Name, property.EvaluatedValue, property.UnevaluatedValue);
}
- var projectOutputPath = project.GetPropertyValue("OutputPath");
- var outputPath = Path.Combine(project.DirectoryPath, projectOutputPath);
- return Path.Combine(outputPath, string.Format("{0}{1}", project.GetProperty("AssemblyName").EvaluatedValue, extension));
+ Log.Debug("");
+ Log.Debug("");
}
}
}
\ No newline at end of file
diff --git a/src/GitLink/GitLink.csproj b/src/GitLink/GitLink.csproj
index 7262f55..a3fb7aa 100644
--- a/src/GitLink/GitLink.csproj
+++ b/src/GitLink/GitLink.csproj
@@ -1,5 +1,6 @@
+
Debug
@@ -12,7 +13,7 @@
v4.5
512
- 9be2d35b
+ 12b4af1a
true
@@ -46,16 +47,17 @@
Resources\Icons\Logo.ico
-
+
False
- ..\..\lib\Catel.Core.4.0.0-unstable0497\lib\net45\Catel.Core.dll
+ ..\..\lib\Catel.Core.4.1.0-unstable0030\lib\net45\Catel.Core.dll
-
- ..\..\lib\Catel.Fody.2.3.0-unstable0031\lib\portable-net4+sl4+wp7+win8+wpa81+MonoAndroid14+MonoTouch40\Catel.Fody.Attributes.dll
+
+ False
+ ..\..\lib\Catel.Fody.2.4.0-unstable0001\lib\portable-net4+sl4+wp7+win8+wpa81+MonoAndroid14+MonoTouch40\Catel.Fody.Attributes.dll
-
+
False
- ..\..\lib\LibGit2Sharp.0.19.0.0\lib\net40\LibGit2Sharp.dll
+ ..\..\lib\LibGit2Sharp.0.20.1.0\lib\net40\LibGit2Sharp.dll
@@ -114,8 +116,8 @@
-
-
+
+
Designer
@@ -125,13 +127,14 @@
-
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}.
-
+
+
+