{
  "$id": "https://json.schemastore.org/hemtt-0.6.2.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "parallel-requires-foreach-to-be-true": {
      "anyOf": [
        {
          "not": {
            "$ref": "#/definitions/is-parallel-true"
          }
        },
        {
          "properties": {
            "foreach": {
              "enum": [true]
            }
          },
          "required": ["foreach"]
        }
      ]
    },
    "is-parallel-true": {
      "properties": {
        "parallel": {
          "enum": [true]
        }
      }
    }
  },
  "description": "The hemtt.json or hemtt.toml file is used to configure your HEMTT Project. All examples are done using JSON, but both files support every feature of HEMTT. hemtt.toml will be used if both files are present.",
  "properties": {
    "name": {
      "$id": "#/properties/name",
      "type": "string",
      "title": "The Name Schema",
      "default": "",
      "description": "Long name of your project.",
      "examples": ["Advanced Banana Environment"],
      "pattern": "^(.*)$"
    },
    "prefix": {
      "$id": "#/properties/prefix",
      "type": "string",
      "title": "The Prefix Schema",
      "default": "",
      "description": "Prefix used for CBA macros and the release directory name.",
      "examples": ["ABE3"],
      "pattern": "^(.*)$"
    },
    "author": {
      "$id": "#/properties/author",
      "type": "string",
      "title": "The Author Schema",
      "default": "",
      "description": "Author of the project.",
      "examples": ["ACE Mod Team"],
      "pattern": "^(.*)$"
    },
    "version": {
      "$id": "#/properties/version",
      "type": "string",
      "title": "The Version Schema",
      "default": "",
      "description": "HEMTT will look for ```addons/main/script_version.hpp``` and use it for the version number. If you are not using the CBA project structure or do not have that file you can add a version number in the HEMTT project file.",
      "examples": ["1.0.0.0"],
      "pattern": "^(.*)$"
    },
    "files": {
      "$id": "#/properties/files",
      "type": "array",
      "title": "The Files Schema",
      "default": null,
      "description": "HEMTT will copy the files to the release directory after a successful release build. Supports glob patterns.",
      "items": {
        "$id": "#/properties/files/items",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": ["mod.cpp", "logo.paa", "*.dll"],
        "pattern": "^(.*)$"
      }
    },
    "include": {
      "$id": "#/properties/include",
      "type": "array",
      "title": "The Include Schema",
      "default": null,
      "description": "HEMTT will include matching relative or absolute paths when building.",
      "items": {
        "$id": "#/properties/include/items",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": ["./include"],
        "pattern": "^(.*)$"
      }
    },
    "exclude": {
      "$id": "#/properties/exclude",
      "type": "array",
      "title": "The Exclude Schema",
      "default": null,
      "description": "HEMTT will exclude matching files when building.",
      "items": {
        "$id": "#/properties/exclude/items",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": ["*.psd", "*.png", "*.tga"],
        "pattern": "^(.*)$"
      }
    },
    "optionals": {
      "$id": "#/properties/optionals",
      "type": "array",
      "title": "The Optionals Schema",
      "default": null,
      "description": "HEMTT will build the specified addons from the ./optionals folder.",
      "items": {
        "$id": "#/properties/optionals/items",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": ["tracers", "particles"],
        "pattern": "^(.*)$"
      }
    },
    "folder_optionals": {
      "$id": "#/properties/folder_optionals",
      "type": "boolean",
      "title": "The Folder_optionals Schema",
      "description": "HEMTT will by default build optionals into their own mod folders, which can be directly launched by the user. This can be turned off to build optional PBOs directly into optionals folder.",
      "default": false,
      "examples": [false]
    },
    "skip": {
      "$id": "#/properties/skip",
      "type": "array",
      "title": "The Skip Schema",
      "default": null,
      "description": "HEMTT will skip building the specified addons.",
      "items": {
        "$id": "#/properties/skip/items",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": ["hearing", "zeus"],
        "pattern": "^(.*)$"
      }
    },
    "headerexts": {
      "$id": "#/properties/headerexts",
      "type": "array",
      "title": "The Headerexts Schema",
      "default": null,
      "description": "HEMTT will apply specified header extensions to each PBO. Supports templating.",
      "items": {
        "$id": "#/properties/headerexts/items",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": ["author=me"],
        "pattern": "^(.*)$"
      }
    },
    "modname": {
      "$id": "#/properties/modname",
      "type": "string",
      "title": "The Modname Schema",
      "description": "HEMTT will use the specified mod name (without @) to form @mod folder. Supports templating.",
      "default": "",
      "examples": ["my_mod"],
      "pattern": "^(.*)$"
    },
    "keyname": {
      "$id": "#/properties/keyname",
      "type": "string",
      "title": "The Keyname Schema",
      "description": "HEMTT will use the specified key name for .bikey and .biprivatekey names. Supports templating.",
      "default": "",
      "examples": ["my_key"],
      "pattern": "^(.*)$"
    },
    "signame": {
      "$id": "#/properties/signame",
      "type": "string",
      "title": "The Signame Schema",
      "description": "HEMTT will use the specified signature name as part of the full signature (.bisign) name. Supports templating.",
      "default": "",
      "examples": ["my_custom_name"],
      "pattern": "^(.*)$"
    },
    "sigversion": {
      "$id": "#/properties/sigversion",
      "type": "integer",
      "title": "The Sigversion Schema",
      "description": "HEMTT will use the specified signature version. Currently Supported: V2, V3 (Experimental).",
      "default": 2,
      "examples": [3]
    },
    "reuse_private_key": {
      "$id": "#/properties/reuse_private_key",
      "type": "boolean",
      "title": "The Reuse_private_key Schema",
      "description": "If set to true, HEMTT will use (and reuse) releases/keys/{keyname}.biprivatekey. It will be generated if it doesn't exist. The default behaviour is to generate a new private key each time and discard it immediately. HEMTT strongly recommends that you only reuse the key if you are making a client-side mod where it will not matter if clients are running different versions of the mod.",
      "default": false,
      "examples": [false]
    },
    "postbuild": {
      "$id": "#/properties/postbuild",
      "type": "array",
      "title": "The Postbuild Schema",
      "default": null,
      "items": {
        "$id": "#/properties/postbuild/items",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": [""],
        "pattern": "^(.*)$"
      }
    },
    "prebuild": {
      "$id": "#/properties/prebuild",
      "type": "array",
      "title": "The Prebuild Schema",
      "default": null,
      "items": {
        "$id": "#/properties/prebuild/items",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": [""],
        "pattern": "^(.*)$"
      }
    },
    "releasebuild": {
      "$id": "#/properties/releasebuild",
      "type": "array",
      "title": "The Releasebuild Schema",
      "default": null,
      "items": {
        "$id": "#/properties/releasebuild/items",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": [""],
        "pattern": "^(.*)$"
      }
    },
    "scripts": {
      "$id": "#/properties/scripts",
      "type": "object",
      "title": "The Scripts Schema",
      "default": null,
      "additionalProperties": {
        "$id": "#/properties/scripts/properties/",
        "type": "object",
        "title": "The  Schema",
        "default": null,
        "properties": {
          "steps": {
            "$id": "#/properties/scripts/properties//properties/steps",
            "type": "array",
            "title": "The Steps Schema",
            "default": null,
            "items": {
              "$id": "#/properties/scripts/properties//properties/steps/items",
              "type": "string",
              "title": "The Items Schema",
              "default": "",
              "examples": ["echo {{addon}} took {{time}} ms to build."],
              "pattern": "^(.*)$"
            }
          },
          "steps_linux": {
            "$id": "#/properties/scripts/properties//properties/steps_linux",
            "type": "array",
            "title": "The Steps_linux Schema",
            "default": null,
            "description": "steps_windows and steps_linux can be used to run different steps on the respective platforms.",
            "items": {
              "$id": "#/properties/scripts/properties//properties/steps_linux/items",
              "type": "string",
              "title": "The Items Schema",
              "default": "",
              "examples": [""],
              "pattern": "^(.*)$"
            }
          },
          "steps_windows": {
            "$id": "#/properties/scripts/properties//properties/steps_windows",
            "type": "array",
            "title": "The Steps_windows Schema",
            "default": null,
            "description": "steps_windows and steps_linux can be used to run different steps on the respective platforms.",
            "items": {
              "$id": "#/properties/scripts/properties//properties/steps_windows/items",
              "type": "string",
              "title": "The Items Schema",
              "default": "",
              "examples": [""],
              "pattern": "^(.*)$"
            }
          },
          "show_output": {
            "$id": "#/properties/scripts/properties//properties/show_output",
            "type": "boolean",
            "title": "The Show_output Schema",
            "description": "All output is hidden by default. Setting show_output will display the command being executed and its output.",
            "default": false,
            "examples": [true]
          },
          "foreach": {
            "$id": "#/properties/scripts/properties//properties/foreach",
            "type": "boolean",
            "title": "The Foreach Schema",
            "default": false,
            "description": "Scripts can be ran for each addons. Inside prebuild the script will be ran for each addon that HEMTT will build, including addons that will be skipped if they are already built. Inside postbuild and releasebuild only addons that were successfully built with be used, excluding addons that were skipped for being up to date.",
            "examples": [true]
          },
          "parallel": {
            "$id": "#/properties/scripts/properties//properties/parallel",
            "type": "boolean",
            "title": "The Parallel Schema",
            "description": "Requires foreach to be true. If a script is thread safe parallel can be used to process multiple addons at a time.",
            "default": false,
            "examples": [true]
          }
        },
        "allOf": [
          {
            "$ref": "#/definitions/parallel-requires-foreach-to-be-true"
          }
        ]
      }
    }
  },
  "required": ["name", "prefix", "author"],
  "title": "The Root Schema",
  "type": "object"
}
