Create common property IsTargetingNetFramework

* if true, will add reference assemblies <PackageReference/>
* slightly less dumb <Move/>
This commit is contained in:
YoshiRulz 2020-09-22 20:48:13 +10:00
parent 1fdd2d5eb1
commit f8e624befe
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
14 changed files with 40 additions and 19 deletions

View File

@ -2,6 +2,7 @@
<PropertyGroup>
<AnalysisLevel>5</AnalysisLevel>
<ErrorReport>prompt</ErrorReport>
<IsTargetingNetFramework>$(TargetFramework.StartsWith("net4"))</IsTargetingNetFramework>
<LangVersion>8.0</LangVersion>
<PlatformTarget>AnyCPU</PlatformTarget>
<RunAnalyzersDuringBuild Condition=" '$(MachineRunAnalyzersDuringBuild)' == '' ">false</RunAnalyzersDuringBuild>
@ -22,4 +23,7 @@
<PropertyGroup Condition=" '$(MachineExtraCompilationFlag)' != '' ">
<DefineConstants>$(DefineConstants);$(MachineExtraCompilationFlag)</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="all" />
</ItemGroup>
</Project>

View File

@ -1,11 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnCommon.props" />
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="all" />
<ProjectReference Include="$(ProjectDir)../BizHawk.Common/BizHawk.Common.csproj" />
</ItemGroup>
</Project>

View File

@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnCommon.props" />
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" /><!-- for (extra?) dynamic type support -->

View File

@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework><!-- some NuGet packages aren't for Standard, and are only loaded at runtime because EmuHawk is still Framework. More work will be required to move to Core. -->
</PropertyGroup>
<Import Project="../MainSlnCommon.props" />
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>netstandard2.0</TargetFramework><!-- some NuGet packages aren't for Standard, and are only loaded at runtime because EmuHawk is still Framework. More work will be required to move to Core. -->
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Data.SQLite, Version=1.0.105.2, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=AMD64" SpecificVersion="False" HintPath="$(ProjectDir)../../References/x64/SQLite/System.Data.SQLite.dll" />

View File

@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnExecutable.props" />
<PropertyGroup>
<ApplicationIcon>discohawk.ico</ApplicationIcon>
<DefineConstants>$(DefineConstants);WINDOWS</DefineConstants>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<!--
<PropertyGroup>
@ -57,7 +59,6 @@
</ItemGroup>
-->
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="all" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<ProjectReference Include="$(ProjectDir)../BizHawk.Emulation.DiscSystem/BizHawk.Emulation.DiscSystem.csproj" />

View File

@ -1,11 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnExecutable.props" />
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ApplicationIcon>images/logo.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
<DefineConstants>$(DefineConstants);EXE_PROJECT</DefineConstants>
<TargetFramework>net48</TargetFramework>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
<!--
@ -76,7 +78,6 @@
</ItemGroup>
-->
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualBasic" Version="10.3.0" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<Reference Include="System.Windows.Forms" />

View File

@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnCommon.props" />
<Import Project="../../CommonNullable.props" />
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" />

View File

@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnCommon.props" />
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />

View File

@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnCommon.props" />
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>$(NoWarn);SA1205;SA1400</NoWarn>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />

View File

@ -1,8 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnCommon.props" />
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(ProjectDir)../BizHawk.Common/BizHawk.Common.csproj" />

View File

@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnCommon.props" />
<Import Project="../../CommonNullable.props" />
<PropertyGroup>
<OutputPath>$(ProjectDir)../../test_output</OutputPath>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" PrivateAssets="all" />

View File

@ -1,9 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnCommon.props" />
<PropertyGroup>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<NoWarn>CS2008</NoWarn>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<Target Name="PreBuild" AfterTargets="PreBuildEvent">
<Exec Condition=" '$(OS)' == 'Windows_NT' " Command='"$(ProjectDir)..\..\Build\BizHawk.Build.Tool.exe" GIT_REV --wc "$(ProjectDir).." --template "$(ProjectDir)VersionInfo.gen_template.cs" --out "$(ProjectDir)..\BizHawk.Common\VersionInfo.gen.cs"' />

View File

@ -1,11 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../MainSlnCommon.props" />
<Import Project="../../CommonNullable.props" />
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<Import Project="../MainSlnCommon.props" />
<Import Project="../../CommonNullable.props" />
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="all" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
</Project>

View File

@ -10,7 +10,6 @@
<OutputType>WinExe</OutputType>
</PropertyGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Move SourceFiles="$(OutputPath)$(TargetName).exe" DestinationFiles="$(OutputPath)../$(TargetName).exe" />
<Move SourceFiles="$(OutputPath)$(TargetName).exe.config" DestinationFiles="$(OutputPath)../$(TargetName).exe.config" />
<Move Condition=" $(IsTargetingNetFramework) " SourceFiles="$(OutputPath)$(TargetName).exe;$(OutputPath)$(TargetName).exe.config" DestinationFolder="$(OutputPath)../" />
</Target>
</Project>