diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-09 18:07:56 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-05-09 18:07:56 +0300 |
| commit | e1236499b485a69648bea4d7871aa185e5dae745 (patch) | |
| tree | 8cd4ccd7d272c8c4e61d4bd6bcba434eb9522b85 /Software/Visual_Studio/Tango.Protobuf/Compilers | |
| parent | 2a459c79e90a2ade3f1dac1ae4541c0f4d74965c (diff) | |
| download | Tango-e1236499b485a69648bea4d7871aa185e5dae745.tar.gz Tango-e1236499b485a69648bea4d7871aa185e5dae745.zip | |
New TemporaryManager !
Diffstat (limited to 'Software/Visual_Studio/Tango.Protobuf/Compilers')
| -rw-r--r-- | Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs b/Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs index fa0f130ac..1a8dc632f 100644 --- a/Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs +++ b/Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.Core.Helpers; +using Tango.Core.IO; namespace Tango.Protobuf.Compilers { @@ -49,12 +50,12 @@ namespace Tango.Protobuf.Compilers /// </returns> public override CompilerFolderResult CompileFolder(string sourceFolder, params String[] includeFolders) { - String temp = PathHelper.GetTempFolderPath(); - PathHelper.CopyDirectory(sourceFolder, temp, true); + var temp = TemporaryManager.Default.CreateFolder(); + PathHelper.CopyDirectory(sourceFolder, temp.Path, true); List<String> directories = Directory.GetDirectories(sourceFolder, "*", SearchOption.AllDirectories).Where(x => includeFolders == null || includeFolders.Length == 0 || includeFolders.Contains(Path.GetFileName(x))).ToList(); - foreach (var dir in Directory.GetDirectories(temp)) + foreach (var dir in Directory.GetDirectories(temp.Path)) { if (!directories.Select(x => Path.GetFileName(x)).Contains(Path.GetFileName(dir))) { @@ -62,7 +63,7 @@ namespace Tango.Protobuf.Compilers } } - foreach (var file in Directory.GetFiles(temp, "*.proto", SearchOption.AllDirectories)) + foreach (var file in Directory.GetFiles(temp.Path, "*.proto", SearchOption.AllDirectories)) { String str = File.ReadAllText(file); @@ -77,7 +78,7 @@ namespace Tango.Protobuf.Compilers File.WriteAllText(file, str); } - return base.CompileFolder(temp); + return base.CompileFolder(temp.Path); } } } |
