{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/hemtt/versions/0.6.2.json",
  "title": "The Root Schema",
  "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.",
  "x-lintel": {
    "source": "https://www.schemastore.org/hemtt-0.6.2.json",
    "sourceSha256": "8504aded784cb6289dbf9a3b5868f4da0e9b4b50034f0330edfbc10295eda553",
    "fileMatch": [
      "hemtt.json",
      "hemtt.toml"
    ],
    "parsers": [
      "json",
      "toml"
    ]
  },
  "type": "object",
  "properties": {
    "name": {
      "pattern": "^(.*)$",
      "type": "string",
      "title": "The Name Schema",
      "default": "",
      "description": "Long name of your project.",
      "examples": [
        "Advanced Banana Environment"
      ]
    },
    "prefix": {
      "pattern": "^(.*)$",
      "type": "string",
      "title": "The Prefix Schema",
      "default": "",
      "description": "Prefix used for CBA macros and the release directory name.",
      "examples": [
        "ABE3"
      ]
    },
    "author": {
      "pattern": "^(.*)$",
      "type": "string",
      "title": "The Author Schema",
      "default": "",
      "description": "Author of the project.",
      "examples": [
        "ACE Mod Team"
      ]
    },
    "version": {
      "pattern": "^(.*)$",
      "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"
      ]
    },
    "files": {
      "items": {
        "pattern": "^(.*)$",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": [
          "mod.cpp",
          "logo.paa",
          "*.dll"
        ]
      },
      "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."
    },
    "include": {
      "items": {
        "pattern": "^(.*)$",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": [
          "./include"
        ]
      },
      "type": "array",
      "title": "The Include Schema",
      "default": null,
      "description": "HEMTT will include matching relative or absolute paths when building."
    },
    "exclude": {
      "items": {
        "pattern": "^(.*)$",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": [
          "*.psd",
          "*.png",
          "*.tga"
        ]
      },
      "type": "array",
      "title": "The Exclude Schema",
      "default": null,
      "description": "HEMTT will exclude matching files when building."
    },
    "optionals": {
      "items": {
        "pattern": "^(.*)$",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": [
          "tracers",
          "particles"
        ]
      },
      "type": "array",
      "title": "The Optionals Schema",
      "default": null,
      "description": "HEMTT will build the specified addons from the ./optionals folder."
    },
    "folder_optionals": {
      "examples": [
        false
      ],
      "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
    },
    "skip": {
      "items": {
        "pattern": "^(.*)$",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": [
          "hearing",
          "zeus"
        ]
      },
      "type": "array",
      "title": "The Skip Schema",
      "default": null,
      "description": "HEMTT will skip building the specified addons."
    },
    "headerexts": {
      "items": {
        "pattern": "^(.*)$",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": [
          "author=me"
        ]
      },
      "type": "array",
      "title": "The Headerexts Schema",
      "default": null,
      "description": "HEMTT will apply specified header extensions to each PBO. Supports templating."
    },
    "modname": {
      "pattern": "^(.*)$",
      "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"
      ]
    },
    "keyname": {
      "pattern": "^(.*)$",
      "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"
      ]
    },
    "signame": {
      "pattern": "^(.*)$",
      "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"
      ]
    },
    "sigversion": {
      "examples": [
        3
      ],
      "type": "integer",
      "title": "The Sigversion Schema",
      "description": "HEMTT will use the specified signature version. Currently Supported: V2, V3 (Experimental).",
      "default": 2
    },
    "reuse_private_key": {
      "examples": [
        false
      ],
      "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
    },
    "postbuild": {
      "items": {
        "pattern": "^(.*)$",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": [
          ""
        ]
      },
      "type": "array",
      "title": "The Postbuild Schema",
      "default": null
    },
    "prebuild": {
      "items": {
        "pattern": "^(.*)$",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": [
          ""
        ]
      },
      "type": "array",
      "title": "The Prebuild Schema",
      "default": null
    },
    "releasebuild": {
      "items": {
        "pattern": "^(.*)$",
        "type": "string",
        "title": "The Items Schema",
        "default": "",
        "examples": [
          ""
        ]
      },
      "type": "array",
      "title": "The Releasebuild Schema",
      "default": null
    },
    "scripts": {
      "default": null,
      "type": "object",
      "title": "The Scripts Schema",
      "additionalProperties": {
        "allOf": [
          {
            "$ref": "#/$defs/parallel-requires-foreach-to-be-true"
          }
        ],
        "type": "object",
        "title": "The  Schema",
        "default": null,
        "properties": {
          "steps": {
            "items": {
              "pattern": "^(.*)$",
              "type": "string",
              "title": "The Items Schema",
              "default": "",
              "examples": [
                "echo {{addon}} took {{time}} ms to build."
              ]
            },
            "type": "array",
            "title": "The Steps Schema",
            "default": null
          },
          "steps_linux": {
            "items": {
              "pattern": "^(.*)$",
              "type": "string",
              "title": "The Items Schema",
              "default": "",
              "examples": [
                ""
              ]
            },
            "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."
          },
          "steps_windows": {
            "items": {
              "pattern": "^(.*)$",
              "type": "string",
              "title": "The Items Schema",
              "default": "",
              "examples": [
                ""
              ]
            },
            "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."
          },
          "show_output": {
            "examples": [
              true
            ],
            "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
          },
          "foreach": {
            "examples": [
              true
            ],
            "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."
          },
          "parallel": {
            "examples": [
              true
            ],
            "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
          }
        }
      }
    }
  },
  "required": [
    "name",
    "prefix",
    "author"
  ],
  "$defs": {
    "parallel-requires-foreach-to-be-true": {
      "anyOf": [
        {
          "not": {
            "$ref": "#/$defs/is-parallel-true"
          }
        },
        {
          "properties": {
            "foreach": {
              "enum": [
                true
              ]
            }
          },
          "required": [
            "foreach"
          ],
          "type": "object"
        }
      ]
    },
    "is-parallel-true": {
      "properties": {
        "parallel": {
          "enum": [
            true
          ]
        }
      }
    }
  }
}
