Terminal.Gui.csproj 10 KB

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