build: dotnet: migrate to .NET SDK

This commit is contained in:
Konstantinos Karakostas 2022-09-25 20:47:25 +03:00
parent 9747af22e8
commit c178db127c
2 changed files with 41 additions and 54 deletions

View File

@ -0,0 +1,7 @@
<Project>
<PropertyGroup>
<OutputPath>$(SolutionDir)build\$(Configuration)\$(MSBuildProjectName)</OutputPath>
<BaseIntermediateOutputPath>$(SolutionDir)build\$(MSBuildProjectName).build\</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
</Project>

View File

@ -1,43 +1,31 @@
<?xml version="1.0" encoding="utf-8"?> <Project Sdk="Microsoft.NET.Sdk">
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.common.props))/build.common.props" /> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.common.props))/build.common.props" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <TargetFrameworks>netstandard2.0;net35</TargetFrameworks>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{94580219-CC8D-4FE5-A3BE-437B0B3481E1}</ProjectGuid>
<OutputType>Library</OutputType>
<ProjectName>winfsp.net</ProjectName> <ProjectName>winfsp.net</ProjectName>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RootNamespace>Fsp</RootNamespace> <RootNamespace>Fsp</RootNamespace>
<AssemblyName>$(MyProductFileName)-msil</AssemblyName> <AssemblyName>$(MyProductFileName)-msil</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>$(SolutionDir)build\$(Configuration)\</OutputPath>
<BaseIntermediateOutputPath>$(SolutionDir)build\$(ProjectName).build\</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile>$(BaseIntermediateOutputPath)$(Configuration)\$(MyProductFileName)-msil.xml</DocumentationFile> <DocumentationFile>$(BaseIntermediateOutputPath)$(Configuration)\$(MyProductFileName)-msil.xml</DocumentationFile>
<NoWarn>1591</NoWarn> <NoWarn>1591</NoWarn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>$(SolutionDir)build\$(Configuration)\</OutputPath>
<BaseIntermediateOutputPath>$(SolutionDir)build\$(ProjectName).build\</BaseIntermediateOutputPath>
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DocumentationFile>$(BaseIntermediateOutputPath)$(Configuration)\$(MyProductFileName)-msil.xml</DocumentationFile> <DocumentationFile>$(BaseIntermediateOutputPath)$(Configuration)\$(MyProductFileName)-msil.xml</DocumentationFile>
<NoWarn>1591</NoWarn> <NoWarn>1591</NoWarn>
</PropertyGroup> </PropertyGroup>
@ -47,9 +35,6 @@
<PropertyGroup> <PropertyGroup>
<AssemblyOriginatorKeyFile>winfsp.net.snk</AssemblyOriginatorKeyFile> <AssemblyOriginatorKeyFile>winfsp.net.snk</AssemblyOriginatorKeyFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="..\..\..\src\dotnet\FileSystemBase+Const.cs"> <Compile Include="..\..\..\src\dotnet\FileSystemBase+Const.cs">
<Link>FileSystemBase+Const.cs</Link> <Link>FileSystemBase+Const.cs</Link>
@ -70,44 +55,39 @@
<ItemGroup> <ItemGroup>
<None Include="winfsp.net.snk" /> <None Include="winfsp.net.snk" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <PackageReference Include="Microsoft.Win32.Registry">
Other similar extension points exist, see Microsoft.Common.targets. <Version>5.0.0</Version>
<Target Name="AfterBuild"> </PackageReference>
</Target> <PackageReference Include="System.IO.FileSystem.AccessControl">
--> <Version>5.0.0</Version>
<Target Name="BeforeBuild"> </PackageReference>
<ItemGroup> </ItemGroup>
<AssemblyInfo Include="using System.Reflection%3b" />
<AssemblyInfo Include="[assembly: AssemblyProduct(&quot;$(MyProductName)&quot;)]" /> <PropertyGroup>
<AssemblyInfo Include="[assembly: AssemblyTitle(&quot;$(MyDescription)&quot;)]" /> <AssemblyName>$(MyProductFileName)-msil</AssemblyName>
<AssemblyInfo Include="[assembly: AssemblyCompany(&quot;$(MyCompanyName)&quot;)]" /> <AssemblyTitle>$(MyDescription)</AssemblyTitle>
<AssemblyInfo Include="[assembly: AssemblyCopyright(&quot;$(MyCopyright)&quot;)]" /> <Product>$(MyProductName)</Product>
<AssemblyInfo Include="[assembly: AssemblyVersion(&quot;$(MyAssemblyVersion)&quot;)]" /> <Copyright>$(MyCopyright)</Copyright>
<AssemblyInfo Include="[assembly: AssemblyFileVersion(&quot;$(MyVersion)&quot;)]" /> <AssemblyVersion>$(MyAssemblyVersion)</AssemblyVersion>
</ItemGroup> <FileVersion>$(MyVersion)</FileVersion>
<MakeDir Directories="$(IntermediateOutputPath)" /> </PropertyGroup>
<WriteLinesToFile File="$(IntermediateOutputPath)AssemblyInfo.cs" Lines="@(AssemblyInfo)" Overwrite="true" />
<ItemGroup>
<Compile Include="$(IntermediateOutputPath)AssemblyInfo.cs" />
<FileWrites Include="$(IntermediateOutputPath)AssemblyInfo.cs" />
</ItemGroup>
</Target>
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>exit /b 0 <PostBuildEvent>exit /b 0
set TargetName=$(TargetName) set TargetName=$(TargetName)
set MyAssemblyPolicyVersion=$(MyAssemblyPolicyVersion) set MyAssemblyPolicyVersion=$(MyAssemblyPolicyVersion)
set MyAssemblyVersion=$(MyAssemblyVersion) set MyAssemblyVersion=$(MyAssemblyVersion)
setlocal EnableDelayedExpansion setlocal EnableDelayedExpansion
if exist $(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config del $(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config if exist $(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config del $(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config
for /f "delims=" %25%25l in ($(ProjectDir)winfsp.net.policy.config) do ( for /f "delims=" %25%25l in ($(ProjectDir)winfsp.net.policy.config) do (
set line=%25%25l set line=%25%25l
echo !line! &gt;&gt;$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config echo !line! &gt;&gt;$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config
) )
"$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.0A\Bin\al.exe" /product:"$(MyProductName)" /title:"$(MyDescription)" /company:"$(MyCompanyName)" /copyright:"$(MyCopyright)" /version:"$(MyAssemblyPolicyVersion)" /fileversion:"$(MyVersion)" /link:$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config /out:$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).dll /keyfile:$(ProjectDir)$(ProjectName).snk "$(MSBuildProgramFiles32)\Microsoft SDKs\Windows\v7.0A\Bin\al.exe" /product:"$(MyProductName)" /title:"$(MyDescription)" /company:"$(MyCompanyName)" /copyright:"$(MyCopyright)" /version:"$(MyAssemblyPolicyVersion)" /fileversion:"$(MyVersion)" /link:$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).config /out:$(OutDir)policy.$(MyAssemblyPolicyVersion).$(TargetName).dll /keyfile:$(ProjectDir)$(ProjectName).snk
</PostBuildEvent> </PostBuildEvent>
</PropertyGroup> </PropertyGroup>
</Project> </Project>