-
-
Notifications
You must be signed in to change notification settings - Fork 731
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
Refactor ICakeEnvironment #502
Comments
This sounds like a good idea to me, your reasoning seems sound to me. Agree with the breaking change, and would think this would bump to 0.7.0, not as a patch version. |
It might be worth looking at the CoreFX APIs to get this information. A lot of the APIs that are used currently doesn't existing in this new world. This might be a place where you'd have to #ifdef and have two implementations of |
System.Runtime.InteropServices and many others are on NuGet so those bridge the gap between Core & Standard CLR features sets. Probably worth obsoleting stuff and then later remove if no one compains 😉 |
Sure, if you don't mind that dependency on full CLR 😄 |
AFAIK you'd on .NETCore 5.0 add dependencies to
|
As discussed on Gitter For child processes we could probably add an environment dictionary property to ToolSetting and ProcessSettings that optionally passed along to ProcessStartInfo.Environment Something we could look at during the |
A related issue which should be tackled at the same time... #902 |
Right now,
ICakeEnvironment
is kind of a mess, mixing properties and methods for things.I'm also not a fan of IsUnix-property which I think could be more fine grained i.e. we could add a OperatingSystem enum that gives more information such as Windows, OSX, Linux etc. We could even make this a flags enum and add additional more finegrained information such as what operating system, but not sure if that would be useful.
I would suggest that we make some changes.
It would make sense to introduce something like
IPlatform
that could keep information about OS and hardware. The ICakeEnvironment have a tendency to become a dumping ground for everything environment related and this would mean that we would keep platform specific stuff isolated.bool Is64BitOperativeSystem()
toIPlatform
bool IsUnix()
toIPlatform
DirectoryPath GetApplicationRoot();
toDirectoryPath ApplicationRoot { get; }
IPlatform Platform { get; }
Not sure if we should expose the enum directly, or expose a class that
contains information about the operating system (type/flavor, name, version) etc.
Not sure if this information would be of interest to Cake users.
NOTE: Since this is a breaking change, we wouldn't actually remove the methods but mark them as obsolete and remove them sometime in the future.
I will glady do this changes if you let me 😄
The text was updated successfully, but these errors were encountered: