Skip to content

Commit

Permalink
make project buildable on MacOS + fix a couple of issues
Browse files Browse the repository at this point in the history
Merge-request: TC-MR-4775
Merged-by: Vladislav Grinin <Vladislav.Grinin@jetbrains.com>
  • Loading branch information
lesley29 authored and qodana-bot committed Apr 14, 2023
1 parent 7e21894 commit f504b2c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
6 changes: 5 additions & 1 deletion TeamCity.CSharpInteractive.HostApi/DotNetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ public IStartInfo GetStartInfo(IHost host)
.AddArgs(
("--settings", Settings),
("--filter", Filter),
("--test-adapter-path", $"{string.Join(';', new[]{TestAdapterPath, virtualContext.Resolve(settings.DotNetVSTestLoggerDirectory)}.Where(i => !string.IsNullOrWhiteSpace(i)))}"),
("--test-adapter-path", $"{string.Join(';', new[]
{
TestAdapterPath,
virtualContext.Resolve(settings.DotNetVSTestLoggerDirectory)
}.Where(i => !string.IsNullOrWhiteSpace(i)))}"),
("--configuration", Configuration),
("--framework", Framework),
("--runtime", Runtime),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void ShouldProvideLoadCommand()
var expectedResult = source.ToArray();

// Then
expectedResult.ShouldBe(new[] {"#load \"wd\\zx\\Abc\""});
expectedResult.ShouldBe(new[] {$"#load \"{fullPath}\""});
_workingDirectoryContext.Verify(i => i.CreateScope(source));
_workingDirectoryToken.Verify(i => i.Dispose());
}
Expand Down
12 changes: 9 additions & 3 deletions TeamCity.CSharpInteractive/Composer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ private static void Setup()
.Bind<IStdErr>().To(ctx => ctx.Resolve<ITeamCitySpecific<IStdErr>>().Instance)
.Bind<ILog<TT>>("Default").To<Log<TT>>()
.Bind<ILog<TT>>("TeamCity").To<TeamCityLog<TT>>()
.Bind<ILog<TT>>().To(ctx => ctx.Resolve<ITeamCitySpecific<ILog<TT>>>().Instance)
.Bind<ILog<TT>>().To(ctx => ctx.Resolve<ITeamCitySpecific<ILog<TT>>>().Instance);

DI.Setup()
.Bind<IFileSystem>().To<FileSystem>()
.Bind<IEnvironment>().Bind<IScriptContext>().Bind<IErrorContext>().Bind<ITraceSource>(typeof(Environment)).To<Environment>()
.Bind<ITeamCitySettings>().To<TeamCitySettings>()
Expand Down Expand Up @@ -88,7 +90,9 @@ private static void Setup()
.Bind<IScriptRunner>().As(Lifetime.Transient).To(ctx => ctx.Resolve<ISettings>().InteractionMode == InteractionMode.Interactive ? ctx.Resolve<IScriptRunner>(InteractionMode.Interactive) : ctx.Resolve<IScriptRunner>(InteractionMode.NonInteractive))
.Bind<ICommandSource>().To<CommandSource>()
.Bind<IStringService>().To<StringService>()
.Bind<IStatistics>().To<Statistics>()
.Bind<IStatistics>().To<Statistics>();

DI.Setup()
.Bind<IPresenter<IEnumerable<ITraceSource>>>().To<TracePresenter>()
.Bind<IPresenter<IStatistics>>().To<StatisticsPresenter>()
.Bind<IPresenter<CompilationDiagnostics>>().To<DiagnosticsPresenter>()
Expand All @@ -109,7 +113,9 @@ private static void Setup()
.Bind<IDockerSettings>().To<DockerSettings>()
.Bind<IBuildContext>("base").As(Lifetime.Transient).To<BuildContext>()
.Bind<IBuildContext>().As(Lifetime.Transient).To<ReliableBuildContext>()
.Bind<ITextToColorStrings>().To<TextToColorStrings>()
.Bind<ITextToColorStrings>().To<TextToColorStrings>();

DI.Setup()
.Bind<IFileExplorer>().To<FileExplorer>()
.Bind<IProcessOutputWriter>().To<ProcessOutputWriter>()
.Bind<IBuildMessageLogWriter>().To<BuildMessageLogWriter>()
Expand Down
2 changes: 1 addition & 1 deletion TeamCity.CSharpInteractive/Environment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public string GetPath(SpecialFolder specialFolder)
return specialFolder switch
{
SpecialFolder.Bin => GetBinDirectory(),
SpecialFolder.Temp => Path.GetFullPath(System.Environment.GetEnvironmentVariable("TMP") ?? Path.GetTempPath()),
SpecialFolder.Temp => Path.GetFullPath(System.Environment.GetEnvironmentVariable("TMPDIR") ?? Path.GetTempPath()),
SpecialFolder.ProgramFiles => "usr/local/share",
SpecialFolder.Script => GetScriptDirectory(),
SpecialFolder.Working => GetWorkingDirectory(),
Expand Down

0 comments on commit f504b2c

Please sign in to comment.