Skip to content

Commit

Permalink
Check version for IDE builds only
Browse files Browse the repository at this point in the history
Ensure VS version only in the IDE builds, since for CLI builds, as long as there is either a `$(StartupFile)` or an `$(ActiveDebugProfile)` that matches a file in the project, things will still work just fine, although there will be no launchSettings.json generation.
  • Loading branch information
kzu committed Nov 18, 2020
1 parent fbf1ab1 commit b65be92
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SmallSharp/SmallSharp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
<CompilerVisibleItemMetadata Include="AdditionalFiles" MetadataName="SourceItemType" />
</ItemGroup>

<Target Name="EnsureVisualStudio" BeforeTargets="BeforeCompile;CoreCompile" Condition="$(MSBuildShortVersion) &lt; '16.8'">
<!-- NOTE: we only require VS16.8+ when running in the IDE, since for CLI builds we just do targets stuff -->
<Target Name="EnsureVisualStudio" BeforeTargets="BeforeCompile;CoreCompile"
Condition="$(MSBuildShortVersion) &lt; '16.8' and '$(BuildingInsideVisualStudio)' == 'true'">
<!-- Top-level programs require this, so does our source generator. -->
<Error Text="SmallSharp requires Visual Studio 16.8 or greater." />
</Target>
Expand Down

0 comments on commit b65be92

Please sign in to comment.