forked from cake-contrib/Cake.XCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
… & bump to Cake 1.1
- Loading branch information
1 parent
b4269b1
commit 331974a
Showing
11 changed files
with
122 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,62 @@ | ||
using System; | ||
using Cake.Core.IO; | ||
using Cake.Core; | ||
using System.Collections.Generic; | ||
using Cake.Core.Tooling; | ||
using Cake.Testing; | ||
|
||
namespace Cake.XCode.Tests.Fakes | ||
{ | ||
public class FakeCakeContext | ||
{ | ||
ICakeContext context; | ||
FakeLog log; | ||
DirectoryPath testsDir; | ||
|
||
public FakeCakeContext () | ||
{ | ||
testsDir = new DirectoryPath (System.IO.Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..")); | ||
|
||
var fileSystem = new FileSystem (); | ||
var environment = new FakeEnvironment (PlatformFamily.OSX); | ||
var globber = new Globber (fileSystem, environment); | ||
log = new FakeLog (); | ||
var args = new FakeCakeArguments (); | ||
var registry = new WindowsRegistry (); | ||
var toolRepo = new ToolRepository(environment); | ||
var config = new Core.Configuration.CakeConfigurationProvider(fileSystem, environment).CreateConfiguration(testsDir, new Dictionary<string, string>()); | ||
var toolResolutionStrategy = new ToolResolutionStrategy(fileSystem, environment, globber, config); | ||
var toolLocator = new ToolLocator(environment, toolRepo, toolResolutionStrategy); | ||
var processRunner = new ProcessRunner(fileSystem, environment, log, toolLocator, config); | ||
using Cake.Core; | ||
using Cake.Core.IO; | ||
using Cake.Core.Tooling; | ||
using Cake.Testing; | ||
using System; | ||
|
||
namespace Cake.XCode.Tests.Fakes | ||
{ | ||
public class FakeCakeContext | ||
{ | ||
readonly ICakeContext context; | ||
readonly FakeLog log; | ||
readonly DirectoryPath testsDir; | ||
|
||
public FakeCakeContext() | ||
{ | ||
testsDir = new DirectoryPath( | ||
System.IO.Path.GetFullPath(AppContext.BaseDirectory)); | ||
|
||
var fileSystem = new FileSystem(); | ||
log = new FakeLog(); | ||
var runtime = new CakeRuntime(); | ||
var platform = new FakePlatform(PlatformFamily.Windows); | ||
var environment = new CakeEnvironment(platform, runtime); | ||
var globber = new Globber(fileSystem, environment); | ||
|
||
var args = new FakeCakeArguments(); | ||
var registry = new WindowsRegistry(); | ||
|
||
var dataService = new FakeDataService(); | ||
context = new CakeContext(fileSystem, environment, globber, log, args, processRunner, registry, toolLocator, dataService, config); | ||
context.Environment.WorkingDirectory = testsDir; | ||
} | ||
|
||
public DirectoryPath WorkingDirectory { | ||
get { return testsDir; } | ||
} | ||
|
||
public ICakeContext CakeContext { | ||
get { return context; } | ||
} | ||
|
||
public string GetLogs () | ||
var toolRepository = new ToolRepository(environment); | ||
var config = new FakeConfiguration(); | ||
var toolResolutionStrategy = new ToolResolutionStrategy(fileSystem, environment, globber, config, log); | ||
IToolLocator tools = new ToolLocator(environment, toolRepository, toolResolutionStrategy); | ||
var processRunner = new ProcessRunner(fileSystem, environment, log, tools, config); | ||
context = new CakeContext(fileSystem, environment, globber, log, args, processRunner, registry, tools, dataService, config); | ||
context.Environment.WorkingDirectory = testsDir; | ||
} | ||
|
||
public DirectoryPath WorkingDirectory | ||
{ | ||
get { return testsDir; } | ||
} | ||
|
||
public ICakeContext CakeContext | ||
{ | ||
get { return context; } | ||
} | ||
|
||
public string GetLogs() | ||
{ | ||
return string.Join(Environment.NewLine, log.Messages); | ||
} | ||
|
||
public void DumpLogs () | ||
{ | ||
foreach (var m in log.Messages) | ||
Console.WriteLine (m); | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
public void DumpLogs() | ||
{ | ||
foreach (var m in log.Messages) | ||
Console.WriteLine(m); | ||
} | ||
} | ||
} | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.