<?xml version="1.0" encoding="utf-8"?>
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information. -->
<Rule Name="Build"
      Description="Specifies properties that control how the project builds."
      DisplayName="Build"
      PageTemplate="generic"
      Order="200"
      xmlns="http://schemas.microsoft.com/build/2009/properties" >

  <Rule.Categories>
    <Category Name="General"
              DisplayName="General" />

    <Category Name="ErrorsAndWarnings"
              Description="Configures the error and warning options for the build process."
              DisplayName="Errors and warnings" />

    <Category Name="Output"
              Description="Configures the output options for the build process."
              DisplayName="Output" />
  </Rule.Categories>

  <Rule.DataSource>
    <DataSource Persistence="ProjectFile"
                SourceOfDefaultValue="AfterContext"
                HasConfigurationCondition="True" />
  </Rule.DataSource>

  <StringProperty Name="DefineConstants"
                  DisplayName="Conditional compilation symbols"
                  Description="Specifies symbols on which to perform conditional compilation. Separate symbols with a semi-colon (';')."
                  HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147079"
                  Category="General" />

  <EnumProperty Name="PlatformTarget"
                DisplayName="Platform target"
                Description="Specifies the processor to be targeted by the output file. Choose 'x86' for any 32-bit Intel-compatible processor, choose 'x64' for any 64-bit Intel-compatible processor, or choose 'Any CPU' to specify that any processor is acceptable. 'Any CPU' is the default value for projects, because it allows the application to run on the broadest range of hardware."
                HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147129"
                Category="General">
    <EnumValue Name="AnyCPU"
               DisplayName="Any CPU" />
    <EnumValue Name="x64"
               DisplayName="x64" />
    <EnumValue Name="x86"
               DisplayName="x86" />
  </EnumProperty>

  <EnumProperty Name="Nullable"
                DisplayName="Nullable"
                Description="Specifies the project-wide C# nullable context. Only available for projects that use C# 8.0 or later."
                HelpUrl="https://go.microsoft.com/fwlink/?linkid=2146796"
                Category="General">
    <EnumProperty.DataSource>
      <DataSource HasConfigurationCondition="False" />
    </EnumProperty.DataSource>
    <EnumValue Name="disable"
               DisplayName="Disable" />
    <EnumValue Name="enable"
               DisplayName="Enable" />
    <EnumValue Name="warnings"
               DisplayName="Warnings" />
    <EnumValue Name="annotations"
               DisplayName="Annotations" />
  </EnumProperty>

  <BoolProperty Name="AllowUnsafeBlocks"
                DisplayName="Allow unsafe code"
                Description="Allows code that uses the 'unsafe' keyword to compile."
                HelpUrl="https://go.microsoft.com/fwlink/?linkid=2146797"
                Category="General">
    <BoolProperty.Metadata>
      <NameValuePair Name="SearchTerms" Value="pointers" />
    </BoolProperty.Metadata>
  </BoolProperty>

  <BoolProperty Name="Optimize"
                DisplayName="Optimize code"
                Description="Enables or disables optimizations performed by the compiler to make your output file smaller, faster, and more efficient."
                HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147080"
                Category="General">
    <BoolProperty.Metadata>
      <NameValuePair Name="SearchTerms" Value="optimise;optimisation" />
    </BoolProperty.Metadata>
  </BoolProperty>

  <StringProperty Name="LangVersion"
                  DisplayName="Language version"
                  Description="Why can't I select the C# language version?">
    <StringProperty.DataSource>
      <DataSource PersistedName="LangVersion"
                  Persistence="ProjectFileWithInterception"
                  HasConfigurationCondition="False" />
    </StringProperty.DataSource>
    <StringProperty.ValueEditors>
      <ValueEditor EditorType="LinkAction">
        <ValueEditor.Metadata>
          <NameValuePair Name="Action" Value="URL" />
          <NameValuePair Name="URL" Value="https://aka.ms/csharp-versions" />
        </ValueEditor.Metadata>
      </ValueEditor>
    </StringProperty.ValueEditors>
  </StringProperty>

  <!-- TODO create fwlink for this HelpUrl -->
  <BoolProperty Name="CheckForOverflowUnderflow"
                DisplayName="Check for arithmetic overflow"
                Description="Specifies whether integer arithmetic that results in a value outside the range of the data type, and that is not in the scope of a checked or unchecked keyword, causes a run-time exception."
                HelpUrl="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/checked-compiler-option"
                Category="General">
    <BoolProperty.Metadata>
      <NameValuePair Name="SearchTerms" Value="checked;unchecked" />
    </BoolProperty.Metadata>
  </BoolProperty>

  <!-- TODO create fwlink for this HelpUrl -->
  <BoolProperty Name="Deterministic"
                DisplayName="Deterministic"
                Description="Indicates whether the compiler should produce identical assemblies for identical inputs."
                HelpUrl="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/deterministic-compiler-option"
                Category="General" />
  
  <!-- TODO create fwlink for this HelpUrl -->
  <EnumProperty Name="ErrorReport"
                DisplayName="Internal compiler error reporting"
                Description="Controls when internal compiler error (ICE) reports are sent to Microsoft."
                HelpUrl="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errorreport-compiler-option"
                Category="General">
    <EnumProperty.DataSource>
      <DataSource HasConfigurationCondition="False" />
    </EnumProperty.DataSource>
    <EnumValue Name="none"
               DisplayName="Never send" />
    <EnumValue Name="prompt"
               DisplayName="Prompt before sending" />
    <EnumValue Name="queue"
               DisplayName="Queue" />
    <EnumValue Name="send"
               DisplayName="Send" />
  </EnumProperty>
  
  <!-- TODO create fwlink for this HelpUrl -->
  <EnumProperty Name="FileAlignment"
                DisplayName="File alignment"
                Description="Specifies, in bytes, where to align the sections of the output file."
                HelpUrl="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/filealign-compiler-option"
                Category="General">
    <EnumValue Name="512"
               DisplayName="512" />
    <EnumValue Name="1024"
               DisplayName="1024" />
    <EnumValue Name="2048"
               DisplayName="2048" />
    <EnumValue Name="4096"
               DisplayName="4096" />
    <EnumValue Name="8192"
               DisplayName="8192" />
  </EnumProperty>

  <EnumProperty Name="WarningLevel"
                DisplayName="Warning level"
                Description="Specifies the level to display for compiler warnings."
                HelpUrl="https://go.microsoft.com/fwlink/?linkid=2146798"
                Category="ErrorsAndWarnings">
    <EnumValue Name="0"
               DisplayName="0" />
    <EnumValue Name="1"
               DisplayName="1" />
    <EnumValue Name="2"
               DisplayName="2" />
    <EnumValue Name="3"
               DisplayName="3" />
    <EnumValue Name="4"
               DisplayName="4" />
    <EnumValue Name="5"
               DisplayName="5" />
  </EnumProperty>

  <StringProperty Name="NoWarn"
                  DisplayName="Suppress warnings"
                  Description="Blocks the compiler's ability to generate one or more warnings. Separate multiple warning numbers with a comma (',') or semicolon (';')."
                  HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147300"
                  Category="ErrorsAndWarnings" />

  <EnumProperty Name="TreatWarningsAsErrors"
                HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147301"
                DisplayName="Treat warnings as errors"
                Description="Used to specify which warnings are treated as errors."
                Category="ErrorsAndWarnings" >
    <EnumValue Name="false"
               DisplayName="None" />
    <EnumValue Name="true"
               DisplayName="All" />
  </EnumProperty>

  <StringProperty Name="WarningsAsErrors"
                  DisplayName="Treat specific warnings as errors"
                  HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147301"
                  Description="Treats the specified warnings as errors. Separate multiple warning numbers with a comma (',') or semicolon (';')."
                  Category="ErrorsAndWarnings" />

  <StringProperty Name="BaseOutputPath"
                  DisplayName="Base output path"
                  Description="Specifies the base location for the project's output during build. Subfolders will be appended to this path to differentiate project configuration."
                  Category="Output"
                  Subtype="directory">
    <StringProperty.DataSource>
      <DataSource HasConfigurationCondition="False" />
    </StringProperty.DataSource>
  </StringProperty>

  <StringProperty Name="BaseIntermediateOutputPath"
                  DisplayName="Base intermediate output path"
                  Description="Specifies the base location for the project's intermediate output during build. Subfolders will be appended to this path to differentiate project configuration."
                  Category="Output"
                  Subtype="directory">
    <StringProperty.DataSource>
      <DataSource HasConfigurationCondition="False" />
    </StringProperty.DataSource>
  </StringProperty>

  <!-- TODO create fwlink for this HelpUrl -->
  <BoolProperty Name="GenerateDocumentationFile"
                DisplayName="Documentation file"
                Description="Generate a file containing API documentation."
                HelpUrl="https://docs.microsoft.com/en-us/dotnet/csharp/codedoc"
                Category="Output">
    <BoolProperty.DataSource>
      <DataSource HasConfigurationCondition="False" />
    </BoolProperty.DataSource>
  </BoolProperty>

  <!-- TODO consider removing this property from the UI altogether -->
  <StringProperty Name="DocumentationFile"
                  DisplayName="XML documentation file path"
                  Description="Optional path for the API documentation file. Leave blank to use the default location."
                  HelpUrl="https://go.microsoft.com/fwlink/?linkid=2147081"
                  Category="Output"
                  Subtype="file">
    <StringProperty.DataSource>
      <DataSource HasConfigurationCondition="False" />
    </StringProperty.DataSource>
    <StringProperty.Metadata>
      <NameValuePair Name="VisibilityCondition">
        <NameValuePair.Value>(evaluated "Build" "GenerateDocumentationFile")</NameValuePair.Value>
      </NameValuePair>
    </StringProperty.Metadata>
  </StringProperty>

</Rule>
