Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH899: Copy directory structure #1145

Merged
merged 1 commit into from
Oct 27, 2016

Conversation

martinscholz83
Copy link
Contributor

fix #899

Here is an approach to keep the folder structure for CopyFiles. I add some new overloads. Yet only for patterns.

@dnfclas
Copy link

dnfclas commented Aug 10, 2016

Hi @maddin2016, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.

TTYL, DNFBOT;

@martinscholz83
Copy link
Contributor Author

Hi there, is this request from interest or can close this?

@gep13
Copy link
Member

gep13 commented Aug 22, 2016

@maddin2016 said...
Hi there, is this request from interest or can close this?

I don't think any of the team have had a chance to look at this yet, but that doesn't mean that we are not interested, just that we are busy elsewhere. In order to help with reviewing this, would it be possible for you to rebase on the latest develop branch, and also fix up the build errors that are associated with this PR?

@devlead
Copy link
Member

devlead commented Aug 22, 2016

@maddin2016 sorry for not getting back to you sooner, currently we're fully focused on releasing Cake.CoreCLR for the v0.16.0 release so we haven't had an chance to review this yet. I can see the all CI servers failed could you look at attending that?

@martinscholz83
Copy link
Contributor Author

Hi @gep13 @devlead, no problem. This was more a kind of reminder, not a critic 😅. I update my branch and see why these tests are failing.

@devlead
Copy link
Member

devlead commented Aug 22, 2016

@maddin2016 looks like your not mocking filesystem and doing operations against the actual file system, so that could be an lead what's failing, see here:
https://travis-ci.org/cake-build/cake/jobs/151194860#L1202

@martinscholz83
Copy link
Contributor Author

martinscholz83 commented Aug 22, 2016

@gep13 @devlead can you please look what's wrong with that bitrise ci. Thanks.

@gep13
Copy link
Member

