kswoll / WootzJs

C# to Javascript Compiler implemented via Roslyn
MIT License
110 stars 21 forks source link

Nuget #38

Open raysplaceinspace opened 8 years ago

raysplaceinspace commented 8 years ago

Note that this branch starts from the no-build-bat (another pull request) because that was a necessary dependency. The only actual change on this branch is the addition of WootzJs.Compiler.nuspec. This allows us to compile the WootzJs compiler and publish it straight to NuGet. I didn't do the other bits because I was only using the compiler and I didn't have an easy way to test the rest.

I haven't pushed the WootzJs.Compiler to a public nuget, but if we were to do that, now people could just run nuget install WootzJs.Compiler from their command line and they'll have the compiler. This means they don't have to have the source code at all, which we didn't want to do for our continuous integration. Here are some snippets from our csproj, notice how they all reference "..\packages\WootzJs.Compiler.x.x.x":

  <ItemGroup>
    <Content Include="..\packages\WootzJs.Compiler.1.0.2\tools\build\mscorlib.js">
      <Link>mscorlib.js</Link>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

  <Import Project="..\packages\WootzJs.Compiler.1.0.2\tools\build\WootzJs.targets" Condition=" '$(WootzJs)' != '' " />
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <PropertyGroup><PostBuildEvent>$(ProjectDir)..\packages\WootzJs.Compiler.1.0.2\tools\build\WootzJs.Compiler.exe $(ProjectPath) $(OutDir)</PostBuildEvent>
  </PropertyGroup>

You can see we output mscorlib.js from our csproj because we want to make a complete build output with all the required JavaScript.