{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://json.schemastore.org/asmdef.json",
  "anyOf": [
    {
      "properties": {
        "includePlatforms": {
          "minItems": 1
        },
        "excludePlatforms": {
          "maxItems": 0
        }
      }
    },
    {
      "properties": {
        "includePlatforms": {
          "maxItems": 0
        },
        "excludePlatforms": {
          "minItems": 1
        }
      }
    },
    {
      "properties": {
        "includePlatforms": {
          "maxItems": 0
        },
        "excludePlatforms": {
          "maxItems": 0
        }
      }
    }
  ],
  "definitions": {
    "platformValues": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "enum": [
          "Android",
          "Editor",
          "iOS",
          "LinuxStandalone32",
          "LinuxStandalone64",
          "LinuxStandaloneUniversal",
          "Lumin",
          "macOSStandalone",
          "Nintendo3DS",
          "PS4",
          "PSVita",
          "Stadia",
          "Switch",
          "tvOS",
          "WSA",
          "WebGL",
          "WindowsStandalone32",
          "WindowsStandalone64",
          "XboxOne"
        ]
      }
    }
  },
  "description": "Defines an assembly in the Unity compilation pipeline",
  "properties": {
    "name": {
      "description": "The name of the assembly being defined",
      "type": "string",
      "minLength": 1
    },
    "rootNamespace": {
      "description": "The root namespace of the assembly. Requires Unity 2020.2",
      "type": "string"
    },
    "references": {
      "description": "A list of assembly names or assembly asset GUIDs to reference",
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "uniqueItems": true
    },
    "includePlatforms": {
      "$ref": "#/definitions/platformValues",
      "description": "Platforms to target"
    },
    "excludePlatforms": {
      "$ref": "#/definitions/platformValues",
      "description": "Platforms that are explicitly not targeted"
    },
    "allowUnsafeCode": {
      "description": "Allow unsafe code",
      "type": "boolean",
      "default": false
    },
    "autoReferenced": {
      "description": "When true, this assembly definition is automatically referenced by predefined assemblies (Assembly-CSharp, Assembly-CSharp-firstpass, etc.)",
      "type": "boolean",
      "default": true
    },
    "noEngineReferences": {
      "description": "When true, no references to UnityEngine or UnityEditor will be added to this assembly project",
      "type": "boolean",
      "default": false
    },
    "overrideReferences": {
      "description": "When true, any references to precompiled assembly assets are manually chosen. When false, all precompiled assembly assets are automatically referenced",
      "type": "boolean",
      "default": "false"
    },
    "precompiledReferences": {
      "description": "A list of precompiled assembly assets that will be referenced. Only valid when overrideReferences is true",
      "type": "array",
      "uniqueItems": true
    },
    "defineConstraints": {
      "description": "A list of the C# compiler define symbols that must evaluate to true in order for the assembly to be compiled or referenced. Absence of a symbol can be checked with a bang symbol (!DEFINE)",
      "type": "array",
      "uniqueItems": true
    },
    "optionalUnityReferences": {
      "description": "Additional optional Unity features to reference",
      "type": "array",
      "items": {
        "enum": ["TestAssemblies"]
      },
      "uniqueItems": true
    },
    "versionDefines": {
      "description": "A set of expressions that will define a symbol in the C# project if a package or module version matches the given expression",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "description": "The package or module that will provide the version to be checked in the expression",
            "type": "string"
          },
          "expression": {
            "description": "The semantic version range of the chosen package or module",
            "type": "string"
          },
          "define": {
            "description": "The name of the define that is added to the project file when expression evaluates to true",
            "type": "string"
          }
        },
        "required": ["name", "expression", "define"]
      }
    }
  },
  "required": ["name"],
  "title": "Unity Assembly Definition",
  "type": "object"
}