gep13 commented Aug 22, 2016

    Cake.Common.Tests.Unit.IO.FileAliasesTests+TheCopyFilesMethod+WithGlobExpression.Should_Keep_Folder_Structure [FAIL]
      System.UnauthorizedAccessException : Access to the path "/Working" is denied.
      Stack Trace:
          at System.IO.Directory.CreateDirectoriesInternal (System.String path) <0x1a233e0 + 0x00148> in <filename unknown>:0 
          at System.IO.Directory.CreateDirectory (System.String path) <0x1a231d0 + 0x000c7> in <filename unknown>:0 
          at System.IO.DirectoryInfo.Create () <0x1a25690 + 0x00020> in <filename unknown>:0 
          at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:Create ()
          at System.IO.Directory.CreateDirectoriesInternal (System.String path) <0x1a233e0 + 0x000f9> in <filename unknown>:0 
          at System.IO.Directory.CreateDirectory (System.String path) <0x1a231d0 + 0x000c7> in <filename unknown>:0 
          at Cake.Common.IO.FileCopier.CopyFileCore (ICakeContext context, Cake.Core.IO.FilePath filePath, Cake.Core.IO.FilePath targetFilePath, System.String commonPath, System.String targetDirectoryPath) <0x422f218 + 0x001ff> in <filename unknown>:0 
          at Cake.Common.IO.FileCopier.CopyFiles (ICakeContext context, IEnumerable`1 filePaths, Cake.Core.IO.DirectoryPath targetDirectoryPath, Boolean preserverFolderStructure) <0x3a44350 + 0x003ef> in <filename unknown>:0 
          at Cake.Common.IO.FileCopier.CopyFiles (ICakeContext context, System.String pattern, Cake.Core.IO.DirectoryPath targetDirectoryPath, Boolean preserverFolderStructure) <0x422ccb8 + 0x000c3> in <filename unknown>:0 
          at Cake.Common.IO.FileAliases.CopyFiles (ICakeContext context, System.String pattern, Cake.Core.IO.DirectoryPath targetDirectoryPath, Boolean preserveFolderStructure) <0x422cc80 + 0x00027> in <filename unknown>:0 
          at Cake.Common.Tests.Unit.IO.FileAliasesTests+TheCopyFilesMethod+WithGlobExpression.Should_Keep_Folder_Structure () <0x422dcb0 + 0x00067> in <filename unknown>:0 
          at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
          at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x1a7ea40 + 0x000a1> in <filename unknown>:0 

@martinscholz83
Copy link
Contributor Author

martinscholz83 commented Aug 22, 2016

Is this OSX specific? Because all other tests passes.

@patriksvensson
Copy link
Member

@maddin2016 You need to use FakeFileSystem when writing unit tests against the file system since they shouldn't touch the actual file system.

@martinscholz83
Copy link
Contributor Author

Mmh, that test Should_Keep_Folder_Structure is only a copy of Should_Copy_Files. So i don't understand why it's not pass. Have i forgot something?
https://github.com/maddin2016/cake/blob/copy-directory-structure/src/Cake.Common.Tests/Unit/IO/FileAliasesTests.cs#L308

@martinscholz83
Copy link
Contributor Author

i have commented above that this test is only a placeholder because currently it is not possible to simulate this test.

var newAbsoluteTargetPath = newTargetPath + @"/" + filePath.GetFilename();
context.Log.Verbose("Copying file {0} to {1}", absoluteFilePath.GetFilename(), newAbsoluteTargetPath);

if (!Directory.Exists(newTargetPath))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not use System.IO here. Use the IFileSystem available on the provided context.

@patriksvensson
Copy link
Member

@maddin2016 I reviewed the code in the current state and left some comments for you.

@devlead
Copy link
Member

devlead commented Aug 22, 2016

@maddin2016 your using System.IO directly in a few places instead of Cake's abstractions, this is undesired not only because of tests but also makes it impossible to replace functionality via Cake's module support like i.e. the Cake LongPath Module does.

A couple of places:

Use IFileySystem GetDirectory available as FileSystem on ICakeContext

IDirectory exposes an Exists via the IFileSystemInfo interface.

IDirectory aslo exposes an Create method.

DirectoryPath provides an GetDirectoryName()

@martinscholz83
Copy link
Contributor Author

Thanks for that tips!!!

@martinscholz83
Copy link
Contributor Author

martinscholz83 commented Aug 22, 2016

To do

  • use imperative code for get common path

@martinscholz83
Copy link
Contributor Author

@patriksvensson, can you please have a look at my last commits. Thanks!

@patriksvensson
Copy link
Member

@maddin2016 I'm busy until Monday evening but perhaps someone else in the @cake-build/team can take a look at this tomorrow or during the weekend.

@gep13 gep13 changed the title Copy directory structure GH899: Copy directory structure Aug 29, 2016
@martinscholz83
Copy link
Contributor Author

Hi @patriksvensson, do you had the chance to look at the commits?

@devlead
Copy link
Member

devlead commented Oct 20, 2016

@maddin2016 would you be in a position to squash commits and rebase against latest develop?

@martinscholz83
Copy link
Contributor Author

No problem. Should i squash into one commit?

@gep13
Copy link
Member

gep13 commented Oct 20, 2016

@maddin2016 if you could, yes, that would be great.

@martinscholz83 martinscholz83 force-pushed the copy-directory-structure branch 2 times, most recently from 4bcafc4 to 6df96dc Compare October 21, 2016 08:49
@martinscholz83
Copy link
Contributor Author

Looks like there is some encoding problem with tests!? And i struggle currently with another problem. If i try to use cake.exe with the following script

Task("A")
    .Does(() => 
{
    CopyFiles("D:/bower_components/**/*.js", "D:\\TestCake");
});

RunTarget("A");

i get the following error error CS1501: No overload for method 'CopyFiles' takes 2 arguments.
It only works if i explicit set the false or true. But CopyFiles has set bool preserveFolderStructure = false???

@devlead
Copy link
Member

devlead commented Oct 21, 2016

@maddin2016
image
Your code works in 16.2 so I assume it's some overload resolution issue introduced in this PR?

As we already have CopyFiles(IEnumerable<FilePath>, ​DirectoryPath)​ and CopyFiles(IEnumerable<string>, ​DirectoryPath)​ preserveFolderStructure parameter should be in a new overload without default value to not break ABI. Existing aliases can be reduced internally to just call into new alias with false to preserve behaviour and reduce code duplication.

@martinscholz83
Copy link
Contributor Author

@devlead

preserveFolderStructure parameter should be in a new overload without default value to not break ABI

That's because i have set them with a default value so you can still use the overloads as before. But apparently that is not working 😕 So i will add the old overloads an let them call the new one's with default false.

@martinscholz83
Copy link
Contributor Author

martinscholz83 commented Oct 21, 2016

The new Overloads are
public static void CopyFiles(this ICakeContext context, IEnumerable<FilePath> filePaths, DirectoryPath targetDirectoryPath, bool preserveFolderStructure = false)

public static void CopyFiles(this ICakeContext context, string pattern, DirectoryPath targetDirectoryPath, bool preserveFolderStructure = false)

and

public static void CopyFiles(this ICakeContext context, IEnumerable<string> filePaths, DirectoryPath targetDirectoryPath, bool preserveFolderStructure = false)

So why i'm not able to call CopyFiles("C:/source/**/*.js", "C:\\Destination");. Is there something i forgot?With this approach we dont't break the API and have less code.

@devlead
Copy link
Member

devlead commented Oct 21, 2016

@maddin2016 Removing the old methods and adding new ones with an optional parameter will break application binary compatibility with aany addin/module/application/etc. depending on those methods.

To not do that add new methods with the bool preserveFolderStructure parameter (without any default value) and have the old ones just call the new ones with it set to false.

If you do this it will just work and you won't break existing addins/modules/applications as old method IL signature will still exist.

@martinscholz83
Copy link
Contributor Author

It maybe that this error comes from Roslyn compiler? Error happens when evaluate the script https://github.com/cake-build/cake/blob/develop/src/Cake/Scripting/XPlat/DefaultXPlatScriptSession.cs#L40

I have tested it with a dummy Alias

        [CakeMethodAlias]
        [CakeAliasCategory("Copy")]
        public static void CopyTest(this ICakeContext context, bool test = false)
        {
            var str = "";
        }

If you not explicitly set the parameter CopyTest(false); it returns an error.

@martinscholz83
Copy link
Contributor Author

@devlead, i didn't see your comment. Ok, i will revert my changes and add the new overloads in addition.

@devlead
Copy link
Member

devlead commented Oct 21, 2016

@maddin2016 excellent 👍

@martinscholz83 martinscholz83 force-pushed the copy-directory-structure branch 2 times, most recently from ee2699b to 81e79b3 Compare October 24, 2016 07:06
@devlead
Copy link
Member

devlead commented Oct 25, 2016

@maddin2016 could you please rebase against latest develop so we can do a final review before merging.
If you like you could enable maintainer permission on this PR, that way we could rebase for you if any PR is merged before yours.
(it's a recent GitHub feature you can read more about at
Enabling repository maintainer permissions on existing pull requests )

Copy link
Member

@devlead devlead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I've rebased against latest develop, omitted the changes to project.json files and I'll merge as soon as CI passes.

@devlead devlead merged commit 12fd0ed into cake-build:develop Oct 27, 2016
@devlead
Copy link
Member

devlead commented Oct 27, 2016

@maddin2016 your changes have now been merged, thanks for contributing! 👍

@martinscholz83
Copy link
Contributor Author

Your'e welcome 👍

@sdebruyn
Copy link

sdebruyn commented May 4, 2018

How does this exactly work?
E.g. I have this tree, how should I use this method?

  • /Users/sam/code/repos/sample/branding/StarkIndustries/SubProject1/Settings.cs
  • /Users/sam/code/repos/sample/branding/StarkIndustries/SubProject2/Theming.xaml
  • /Users/sam/code/repos/sample/branding/WillyWonkaFactories/SubProject1/Settings.cs
  • /Users/sam/code/repos/sample/branding/WillyWonkaFactories/SubProject2/Theming.xaml
  • /Users/sam/code/repos/sample/source/SubProject1/Settings.cs
  • /Users/sam/code/repos/sample/source/SubProject2/Theming.xaml

I'd like to overwrite the 2 files in the source directory with the ones in the branding directory. I tried to do this and I get the following stacktrace:

Error: System.AggregateException: One or more errors occurred. ---> System.ArgumentException: Path cannot be empty.
Parameter name: path
  at Cake.Core.IO.Path..ctor (System.String path) [0x0001c] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
  at Cake.Core.IO.DirectoryPath..ctor (System.String path) [0x00000] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
  at Cake.Core.IO.DirectoryPath.FromString (System.String path) [0x00000] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
  at Cake.Core.IO.DirectoryPath.op_Implicit (System.String path) [0x00000] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
  at Cake.Common.IO.FileCopier.CopyFiles (Cake.Core.ICakeContext context, System.Collections.Generic.IEnumerable`1[T] filePaths, Cake.Core.IO.DirectoryPath targetDirectoryPath, System.Boolean preserverFolderStructure) [0x001aa] in <bbaccdf2f4564aaf9ac28e107ced2586>:0
  at Cake.Common.IO.FileAliases.CopyFiles (Cake.Core.ICakeContext context, System.Collections.Generic.IEnumerable`1[T] filePaths, Cake.Core.IO.DirectoryPath targetDirectoryPath, System.Boolean preserveFolderStructure) [0x00000] in <bbaccdf2f4564aaf9ac28e107ced2586>:0
  at x3factr.Cake.MultiBranding.BrandingHelper.CopyFiles (Cake.Core.ICakeContext context, x3factr.Cake.MultiBranding.BrandingSettings brandingSettings) [0x00053] in <723aba783a5b4b6c985d8a370781b026>:0
  at x3factr.Cake.MultiBranding.Aliases.SetBranding (Cake.Core.ICakeContext context, x3factr.Cake.MultiBranding.BrandingSettings brandingSettings) [0x00077] in <723aba783a5b4b6c985d8a370781b026>:0
  at Submission#0.SetBranding (x3factr.Cake.MultiBranding.BrandingSettings brandingSettings) [0x0000c] in <dd21b53267e3407caceae8f2282f9127>:0
  at Submission#0.<<Initialize>>b__0_15 () [0x000f7] in <dd21b53267e3407caceae8f2282f9127>:0
  at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass6_0.<Does>b__0 (Cake.Core.ICakeContext context) [0x00000] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
  at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass8_0.<Does>b__0 (Cake.Core.ICakeContext x) [0x00000] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
  at Cake.Core.ActionTask+<Execute>d__14.MoveNext () [0x00066] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <e22c1963d07746cd9708456620d50e1a>:0
  at Cake.Core.DefaultExecutionStrategy+<ExecuteAsync>d__4.MoveNext () [0x000ee] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <e22c1963d07746cd9708456620d50e1a>:0
  at Cake.Core.CakeEngine+<ExecuteTaskAsync>d__29.MoveNext () [0x00131] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <e22c1963d07746cd9708456620d50e1a>:0
  at Cake.Core.CakeEngine+<RunTargetAsync>d__18.MoveNext () [0x00235] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <e22c1963d07746cd9708456620d50e1a>:0
  at Cake.Scripting.BuildScriptHost+<RunTargetAsync>d__3.MoveNext () [0x0008d] in <f2dfd1d7ff874bb5925674ed0d0fc83d>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <e22c1963d07746cd9708456620d50e1a>:0
  at Cake.Core.Scripting.ScriptHost.RunTarget (System.String target) [0x0000d] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
  at Submission#0+<<Initialize>>d__0.MoveNext () [0x007eb] in <dd21b53267e3407caceae8f2282f9127>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <e22c1963d07746cd9708456620d50e1a>:0
  at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState+<RunSubmissionsAsync>d__9`1[TResult].MoveNext () [0x00186] in <7d37a385ddd24eeb96bd540d739cc157>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <e22c1963d07746cd9708456620d50e1a>:0
  at Microsoft.CodeAnalysis.Scripting.Script`1+<RunSubmissionsAsync>d__21[T].MoveNext () [0x000a8] in <7d37a385ddd24eeb96bd540d739cc157>:0
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Threading.Tasks.Task.Wait () [0x00000] in <e22c1963d07746cd9708456620d50e1a>:0
  at Cake.Scripting.Roslyn.RoslynScriptSession.Execute (Cake.Core.Scripting.Script script) [0x001a7] in <f2dfd1d7ff874bb5925674ed0d0fc83d>:0
  at Cake.Core.Scripting.ScriptRunner.Run (Cake.Core.Scripting.IScriptHost host, Cake.Core.IO.FilePath scriptPath, System.Collections.Generic.IDictionary`2[TKey,TValue] arguments) [0x00358] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
  at Cake.Commands.BuildCommand.Execute (Cake.CakeOptions options) [0x00026] in <f2dfd1d7ff874bb5925674ed0d0fc83d>:0
  at Cake.CakeApplication.Run (Cake.CakeOptions options) [0x00015] in <f2dfd1d7ff874bb5925674ed0d0fc83d>:0
  at Cake.Program.Main () [0x000d1] in <f2dfd1d7ff874bb5925674ed0d0fc83d>:0
---> (Inner Exception #0) System.ArgumentException: Path cannot be empty.
Parameter name: path
  at Cake.Core.IO.Path..ctor (System.String path) [0x0001c] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
  at Cake.Core.IO.DirectoryPath..ctor (System.String path) [0x00000] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
  at Cake.Core.IO.DirectoryPath.FromString (System.String path) [0x00000] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
  at Cake.Core.IO.DirectoryPath.op_Implicit (System.String path) [0x00000] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
  at Cake.Common.IO.FileCopier.CopyFiles (Cake.Core.ICakeContext context, System.Collections.Generic.IEnumerable`1[T] filePaths, Cake.Core.IO.DirectoryPath targetDirectoryPath, System.Boolean preserverFolderStructure) [0x001aa] in <bbaccdf2f4564aaf9ac28e107ced2586>:0
  at Cake.Common.IO.FileAliases.CopyFiles (Cake.Core.ICakeContext context, System.Collections.Generic.IEnumerable`1[T] filePaths, Cake.Core.IO.DirectoryPath targetDirectoryPath, System.Boolean preserveFolderStructure) [0x00000] in <bbaccdf2f4564aaf9ac28e107ced2586>:0
  at x3factr.Cake.MultiBranding.BrandingHelper.CopyFiles (Cake.Core.ICakeContext context, x3factr.Cake.MultiBranding.BrandingSettings brandingSettings) [0x00053] in <723aba783a5b4b6c985d8a370781b026>:0
  at x3factr.Cake.MultiBranding.Aliases.SetBranding (Cake.Core.ICakeContext context, x3factr.Cake.MultiBranding.BrandingSettings brandingSettings) [0x00077] in <723aba783a5b4b6c985d8a370781b026>:0
  at Submission#0.SetBranding (x3factr.Cake.MultiBranding.BrandingSettings brandingSettings) [0x0000c] in <dd21b53267e3407caceae8f2282f9127>:0
  at Submission#0.<<Initialize>>b__0_15 () [0x000f7] in <dd21b53267e3407caceae8f2282f9127>:0
  at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass6_0.<Does>b__0 (Cake.Core.ICakeContext context) [0x00000] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
  at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass8_0.<Does>b__0 (Cake.Core.ICakeContext x) [0x00000] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
  at Cake.Core.ActionTask+<Execute>d__14.MoveNext () [0x00066] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <e22c1963d07746cd9708456620d50e1a>:0
  at Cake.Core.DefaultExecutionStrategy+<ExecuteAsync>d__4.MoveNext () [0x000ee] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <e22c1963d07746cd9708456620d50e1a>:0
  at Cake.Core.CakeEngine+<ExecuteTaskAsync>d__29.MoveNext () [0x00131] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <e22c1963d07746cd9708456620d50e1a>:0
  at Cake.Core.CakeEngine+<RunTargetAsync>d__18.MoveNext () [0x00235] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <e22c1963d07746cd9708456620d50e1a>:0
  at Cake.Scripting.BuildScriptHost+<RunTargetAsync>d__3.MoveNext () [0x0008d] in <f2dfd1d7ff874bb5925674ed0d0fc83d>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <e22c1963d07746cd9708456620d50e1a>:0
  at Cake.Core.Scripting.ScriptHost.RunTarget (System.String target) [0x0000d] in <bf8648e2e0a54f859ebcbb1728e8c9cf>:0
  at Submission#0+<<Initialize>>d__0.MoveNext () [0x007eb] in <dd21b53267e3407caceae8f2282f9127>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <e22c1963d07746cd9708456620d50e1a>:0
  at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState+<RunSubmissionsAsync>d__9`1[TResult].MoveNext () [0x00186] in <7d37a385ddd24eeb96bd540d739cc157>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <e22c1963d07746cd9708456620d50e1a>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in <e22c1963d07746cd9708456620d50e1a>:0
  at Microsoft.CodeAnalysis.Scripting.Script`1+<RunSubmissionsAsync>d__21[T].MoveNext () [0x000a8] in <7d37a385ddd24eeb96bd540d739cc157>:0 <---

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CopyFiles doesn't respect source directory structure
6 participants