kevicency / MSBuild.NodeTools

Run various node tools as a MSBuild dependency
BSD 3-Clause "New" or "Revised" License
64 stars 14 forks source link

Packages incompatible with non-windows #26

Open iskiselev opened 9 years ago

iskiselev commented 9 years ago

In Grunt, Gulp and Bower packages hardcoded ".cmd" in command file name. It is incompatible with Linux - there will be no extension for commands at all.

As Node/Npm packages use commands without .cmd extension, they correctly works on Linux (if $NodeJS environment variable provided).

kevicency commented 9 years ago

I guess there are more issues than the hard-coded .cmd when it comes to getting this to work on Linux. I also don't plan on adding support for it, but you are free to add a pull request :)

iskiselev commented 9 years ago

I was able to run everything else on Unix when I removed .cmd and check for presence of files.

kevicency commented 9 years ago

Interesting. Guess it works when it doesn't try to find the executables using where.exe. Do you know a way to find out which OS MSBuild is running on?

iskiselev commented 9 years ago

Something like:

  <PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
    <DefineConstants>$(DefineConstants);WINDOWS</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(OS)' == 'Unix' ">
    <DefineConstants>$(DefineConstants);UNIX</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(OS)' == 'OSX' ">
    <DefineConstants>$(DefineConstants);OSX</DefineConstants>
  </PropertyGroup>
iskiselev commented 9 years ago

Here is my modified version of targets: https://github.com/sq/JSIL/tree/master/JSIL.Libraries/Targets Here you can look on logs of executing them successfully on Unix: https://travis-ci.org/iskiselev/JSIL/builds/80366771

iskiselev commented 9 years ago

In Unix call to where,exe probably should be replaced with which