3

I have cake file that I want to run in Windows and Ubuntu.

In Windows we need Cake.EntityFramework addin and in Ubuntu we do not need it.

So I want to write some platform specific addin like below

#if WINDOWS
#addin nuget:?package=Cake.EntityFramework&version=0.3.0
#endif

But I do not know how to do it?

Dharman
  • 30,962
  • 25
  • 85
  • 135
sorosh_sabz
  • 2,356
  • 2
  • 32
  • 53

1 Answers1

1

Cake pre-processing for #addin, #tool, #load, #module, etc. does not support conditionals (#if). I'd suggest splitting your Cake files to multiple, one windows.cake, one linux.cake and one shared.cake. You can load shared logic using the #load directive.

bjorkstromm
  • 423
  • 2
  • 5