Skip to content

Commit db6204f

Browse files
authored
feat: support visual studio build host (#193)
1 parent 44364f7 commit db6204f

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

src/cs/Bootsharp/Build/Bootsharp.targets

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,18 @@
3939
<EmscriptenEnvVars Include="EM_CACHE=$(EmscriptenCacheSdkCacheDir)"/>
4040
</ItemGroup>
4141

42-
<UsingTask TaskName="Bootsharp.Publish.BootsharpEmit" AssemblyFile="$(BootsharpPublishAssembly)"/>
43-
<UsingTask TaskName="Bootsharp.Publish.BootsharpPack" AssemblyFile="$(BootsharpPublishAssembly)"/>
42+
<!-- Register tasks for Visual Studio. (https://github.com/elringus/bootsharp/issues/137) -->
43+
<UsingTask Condition="'$(MSBuildRuntimeType)' == 'Full'"
44+
TaskName="Bootsharp.Publish.BootsharpEmit" AssemblyFile="$(BootsharpPublishAssembly)"
45+
Runtime="NET" TaskFactory="TaskHostFactory"/>
46+
<UsingTask Condition="'$(MSBuildRuntimeType)' == 'Full'"
47+
TaskName="Bootsharp.Publish.BootsharpPack" AssemblyFile="$(BootsharpPublishAssembly)"
48+
Runtime="NET" TaskFactory="TaskHostFactory"/>
49+
<!-- Register tasks for 'dotnet publish' run from CLI. -->
50+
<UsingTask Condition="'$(MSBuildRuntimeType)' != 'Full'"
51+
TaskName="Bootsharp.Publish.BootsharpEmit" AssemblyFile="$(BootsharpPublishAssembly)"/>
52+
<UsingTask Condition="'$(MSBuildRuntimeType)' != 'Full'"
53+
TaskName="Bootsharp.Publish.BootsharpPack" AssemblyFile="$(BootsharpPublishAssembly)"/>
4454

4555
<!-- A hack due to source generator compositing not possible. (https://github.com/dotnet/roslyn/issues/57239#issuecomment-1585235740) -->
4656
<Target Name="BootsharpEmit" BeforeTargets="GenerateAdditionalSources"

src/cs/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<Version>0.8.0-alpha.44</Version>
4+
<Version>0.8.0-alpha.45</Version>
55
<Authors>Elringus</Authors>
66
<PackageTags>javascript typescript ts js wasm node deno bun interop codegen</PackageTags>
77
<PackageProjectUrl>https://bootsharp.com</PackageProjectUrl>

0 commit comments

Comments
 (0)