Update csprojects to the latest NetCore7

This commit is contained in:
Wojciech Figat
2022-12-19 17:39:39 +01:00
parent a56090e70f
commit f874a0ad57
17 changed files with 130 additions and 174 deletions

View File

@@ -18,7 +18,7 @@ public class FlaxBuildTestsTarget : Target
{
base.Init();
Type = TargetType.DotNet;
Type = TargetType.DotNetCore;
OutputType = TargetOutputType.Library;
Platforms = new[]
{

View File

@@ -1,57 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\Platforms\DotNet\NUnit\build\NUnit.props" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3FB235A6-ADFF-415E-92B8-E810DA981A02}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Flax.Build.Tests</RootNamespace>
<AssemblyName>Flax.Build.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<LangVersion>7.3</LangVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>11.0</LangVersion>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>annotations</Nullable>
<OutputPath>..\..\..\Binaries\Tools\</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DefineConstants>USE_NETCORE;FLAX_ASSERTIONS</DefineConstants>
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<IntermediateOutputPath>..\..\..\Cache\Intermediate\Flax.Build.Tests\Debug</IntermediateOutputPath>
<DefineConstants>TRACE;DEBUG;FLAX_ASSERTIONS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\Binaries\Tools\</OutputPath>
<IntermediateOutputPath>..\..\..\Cache\Intermediate\Flax.Build.Tests\Release</IntermediateOutputPath>
<DefineConstants>TRACE;FLAX_ASSERTIONS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<Import Project="..\..\Platforms\DotNet\NUnit\build\NUnit.props" />
<ItemGroup>
<Reference Include="Flax.Build">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Binaries\Tools\Flax.Build.exe</HintPath>
</Reference>
<Reference Include="nunit.framework">
<HintPath>..\..\Platforms\DotNet\NUnit\build\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="TestCommandLine.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<ProjectReference Include="..\Flax.Build\Flax.Build.csproj" />
</ItemGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
<ItemGroup>
<Compile Remove="Flax.Build.Tests.Build.cs" />
</ItemGroup>
</Project>

View File

@@ -1,10 +1,14 @@
// Copyright (c) 2012-2020 Flax Engine. All rights reserved.
// Copyright (c) 2012-2020 Flax Engine. All rights reserved.
using Microsoft.CodeAnalysis;
using System;
using System.IO;
using System.Text;
using System.Linq;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.Loader;
using System.Text;
using System.Collections.Generic;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Emit;
using Microsoft.CodeAnalysis.Text;

View File

@@ -468,7 +468,7 @@ namespace Flax.Build
ProjectName = rulesProjectName,
FilePath = null,
FolderPath = null,
Type = TargetType.DotNet,
Type = TargetType.DotNetCore,
OutputType = TargetOutputType.Library,
Platforms = new[] { Platform.BuildPlatform.Target },
Configurations = new[] { TargetConfiguration.Debug },

View File

@@ -189,7 +189,6 @@ namespace Flax.Build
using (new ProfileEventScope("CompileRules"))
{
var assembler = new Assembler(files, Path.Combine(Globals.Root, Configuration.IntermediateFolder, "BuilderRules.cache"));
//var assembler = new Assembler(files);
assembly = assembler.Build();
}

View File

@@ -1,8 +1,8 @@
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
using System;
using System.Collections.Generic;
using System.IO;
using System.Collections.Generic;
using Flax.Build.Graph;
using Flax.Build.NativeCpp;

View File

@@ -1,6 +1,10 @@
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
using System;
using System.IO;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Flax.Build;
namespace Flax.Deps

View File

@@ -1,15 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>11.0</LangVersion>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>annotations</Nullable>
<Configurations>Debug;Release</Configurations>
<BaseOutputPath>..\..\..\Binaries\Tools</BaseOutputPath>
<OutDir>..\..\..\Binaries\Tools</OutDir>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DefineConstants>USE_NETCORE</DefineConstants>
<DebugType>portable</DebugType>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<ErrorReport>none</ErrorReport>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -32,5 +35,4 @@
<HintPath>..\..\..\Source\Platforms\DotNet\Newtonsoft.Json.dll</HintPath>
</Reference>
</ItemGroup>
</Project>

View File

@@ -1,6 +1,10 @@
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.IO;
namespace Flax.Build.Projects.VisualStudio
{
@@ -49,9 +53,6 @@ namespace Flax.Build.Projects.VisualStudio
csProjectFileContent.AppendLine("<Project Sdk=\"Microsoft.NET.Sdk\">");
csProjectFileContent.AppendLine("");
//csProjectFileContent.AppendLine(string.Format("<Project DefaultTargets=\"Build\" ToolsVersion=\"{0}\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">", projectFileToolVersion));
//csProjectFileContent.AppendLine(" <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />");
// Properties
csProjectFileContent.AppendLine(" <PropertyGroup>");
@@ -73,16 +74,17 @@ namespace Flax.Build.Projects.VisualStudio
var baseConfigurations = project.Configurations.Select(x => x.Name.Split('|')[0]).Distinct().ToArray();
csProjectFileContent.AppendLine(" <TargetFramework>net7.0</TargetFramework>");
csProjectFileContent.AppendLine(" <ImplicitUsings>enable</ImplicitUsings>");
csProjectFileContent.AppendLine(" <Nullable>disable</Nullable>");
csProjectFileContent.AppendLine(" <ImplicitUsings>disable</ImplicitUsings>");
csProjectFileContent.AppendLine(" <Nullable>annotations</Nullable>");
csProjectFileContent.AppendLine(string.Format(" <Configurations>{0}</Configurations>", string.Join(";", baseConfigurations)));
csProjectFileContent.AppendLine(" <EnableDefaultItems>false</EnableDefaultItems>"); // ?
csProjectFileContent.AppendLine(" <EnableDefaultItems>false</EnableDefaultItems>");
csProjectFileContent.AppendLine(" <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>"); // Needed for Hostfxr
csProjectFileContent.AppendLine(" <EnableDynamicLoading>true</EnableDynamicLoading>"); // ?
csProjectFileContent.AppendLine(" <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>"); // Prevents outputting the file under net7.0 subdirectory
csProjectFileContent.AppendLine(" <AssemblyName>$(MSBuildProjectName).CSharp</AssemblyName>"); // For backwards compatibility, keep the filename same
csProjectFileContent.AppendLine(" <GenerateAssemblyInfo>false</GenerateAssemblyInfo>"); // Prevents AssemblyInfo.cs generation (causes duplicate attributes)
csProjectFileContent.AppendLine(" <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>");
csProjectFileContent.AppendLine(" <EnableBaseIntermediateOutputPathMismatchWarning>false</EnableBaseIntermediateOutputPathMismatchWarning>");
csProjectFileContent.AppendLine(" <GenerateAssemblyInfo>false</GenerateAssemblyInfo>");
csProjectFileContent.AppendLine(string.Format(" <RootNamespace>{0}</RootNamespace>", project.BaseName));
csProjectFileContent.AppendLine(string.Format(" <AssemblyName>{0}.CSharp</AssemblyName>", project.BaseName));
csProjectFileContent.AppendLine(" <LangVersion>11.0</LangVersion>");
csProjectFileContent.AppendLine(" <FileAlignment>512</FileAlignment>");
csProjectFileContent.AppendLine(string.Format(" <OutDir>{0}</OutDir>", baseOutputDir)); // This needs to be set here to fix errors in VS
@@ -165,9 +167,10 @@ namespace Flax.Build.Projects.VisualStudio
csProjectFileContent.AppendLine(" <ItemGroup>");
foreach (var reference in project.CSharp.SystemReferences)
// Unused when using explicitly NetCore7 ?
//foreach (var reference in project.CSharp.SystemReferences)
{
csProjectFileContent.AppendLine(string.Format(" <Reference Include=\"{0}\" />", reference));
//csProjectFileContent.AppendLine(string.Format(" <Reference Include=\"{0}\" />", reference));
}
foreach (var reference in project.CSharp.FileReferences)
@@ -232,7 +235,6 @@ namespace Flax.Build.Projects.VisualStudio
// End
//csProjectFileContent.AppendLine(" <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />");
csProjectFileContent.AppendLine("</Project>");
if (defaultTarget.CustomExternalProjectFilePath == null)

View File

@@ -18,7 +18,7 @@ public class FlaxEngineTestsTarget : Target
{
base.Init();
Type = TargetType.DotNet;
Type = TargetType.DotNetCore;
OutputType = TargetOutputType.Library;
Platforms = new[]
{

View File

@@ -1,80 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\Platforms\DotNet\NUnit\build\NUnit.props" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{4AAED6A2-38B1-4A31-AB04-9264A94A8ECA}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FlaxEngine.Tests</RootNamespace>
<AssemblyName>FlaxEngine.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<LangVersion>7.3</LangVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\Binaries\Tools\</OutputPath>
<IntermediateOutputPath>..\..\..\Cache\Intermediate\FlaxEngine.Tests\Debug</IntermediateOutputPath>
<DefineConstants>TRACE;DEBUG;FLAX_ASSERTIONS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>11.0</LangVersion>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>annotations</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<OutputPath>..\..\..\Binaries\Tools\</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<DefineConstants>USE_NETCORE;FLAX_ASSERTIONS</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
<IntermediateOutputPath>..\..\..\Cache\Intermediate\FlaxEngine.Tests\Debug</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\..\Binaries\Tools\</OutputPath>
<IntermediateOutputPath>..\..\..\Cache\Intermediate\FlaxEngine.Tests\Release</IntermediateOutputPath>
<DefineConstants>TRACE;FLAX_ASSERTIONS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<Import Project="..\..\Platforms\DotNet\NUnit\build\NUnit.props" />
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\..\Platforms\DotNet\NUnit\build\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="CircularBufferTests.cs" />
<Compile Include="TestEditorUtils.cs" />
<Compile Include="TestHtmlParser.cs" />
<Compile Include="TestModulusOperator.cs" />
<Compile Include="TestPropertyNameUI.cs" />
<Compile Include="TestQuaternion.cs" />
<Compile Include="TestSerialization.cs" />
<Compile Include="TestStringUtils.cs" />
<Compile Include="TextControl.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestColor.cs" />
<Compile Include="TestContainerControl.cs" />
<Compile Include="TestFloatR10G10B10A2.cs" />
<Compile Include="TestFloatR11G11B10.cs" />
<Compile Include="TestTransform.cs" />
<Compile Include="HistoryStackTests.cs" />
<Compile Include="TestQueryFilterHelper.cs" />
<Compile Include="TestSceneGraph.cs" />
<Compile Include="TestSurface.cs" />
<Compile Include="UndoTests.cs" />
<Compile Include="TestEditorStates.cs" />
<ProjectReference Include="..\..\FlaxEngine.CSharp.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\FlaxEngine.CSharp.csproj">
<Project>{ed088b51-41ac-403b-9b3e-91a38c41523e}</Project>
<Name>FlaxEngine</Name>
</ProjectReference>
<Compile Remove="FlaxEngine.Tests.Build.cs" />
</ItemGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -6,9 +6,9 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTitle("FlaxEngine.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("Wojciech Figat")]
[assembly: AssemblyProduct("FlaxEngine.Tests")]
[assembly: AssemblyCopyright("Copyright © 2012-2018 Wojciech Figat")]
[assembly: AssemblyCopyright("Copyright © 2012-2022 Wojciech Figat")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]