解决MySql布尔型新旧版本兼容问题,采用枚举来表示布尔型的数据表。由正向工程赋值
大石头 authored at 2018-05-15 21:21:05
10.06 KiB
X
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="Current">
  <PropertyGroup>
    <TargetFrameworks>net45;net461;net462;netstandard2.0;netstandard2.1;net6.0;net6.0-windows;net8.0;net8.0-windows;net10.0;net10.0-windows</TargetFrameworks>
    <AssemblyName>NewLife.Core</AssemblyName>
    <RootNamespace>NewLife</RootNamespace>
    <AssemblyTitle>NewLife Core Library</AssemblyTitle>
    <Description>Core library of the NewLife framework: logging (file/network), configuration (XML/JSON/HTTP), cache (memory/distributed), networking (TCP/UDP/HTTP/WebSocket), serialization (binary/XML/JSON), APM tracing, IoC container, actor model, timer scheduler and plugin framework. NativeAOT-ready, with built-in runtime localization; targets 11 frameworks from .NET Framework 4.5 to .NET 10.0.</Description>
    <Company>新生命开发团队</Company>
    <Copyright>©2002-2026 NewLife</Copyright>
    <VersionPrefix>12.0</VersionPrefix>
    <VersionSuffix>$([System.DateTime]::Now.ToString(`yyyy.MMdd`))</VersionSuffix>
    <Version>$(VersionPrefix).$(VersionSuffix)</Version>
    <FileVersion>$(Version)</FileVersion>
    <AssemblyVersion>$(VersionPrefix).$([System.DateTime]::Now.ToString(`yyyy.MMdd`))</AssemblyVersion>
    <OutputPath>..\Bin</OutputPath>
    <GenerateDocumentationFile>True</GenerateDocumentationFile>
    <LangVersion>latest</LangVersion>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <SignAssembly>True</SignAssembly>
    <AssemblyOriginatorKeyFile>..\Doc\newlife.snk</AssemblyOriginatorKeyFile>
    <NoWarn>1701;1702;NU5104;NU1505;NU1900;NETSDK1138;CS7035</NoWarn>
    <AnalysisLevel>latest</AnalysisLevel>
    <WarningsAsErrors>CA2007</WarningsAsErrors>
    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
  </PropertyGroup>
  <PropertyGroup>
    <PackageId>$(AssemblyName)</PackageId>
    <PackageDescription>Core library of the NewLife framework: logging (file/network), configuration (XML/JSON/HTTP), cache (memory/distributed), networking (TCP/UDP/HTTP/WebSocket), serialization (binary/XML/JSON), APM tracing, IoC container, actor model, timer scheduler and plugin framework. NativeAOT-ready, with built-in runtime localization; targets 11 frameworks from .NET Framework 4.5 to .NET 10.0. 核心组件库:日志、配置、缓存、网络、序列化、APM 性能追踪、对象容器、并行模型、定时调度与插件框架;原生 AOT 就绪,内置运行时多语言消息;单包覆盖 .NET Framework 4.5 至 .NET 10.0 共 11 个目标框架。</PackageDescription>
    <Authors>$(Company)</Authors>
    <PackageProjectUrl>https://newlifex.com/core</PackageProjectUrl>
    <PackageIcon>leaf.png</PackageIcon>
    <RepositoryUrl>https://github.com/NewLifeX/X</RepositoryUrl>
    <RepositoryType>git</RepositoryType>
    <PackageTags>新生命团队;X组件;NewLife;AOT;NativeAOT;本地化;$(AssemblyName)</PackageTags>
    <PackageReleaseNotes>内置 31 种语言、269 条运行时消息,异常/日志/配置注释按 UI 语言本地化,英文为源文与兜底;新增 AOT 源生成器(DI/JSON/配置/HTTP 分发)与 31 场景冒烟,分析器与 ILC 告警归零;数据包引用计数所有权、MessagePump 帧泵、Pipe/WebSocket/UDS 与 UDP 响应匹配等网络栈重构;新增 OpenTelemetry 双向适配、ECDSA 合入核心、HTTP 分块请求/慢速攻击防护/零拷贝文件发送;目标框架精简为 11 个、包体缩小约 33%;修复 HTTP 路由、Content-Length、相对 Uri、管道跨段解码、多语言漏译等缺陷;本次为大版本,含数据包所有权、消息协议与 HTTP 契约等破坏性变更,升级前请阅读 ChangeLog.md</PackageReleaseNotes>
    <PackageLicenseExpression>MIT</PackageLicenseExpression>
    <PublishRepositoryUrl>true</PublishRepositoryUrl>
    <EmbedUntrackedSources>true</EmbedUntrackedSources>
    <IncludeSymbols>true</IncludeSymbols>
    <SymbolPackageFormat>snupkg</SymbolPackageFormat>
    <PackageReadmeFile>README.nuget.md</PackageReadmeFile>
  </PropertyGroup>
  <ItemGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>
  <!-- 源生成器:作为构建依赖(ReferenceOutputAssembly=false 不引用输出、不注入分析器),
       SetTargetFramework 避免跨 TFM 协商;分析器程序集在主包打包时嵌入 analyzers/dotnet/cs,下游引用主包即自动获得 -->
  <ItemGroup>
    <ProjectReference Include="..\NewLife.Core.SourceGenerator\NewLife.Core.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" SkipGetTargetFrameworkProperties="true" SetTargetFramework="TargetFramework=netstandard2.0" Private="false" />
    <None Include="..\NewLife.Core.SourceGenerator\bin\$(Configuration)\netstandard2.0\NewLife.Core.SourceGenerator.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
  </ItemGroup>
  <ItemGroup>
    <AdditionalFiles Include="Locales\*.yml" />
  </ItemGroup>

  <!-- net8.0+(含 -windows 形态)常驻启用 AOT/裁剪分析器:0 告警成为构建期硬约束,与 AOT 支持基线一致。
       注意 SDK 会将 IsTrimmable 一并置真,这些目标的程序集会嵌入 IsTrimmable 元数据 -->
  <PropertyGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net8.0'))">
    <IsAotCompatible>true</IsAotCompatible>
  </PropertyGroup>

  <!-- net6.0 的桌面引用包钉在较低补丁版本(历史决策:降低消费者所需 WindowsDesktop 运行时最低版本),
       但 SDK 对已 EOL 的目标只按“已知最新补丁”下载引用包,解析请求 6.0.0 时报 NETSDK1127。
       这里显式下载对应版本的引用包,使 packs 目录没有 6.x(未安装 net6 SDK)的机器也能编译。 -->
  <ItemGroup Condition="'$(TargetFramework)'=='net6.0-windows'">
    <FrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms" IsImplicitlyDefined="true" TargetingPackVersion="6.0.0" />
    <PackageDownload Include="Microsoft.WindowsDesktop.App.Ref" Version="[6.0.0]" />
  </ItemGroup>
  <ItemGroup Condition="'$(TargetFramework)'=='net8.0-windows'">
    <FrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms" IsImplicitlyDefined="true" TargetingPackVersion="8.0.0" />
  </ItemGroup>
  <ItemGroup Condition="'$(TargetFramework)'=='net10.0-windows'">
    <FrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms" IsImplicitlyDefined="true" TargetingPackVersion="10.0.0" />
  </ItemGroup>

  <!-- net*-windows 使用 System.Management 进行标准 WMI 查询(反射调用,避免核心库直接暴露该类型)。
       System.Management 采用滚动支持窗口(每个版本只支持发布时在役的 TFM),按"各 TFM 支持窗口内的最高版本"引用;
       使用更高版本只会回退 netstandard2.0 资产,并触发 "doesn't support" 构建警告 -->
  <ItemGroup Condition="'$(TargetFramework)'=='net6.0-windows'">
    <PackageReference Include="System.Management" Version="8.0.0" />
  </ItemGroup>
  <ItemGroup Condition="'$(TargetFramework)'=='net8.0-windows' or '$(TargetFramework)'=='net10.0-windows'">
    <PackageReference Include="System.Management" Version="10.0.12" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFramework)'=='netstandard2.1'">
    <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
  </ItemGroup>
  <ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
    <PackageReference Include="System.Memory" Version="4.6.3" />
    <!-- 为旧版框架提供 ValueTask/IValueTaskSource 等类型,支持 IAsyncEnumerable Stub -->
    <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
  </ItemGroup>
  <ItemGroup Condition="'$(TargetFramework)'=='net462'">
    <PackageReference Include="System.ValueTuple" Version="4.6.2" />
    <PackageReference Include="System.Memory" Version="4.6.3" />
    <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
  </ItemGroup>
  <!-- net45/net461 选用 4.5.x 线(各包 4.6.x 线最低支持 net462):避免回退 netstandard2.0 资产与 "doesn't support" 构建警告 -->
  <ItemGroup Condition="'$(TargetFramework)'=='net461'">
    <PackageReference Include="System.ValueTuple" Version="4.5.0" />
    <PackageReference Include="System.Memory" Version="4.5.5" />
    <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
  </ItemGroup>
  <ItemGroup Condition="'$(TargetFramework)'=='net45'">
    <!--<PackageReference Include="System.Net.Http" Version="4.3.4" />-->
    <!--<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />-->
    <PackageReference Include="System.ValueTuple" Version="4.5.0" />
    <PackageReference Include="System.Memory" Version="4.5.5" />
    <PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFramework)'=='net45' or '$(TargetFramework)'=='net461' or '$(TargetFramework)'=='net462'">
    <Using Include="System.Net.Http" />
    <Reference Include="Microsoft.VisualBasic" />
    <Reference Include="System.Management" />
    <Reference Include="System.Net.Http" />
    <Reference Include="System.IO.Compression" />
    <Reference Include="System.Web" />
    <Reference Include="System.Windows.Forms" />
  </ItemGroup>

  <!-- 历史遗留资料:旧文档与类图,仅在项目树中排除显示(不影响编译与打包) -->
  <ItemGroup>
    <None Remove="Remoting\ApiClient.cd" />
    <None Remove="Remoting\ApiServer.cd" />
    <None Remove="UpdateInfo.txt" />
    <None Remove="X组件.txt" />
    <None Remove="说明.txt" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="..\Doc\leaf.png" Link="leaf.png" PackagePath="\" />
  </ItemGroup>
  <ItemGroup>
    <None Include="..\README.nuget.md">
      <Pack>True</Pack>
      <PackagePath>\</PackagePath>
    </None>
    <Content Include="NuGet\NewLife.Core.props" Pack="true" PackagePath="build\" Visible="false" />
  </ItemGroup>

</Project>