Terminal.Gui.csproj 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <Project Sdk="Microsoft.NET.Sdk">
  2. <!-- =================================================================== -->
  3. <!-- Version numbers -->
  4. <!-- Automatically updated by gitversion (run `dotnet-gitversion`) -->
  5. <!-- GitVersion.xml controls settings -->
  6. <!-- See ./README.md for more -->
  7. <!-- =================================================================== -->
  8. <PropertyGroup>
  9. <Version>2.0.0</Version>
  10. </PropertyGroup>
  11. <!-- =================================================================== -->
  12. <!-- Assembly name. -->
  13. <!-- Referenced throughout this file for consistency. -->
  14. <!-- =================================================================== -->
  15. <PropertyGroup>
  16. <AssemblyName>Terminal.Gui</AssemblyName>
  17. </PropertyGroup>
  18. <!-- =================================================================== -->
  19. <!-- .NET Build Settings -->
  20. <!-- =================================================================== -->
  21. <PropertyGroup>
  22. <!--Note - These three SHOULD be picked up from Directory.Build.props, but they are not. Not sure why. -->
  23. <TargetFramework>net8.0</TargetFramework>
  24. <LangVersion>12</LangVersion>
  25. <ImplicitUsings>enable</ImplicitUsings>
  26. <Nullable>enable</Nullable>
  27. <!-- -->
  28. <RootNamespace>$(AssemblyName)</RootNamespace>
  29. <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  30. <DefineTrace>true</DefineTrace>
  31. <DebugType>portable</DebugType>
  32. <DefineConstants>$(DefineConstants);CONTRACTS_FULL;CODE_ANALYSIS</DefineConstants>
  33. <NoLogo>true</NoLogo>
  34. <SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
  35. <JsonSerializerIsReflectionEnabledByDefault>false</JsonSerializerIsReflectionEnabledByDefault>
  36. <IsTrimmable>true</IsTrimmable>
  37. <IsAotCompatible>true</IsAotCompatible>
  38. </PropertyGroup>
  39. <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
  40. <DefineDebug>true</DefineDebug>
  41. <DefineConstants>$(DefineConstants);DEBUG_IDISPOSABLE</DefineConstants>
  42. </PropertyGroup>
  43. <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
  44. <Optimize>true</Optimize>
  45. <VersionSuffix></VersionSuffix>
  46. </PropertyGroup>
  47. <!-- =================================================================== -->
  48. <!-- Configuration Manager -->
  49. <!-- =================================================================== -->
  50. <ItemGroup>
  51. <None Remove="Resources\config.json" />
  52. <EmbeddedResource Include="Resources\config.json" />
  53. </ItemGroup>
  54. <!-- =================================================================== -->
  55. <!-- Dependencies -->
  56. <!-- =================================================================== -->
  57. <ItemGroup>
  58. <PackageReference Include="ColorHelper" />
  59. <PackageReference Include="JetBrains.Annotations" />
  60. <PackageReference Include="Microsoft.Extensions.Logging.Abstractions " />
  61. <PackageReference Include="System.IO.Abstractions" />
  62. <PackageReference Include="Wcwidth" />
  63. </ItemGroup>
  64. <ItemGroup>
  65. <ProjectReference Include="..\Terminal.Gui.Analyzers\Terminal.Gui.Analyzers.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
  66. </ItemGroup>
  67. <ItemGroup>
  68. <!-- Enable Nuget Source Link for github -->
  69. <PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
  70. </ItemGroup>
  71. <!-- =================================================================== -->
  72. <!-- Global Usings and Type Aliases -->
  73. <!-- =================================================================== -->
  74. <ItemGroup>
  75. <Using Include="JetBrains.Annotations" />
  76. <Using Include="JetBrains.Annotations.PureAttribute" Alias="PureAttribute" />
  77. <Using Include="System.Drawing" />
  78. <Using Include="System.Text" />
  79. </ItemGroup>
  80. <!-- =================================================================== -->
  81. <!-- Assembly names for which internal items are visible -->
  82. <!-- =================================================================== -->
  83. <ItemGroup>
  84. <InternalsVisibleTo Include="Benchmarks" />
  85. <InternalsVisibleTo Include="UnitTests" />
  86. <InternalsVisibleTo Include="UnitTests.Parallelizable" />
  87. <InternalsVisibleTo Include="StressTests" />
  88. <InternalsVisibleTo Include="IntegrationTests" />
  89. <InternalsVisibleTo Include="TerminalGuiDesigner" />
  90. <InternalsVisibleTo Include="TerminalGuiFluentTesting" />
  91. <InternalsVisibleTo Include="DynamicProxyGenAssembly2" />
  92. </ItemGroup>
  93. <!-- =================================================================== -->
  94. <!-- API Documentation -->
  95. <!-- =================================================================== -->
  96. <ItemGroup>
  97. <None Include="..\docfx\images\logo.png">
  98. <Pack>true</Pack>
  99. <PackagePath>\</PackagePath>
  100. </None>
  101. <None Include="..\README.md">
  102. <Pack>true</Pack>
  103. <PackagePath>\</PackagePath>
  104. </None>
  105. </ItemGroup>
  106. <!-- =================================================================== -->
  107. <!-- i18 -->
  108. <!-- =================================================================== -->
  109. <ItemGroup>
  110. <Compile Update="Resources\Strings.Designer.cs">
  111. <DesignTime>true</DesignTime>
  112. <AutoGen>true</AutoGen>
  113. <DependentUpon>Strings.resx</DependentUpon>
  114. </Compile>
  115. </ItemGroup>
  116. <ItemGroup>
  117. <EmbeddedResource Update="Resources\Strings.resx">
  118. <Generator>ResXFileCodeGenerator</Generator>
  119. <LastGenOutput>Strings.Designer.cs</LastGenOutput>
  120. </EmbeddedResource>
  121. </ItemGroup>
  122. <!-- =================================================================== -->
  123. <!-- Nuget -->
  124. <!-- =================================================================== -->
  125. <PropertyGroup>
  126. <PackageId>$(AssemblyName)</PackageId>
  127. <PackageLicenseExpression>MIT</PackageLicenseExpression>
  128. <PackageProjectUrl>https://github.com/gui-cs/$(AssemblyName)</PackageProjectUrl>
  129. <PackageIcon>logo.png</PackageIcon>
  130. <PackageReadmeFile>README.md</PackageReadmeFile>
  131. <PackageTags>csharp, terminal, c#, f#, gui, toolkit, console, tui</PackageTags>
  132. <Description>Cross platform Terminal UI toolkit for .NET</Description>
  133. <Owners>Miguel de Icaza, Tig Kindel</Owners>
  134. <Summary>A toolkit for building rich console apps for .NET that works on Windows, Mac, and Linux/Unix.</Summary>
  135. <Title>$(AssemblyName) - Cross-platform Terminal User Interface (TUI) toolkit for .NET</Title>
  136. <PackageReleaseNotes>
  137. See: $(PackageProjectUrl)/releases
  138. </PackageReleaseNotes>
  139. <DocumentationFile>bin\$(Configuration)\$(AssemblyName).xml</DocumentationFile>
  140. <GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Debug' ">true</GeneratePackageOnBuild>
  141. <GeneratePackageOnBuild>true</GeneratePackageOnBuild>
  142. <RepositoryUrl>https://github.com/gui-cs/$(AssemblyName).git</RepositoryUrl>
  143. <RepositoryType>git</RepositoryType>
  144. <IncludeSymbols>true</IncludeSymbols>
  145. <SymbolPackageFormat>snupkg</SymbolPackageFormat>
  146. <!-- Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
  147. <PublishRepositoryUrl>true</PublishRepositoryUrl>
  148. <GitRepositoryRemoteName>upstream</GitRepositoryRemoteName>
  149. <!-- Embed source files that are not tracked by the source control manager in the PDB -->
  150. <EmbedUntrackedSources>true</EmbedUntrackedSources>
  151. <EnableSourceLink>true</EnableSourceLink>
  152. <Authors>Miguel de Icaza, Tig Kindel (@tig), @BDisp</Authors>
  153. </PropertyGroup>
  154. <ProjectExtensions>
  155. <VisualStudio>
  156. <UserProperties resources_4config_1json__JsonSchema="../../docfx/schemas/tui-config-schema.json" />
  157. </VisualStudio>
  158. </ProjectExtensions>
  159. <Target Name="CopyAnalyzersToPackage" AfterTargets="Build">
  160. <ItemGroup>
  161. <AnalyzerFiles Include="..\Terminal.Gui.Analyzers\bin\$(Configuration)\netstandard2.0\Terminal.Gui.Analyzers.dll" />
  162. </ItemGroup>
  163. </Target>
  164. <ItemGroup>
  165. <None Remove="..\Terminal.Gui.Analyzers\bin\Debug\netstandard2.0\Terminal.Gui.Analyzers.dll" />
  166. </ItemGroup>
  167. <ItemGroup>
  168. <None Remove="..\Terminal.Gui.Analyzers\bin\Debug\netstandard2.0\Terminal.Gui.Analyzers.dll" />
  169. </ItemGroup>
  170. <ItemGroup>
  171. <None Include="..\Terminal.Gui.Analyzers\bin\$(Configuration)\netstandard2.0\Terminal.Gui.Analyzers.dll" Pack="true" PackagePath="analyzers/dotnet/cs" />
  172. </ItemGroup>
  173. <!--<Target Name="PreBuildCleanup" BeforeTargets="BeforeBuild" Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
  174. <Exec Command="rmdir /s /q &quot;$(UserProfile)\.nuget\packages\terminal.gui\2.0.0&quot;" Condition=" '$(OS)' == 'Windows_NT' " />
  175. <Exec Command="rm -rf ~/.nuget/packages/terminal.gui/2.0.0" Condition=" '$(OS)' != 'Windows_NT' " />
  176. </Target>-->
  177. <Target Name="CopyNuGetPackagesToLocalPackagesFolder" AfterTargets="Pack" Condition="'$(Configuration)' == 'Release'">
  178. <!-- Remove older NuGet Package from Global Cache -->
  179. <Exec Command="rmdir /s /q &quot;$(UserProfile)\.nuget\packages\terminal.gui\2.0.0&quot;" Condition=" '$(OS)' == 'Windows_NT' " />
  180. <Exec Command="rm -rf ~/.nuget/packages/terminal.gui/2.0.0" Condition=" '$(OS)' != 'Windows_NT' " />
  181. <PropertyGroup>
  182. <!-- Define the path for local_packages relative to the project directory -->
  183. <LocalPackagesPath>$(MSBuildThisFileDirectory)..\local_packages\</LocalPackagesPath>
  184. <!-- Output path without framework-specific folders -->
  185. <PackageOutputPath>$(MSBuildThisFileDirectory)bin\$(Configuration)\</PackageOutputPath>
  186. </PropertyGroup>
  187. <!-- Ensure the local_packages folder exists -->
  188. <Message Text="Checking if $(LocalPackagesPath) exists, creating if necessary." Importance="high" />
  189. <MakeDir Directories="$(LocalPackagesPath)" />
  190. <!-- Collect .nupkg and .snupkg files into an item group -->
  191. <ItemGroup>
  192. <NuGetPackages Include="$(PackageOutputPath)*.nupkg;$(PackageOutputPath)*.snupkg" />
  193. </ItemGroup>
  194. <!-- Check if any packages were found -->
  195. <Message Text="Found packages: @(NuGetPackages)" Importance="high" />
  196. <!-- Copy files only if found -->
  197. <Copy SourceFiles="@(NuGetPackages)" DestinationFolder="$(LocalPackagesPath)" SkipUnchangedFiles="false" Condition="@(NuGetPackages) != ''" />
  198. <!-- Log success -->
  199. <Message Text="Copy completed successfully." Importance="high" />
  200. <!-- Install NuGet Package to Global Cache -->
  201. <Exec Command="dotnet nuget push &quot;$(MSBuildThisFileDirectory)bin\$(Configuration)\Terminal.Gui.$(Version).nupkg&quot; --source &quot;$(UserProfile)\.nuget\packages&quot; --skip-duplicate" Condition=" '$(OS)' == 'Windows_NT' " />
  202. <Exec Command="dotnet nuget push &quot;$(MSBuildThisFileDirectory)bin\$(Configuration)/Terminal.Gui.$(Version).nupkg&quot; --source ~/.nuget/packages" Condition=" '$(OS)' != 'Windows_NT' " />
  203. </Target>
  204. </Project>