From e92d99c923f1cb3506957911d57fe7aee2747065 Mon Sep 17 00:00:00 2001 From: Andy Ford Date: Sun, 20 Feb 2022 18:52:53 +0000 Subject: [PATCH 1/3] Dotnet 6, create folders --- src/Compiler/Compiler.csproj | 2 +- src/Compiler/Output/OutputFileStreamFactory.cs | 3 ++- src/CompilerCli/CompilerCli.csproj | 2 +- tests/CompilerCliTest/CompilerCliTest.csproj | 2 +- tests/CompilerTest/CompilerTest.csproj | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Compiler/Compiler.csproj b/src/Compiler/Compiler.csproj index ff94616a..46f5b622 100644 --- a/src/Compiler/Compiler.csproj +++ b/src/Compiler/Compiler.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 AnyCPU;x64;x86 diff --git a/src/Compiler/Output/OutputFileStreamFactory.cs b/src/Compiler/Output/OutputFileStreamFactory.cs index 43f877dd..5cd1b244 100644 --- a/src/Compiler/Output/OutputFileStreamFactory.cs +++ b/src/Compiler/Output/OutputFileStreamFactory.cs @@ -6,7 +6,8 @@ public class OutputFileStreamFactory: IOutputStreamFactory { public TextWriter Make(string file) { + Directory.CreateDirectory(Path.GetDirectoryName(file)!); return new StreamWriter(file); } } -} \ No newline at end of file +} diff --git a/src/CompilerCli/CompilerCli.csproj b/src/CompilerCli/CompilerCli.csproj index c077ef90..476c6159 100644 --- a/src/CompilerCli/CompilerCli.csproj +++ b/src/CompilerCli/CompilerCli.csproj @@ -2,7 +2,7 @@ Exe - net5.0 + net6.0 AnyCPU;x64;x86 diff --git a/tests/CompilerCliTest/CompilerCliTest.csproj b/tests/CompilerCliTest/CompilerCliTest.csproj index 59059a87..d0c0a883 100644 --- a/tests/CompilerCliTest/CompilerCliTest.csproj +++ b/tests/CompilerCliTest/CompilerCliTest.csproj @@ -2,7 +2,7 @@ Exe - net5.0 + net6.0 AnyCPU;x64;x86 diff --git a/tests/CompilerTest/CompilerTest.csproj b/tests/CompilerTest/CompilerTest.csproj index b0521714..f97c7a4c 100644 --- a/tests/CompilerTest/CompilerTest.csproj +++ b/tests/CompilerTest/CompilerTest.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 AnyCPU;x64;x86 warnings From c05a3562f4b82a78db4f7eab41b44d5e33df3bce Mon Sep 17 00:00:00 2001 From: Andy Ford Date: Sun, 20 Feb 2022 19:00:34 +0000 Subject: [PATCH 2/3] Back to dotnet 5 --- src/Compiler/Compiler.csproj | 2 +- src/CompilerCli/CompilerCli.csproj | 2 +- tests/CompilerCliTest/CompilerCliTest.csproj | 2 +- tests/CompilerTest/CompilerTest.csproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Compiler/Compiler.csproj b/src/Compiler/Compiler.csproj index 46f5b622..ff94616a 100644 --- a/src/Compiler/Compiler.csproj +++ b/src/Compiler/Compiler.csproj @@ -1,7 +1,7 @@ - net6.0 + net5.0 AnyCPU;x64;x86 diff --git a/src/CompilerCli/CompilerCli.csproj b/src/CompilerCli/CompilerCli.csproj index 476c6159..c077ef90 100644 --- a/src/CompilerCli/CompilerCli.csproj +++ b/src/CompilerCli/CompilerCli.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net5.0 AnyCPU;x64;x86 diff --git a/tests/CompilerCliTest/CompilerCliTest.csproj b/tests/CompilerCliTest/CompilerCliTest.csproj index d0c0a883..59059a87 100644 --- a/tests/CompilerCliTest/CompilerCliTest.csproj +++ b/tests/CompilerCliTest/CompilerCliTest.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net5.0 AnyCPU;x64;x86 diff --git a/tests/CompilerTest/CompilerTest.csproj b/tests/CompilerTest/CompilerTest.csproj index f97c7a4c..b0521714 100644 --- a/tests/CompilerTest/CompilerTest.csproj +++ b/tests/CompilerTest/CompilerTest.csproj @@ -1,7 +1,7 @@  - net6.0 + net5.0 AnyCPU;x64;x86 warnings From 3ea910cd530b280c30d1fb47c336eeb65b301bb1 Mon Sep 17 00:00:00 2001 From: Andy Ford Date: Sun, 20 Feb 2022 19:12:24 +0000 Subject: [PATCH 3/3] Fix test --- src/Compiler/Output/OutputFileStreamFactory.cs | 2 +- src/Compiler/Output/OutputWriterFactory.cs | 5 +++-- tests/CompilerTest/Output/OutputFileStreamFactoryTest.cs | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Compiler/Output/OutputFileStreamFactory.cs b/src/Compiler/Output/OutputFileStreamFactory.cs index 5cd1b244..99f59a4c 100644 --- a/src/Compiler/Output/OutputFileStreamFactory.cs +++ b/src/Compiler/Output/OutputFileStreamFactory.cs @@ -2,7 +2,7 @@ namespace Compiler.Output { - public class OutputFileStreamFactory: IOutputStreamFactory + public class OutputFileStreamFactory : IOutputStreamFactory { public TextWriter Make(string file) { diff --git a/src/Compiler/Output/OutputWriterFactory.cs b/src/Compiler/Output/OutputWriterFactory.cs index fbe7330f..465136db 100644 --- a/src/Compiler/Output/OutputWriterFactory.cs +++ b/src/Compiler/Output/OutputWriterFactory.cs @@ -1,4 +1,5 @@ -using Compiler.Argument; +using System.IO; +using Compiler.Argument; using Compiler.Transformer; namespace Compiler.Output @@ -13,4 +14,4 @@ public static OutputWriter Make(CompilerArguments arguments, string file, IOutpu ); } } -} \ No newline at end of file +} diff --git a/tests/CompilerTest/Output/OutputFileStreamFactoryTest.cs b/tests/CompilerTest/Output/OutputFileStreamFactoryTest.cs index f0984793..3bbcbcca 100644 --- a/tests/CompilerTest/Output/OutputFileStreamFactoryTest.cs +++ b/tests/CompilerTest/Output/OutputFileStreamFactoryTest.cs @@ -9,7 +9,7 @@ public class OutputFileStreamFactoryTest [Fact] public void TestItReturnsStreamWriter() { - Assert.IsType(new OutputFileStreamFactory().Make("test")); + Assert.IsType(new OutputFileStreamFactory().Make("foo/test")); } } -} \ No newline at end of file +}