NancyFx / Nancy

Lightweight, low-ceremony, framework for building HTTP based services on .Net and Mono
http://nancyfx.org
MIT License
7.15k stars 1.46k forks source link

Fix for nuget mono builds #1621

Closed bonesoul closed 8 years ago

bonesoul commented 10 years ago

Mono builds for nuget packages are currently broken;

The fix is;

Adding a custom commands for xamarin builds to copy the files needed;

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
    <CustomCommands>
      <!-- Custom commands for Xamarin -->
      <CustomCommands>
        <Command type="AfterBuild" command="cp -f &quot;$(SolutionDir)/packages/Nancy.Viewengines.Razor.0.17.1/BuildProviders/Nancy.ViewEngines.Razor.BuildProviders.dll&quot; &quot;$(ProjectDir)/bin/&quot;" />
        <Command type="AfterBuild" command="cp -f &quot;$(SolutionDir)/packages/Nancy.Viewengines.Razor.0.17.1/lib/Net40/Nancy.ViewEngines.Razor.dll&quot; &quot;$(ProjectDir)/bin/&quot;" />
      </CustomCommands>
    </CustomCommands>
  </PropertyGroup>

and changing the postbuildevent that uses xcopy windows only

 <PropertyGroup>
    <PostBuildEvent>
if $(ConfigurationName) == Debug (
xcopy /s /y /R "$(SolutionDir)packages\Nancy.Viewengines.Razor.0.23.0\BuildProviders\Nancy.ViewEngines.Razor.BuildProviders.dll" "$(ProjectDir)bin\"
xcopy /s /y /R "$(SolutionDir)packages\Nancy.Viewengines.Razor.0.23.0\lib\Net40\Nancy.ViewEngines.Razor.dll" "$(ProjectDir)bin\"
)</PostBuildEvent>
  </PropertyGroup>

to

<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
    <PostBuildEvent>
if $(ConfigurationName) == Debug (
xcopy /s /y /R "$(SolutionDir)packages\Nancy.Viewengines.Razor.0.23.0\BuildProviders\Nancy.ViewEngines.Razor.BuildProviders.dll" "$(ProjectDir)bin\"
xcopy /s /y /R "$(SolutionDir)packages\Nancy.Viewengines.Razor.0.23.0\lib\Net40\Nancy.ViewEngines.Razor.dll" "$(ProjectDir)bin\"
)</PostBuildEvent>
  </PropertyGroup>
thecodejunkie commented 10 years ago

@raistlinthewiz Hi. When you say Mono builds for nuget packages what do you mean? What's the scenario that you are getting this in?

bonesoul commented 10 years ago

To get nancyfx correctly build with mono over macos / linux

thecodejunkie commented 10 years ago

@raistlinthewiz care to send us a pull-request?

khellang commented 8 years ago

Should be fixed with #2101