Skip to content

Commit

Permalink
Add Directory.Build.props and global.json
Browse files Browse the repository at this point in the history
  • Loading branch information
vipentti committed Dec 4, 2023
1 parent 32840f3 commit 7f2e461
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 11 deletions.
78 changes: 78 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Features>strict</Features>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>

<!-- Build -->
<PropertyGroup>
<TreatWarningsAsErrors Condition="'$(Configuration)' == 'Release'">true</TreatWarningsAsErrors>
<!-- Enable linter -->
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>

<WarnOnPackingNonPackableProject>true</WarnOnPackingNonPackableProject>
</PropertyGroup>

<!-- Packaging -->
<PropertyGroup>
<!-- Enable packaging on a per-project basis. -->
<IsPackable>false</IsPackable>
<IsPublishable>false</IsPublishable>

<Authors>Ville Penttinen</Authors>
<Copyright>Copyright © 2023 Ville Penttinen</Copyright>
<PackageProjectUrl>https://github.com/vipentti/visp-fs</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/vipentti/visp-fs</RepositoryUrl>

<!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>

<!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<PropertyGroup>
<UseReproducibleBuild Condition="'$(UseReproducibleBuild)'==''">false</UseReproducibleBuild>
<PackableProjects>Visp.Runtime.Library</PackableProjects>
</PropertyGroup>

<Choose>
<When Condition="$(PackableProjects.Contains('$(MSBuildProjectName)'))">

<PropertyGroup>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
<PackageIcon>icon.png</PackageIcon>

<EnablePackageValidation>true</EnablePackageValidation>

<!-- Recommended: Embed symbols containing Source Link in the main file (exe/dll) -->
<DebugType>embedded</DebugType>

<!-- Embed source files that are not tracked by the source control manager in the PDB -->
<EmbedUntrackedSources>true</EmbedUntrackedSources>

<GenerateDocumentationFile>True</GenerateDocumentationFile>
<!-- If all members are not documented, you can disable the compiler warnings -->
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)LICENSE.md" Pack="true" PackagePath="" Visible="false" />
<None Include="$(MSBuildThisFileDirectory)icon.png" Pack="true" PackagePath="" Visible="false" />
<None Include="$(MSBuildThisFileDirectory)README.md" Pack="true" PackagePath="\" />
</ItemGroup>

<ItemGroup Condition="'$(UseReproducibleBuild)' == 'true'">
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</When>
</Choose>
</Project>
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"rollForward": "latestMinor"
}
}
2 changes: 0 additions & 2 deletions src/Visp.Cli/Visp.Cli.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 0 additions & 2 deletions src/Visp.Common/Visp.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 0 additions & 2 deletions src/Visp.Compiler/Visp.Compiler.fsproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<InvariantGlobalization>true</InvariantGlobalization>
<FsYaccOutputFolder>Syntax\\FsLexYaccOutput\\</FsYaccOutputFolder>
<FsLexOutputFolder>Syntax\\FsLexYaccOutput\\</FsLexOutputFolder>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion src/Visp.LanguageServer/Visp.LanguageServer.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/Visp.Runtime.Library/Visp.Runtime.Library.fsproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>true</IsPackable>
<IsPublishable>true</IsPublishable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<Compile Include="Common.fs" />
Expand Down
3 changes: 1 addition & 2 deletions tests/Visp.Compiler.UnitTests/Visp.Compiler.UnitTests.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<GenerateProgramFile>false</GenerateProgramFile>
<IsTestProject>true</IsTestProject>
Expand All @@ -18,7 +17,7 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Verify.Xunit" Version="22.6.0" />
<PackageReference Include="Verify.Xunit" Version="22.6.1" />
<PackageReference Include="xunit" Version="2.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down

0 comments on commit 7f2e461

Please sign in to comment.