A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Cysharp/CsprojModifier below:

Cysharp/CsprojModifier: CsprojModifier performs additional processing when Unity Editor generates the .csproj.

CsprojModifier improves the developer experience in Visual Studio and Rider by performing additional processing when Unity Editor generates .csproj.

日本語

CsprojModifier provides following features:

Add the package via git from Package Manager.

If you are using Unity 2019.1 or later, you can use Package Manager to install a package via git.

https://github.com/Cysharp/CsprojModifier.git?path=src/CsprojModifier/Assets/CsprojModifier
Insert additional projects as Import elements into generated .csproj

Add references to additional project files (.props or .targets) to the generated .csproj using Import element. This enables you to add files to the project, add references, and so on.

Note: .csproj is only used in IDEs such as Visual Studio and Rider, and does not affect the actual compile time by Unity Editor.

For example, you can create the following file YourAwesomeApp.DesignTime.props and import it to use BannedApiAnalyzer.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <Analyzer Include="Assets/Plugins/Editor/Analyzers/Microsoft.CodeAnalysis.BannedApiAnalyzers.dll" />
    <Analyzer Include="Assets/Plugins/Editor/Analyzers/Microsoft.CodeAnalysis.CSharp.BannedApiAnalyzers.dll" />
  </ItemGroup>
  <ItemGroup>
    <AdditionalFiles Include="$(ProjectDir)\BannedSymbols.txt" />
  </ItemGroup>
</Project>

BannedApiAnalyzer expects BannedSymbols.txt as AdditionalFiles to be included in the project, so adding it this way will work.

Inject the contents of additional project files (.props, .targets) directly instead of importing them

If you specify an insert position Append Content or Prepend Content as the insertion position, CsProjModifier will read the XML file and inject the elements directly into .csproj.

<!-- * Example: `Prepend: MyApp.Unity.props` -->
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!--MyApp.Unity.props:HASH-->
  <Import Project="MyApp.Unity.props" />

  <!-- .csproj content generated by Unity Editor -->
  <!-- ... -->
</Project>

<!-- * Example: `Prepend Content: MyApp.Unity.props` -->
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!--MyApp.Unity.props:HASH-->
  <ItemGroup>
    <!-- ... -->
    <!-- ... -->
    <!-- ... -->
  </ItemGroup>

  <!-- .csproj content generated by Unity Editor -->
  <!-- ... -->
</Project>
Add analyzer references to generated .csproj

NOTE: Disabled this feature if you are using Rider or Visual Studio Code with Unity 2020.2 or later. Unity Editor has Roslyn Analyzer IDE support.

Roslyn analyzers are supported in Unity 2020.2 or later. However, currently, Roslyn analyzers are not included in .csproj, and those are only used at compile time.

The extension will insert Analzyer element into .csproj when generating the project file. As a result, you can run Roslyn Analyzer when editing code in Visual Studio. (of course, you can use it before 2020.2!)

Add Roslyn Analyzer to your project in the same way that it is supported in 2020.2.

MIT License


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4