{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Resolver Package",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "name",
        "description",
        "license",
        "projects"
    ],
    "properties": {
        "name": {
            "type": "string",
            "description": "The name of the package."
        },
        "vendor-dir": {
            "type": "string",
            "description": "The name of the vendor directory."
        },
        "project-dir": {
            "type": "string",
            "description": "The name of the ide projects directory."
        },
        "description": {
            "type": "string",
            "description": "A description of the package."
        },
        "license": {
            "type": "string",
            "description": "The license of the package."
        },
        "keywords": {
            "type": "array",
            "minItems": 1,
            "_uniqueItems": true,
            "items": {
                "type": "string",
                "description": "A tag/keyword that this package relates to."
            }
        },
        "website": {
            "type": "string",
            "description": "The website for the project.",
            "format": "uri"
        },
        "definitions": {
            "type": "array",
            "description": "A list with definitions to add to all projects.",
            "items": {
                "type": "string"
            }
        },
        "authors": {
            "type": "array",
            "description": "A list with authors that contributed to the package.",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "name"
                ],
                "properties": {
                    "name": {
                        "type": "string",
                        "description": "The full name of the author."
                    },
                    "email": {
                        "type": "string",
                        "description": "The e-mail address of the author.",
                        "format": "email"
                    },
                    "role": {
                        "type": "string",
                        "description": "The role of the author in the project."
                    }
                }
            }
        },
        "repositories": {
            "type": "array",
            "description": "A set of additional repositories where packages can be found.",
            "items": {
                "type": "object",
                "additionalProperties": true,
                "required": [
                    "type"
                ],
                "properties": {
                    "type": {
                        "type": "string",
                        "description": "The repository type."
                    }
                }
            }
        },
        "projects": {
            "type": "array",
            "description": "A set with projects that shouls be created in the IDE.",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "name"
                ],
                "properties": {
                    "configurations": {
                        "type": "array",
                        "description": "The list with configurations.",
                        "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                                "name",
                                "platform",
                                "output"
                            ],
                            "properties": {
                                "debug": {
                                    "type": "boolean",
                                    "description": "Whether or not this is a debug configuration."
                                },
                                "definitions": {
                                    "type": "array",
                                    "description": "A list with definitions.",
                                    "items": {
                                        "type": "string"
                                    }
                                },
                                "dependencies": {
                                    "type": "array",
                                    "description": "A list with project specific dependencies.",
                                    "items": {
                                        "type": [
                                            "object",
                                            "string"
                                        ],
                                        "additionalProperties": false,
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "description": "The name of the dependency."
                                            },
                                            "config": {
                                                "type": "string",
                                                "description": "The name of the configuration to reference."
                                            }
                                        }
                                    }
                                },
                                "intermediate-dir": {
                                    "type": "string",
                                    "description": "The directory to output intermediate data to."
                                },
                                "name": {
                                    "type": "string",
                                    "description": "The name of the configuration (e.g. Debug, Release, etc.)."
                                },
                                "output": {
                                    "type": "string",
                                    "description": "The file or directory to output the compiled binary to."
                                },
                                "paths": {
                                    "type": "object",
                                    "description": "The map with all paths.",
                                    "oneOf": [
                                        {
                                            "$ref": "#/definitions/paths"
                                        }
                                    ]
                                },
                                "pch": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "description": "The precompiled header settings.",
                                    "oneOf": [
                                        {
                                            "$ref": "#/definitions/pch"
                                        }
                                    ]
                                },
                                "platform": {
                                    "type": "string",
                                    "description": "The platform that this configuration is configured for."
                                },
                                "warning-level": {
                                    "type": "integer",
                                    "description": "The warning level used for this configuration."
                                }
                            }
                        }
                    },
                    "definitions": {
                        "type": "array",
                        "description": "A list with definitions to add to the project.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "dependencies": {
                        "type": "array",
                        "description": "The list with dependencies.",
                        "items": {
                            "type": "object",
                            "additionalProperties": true,
                            "oneOf": [
                                {
                                    "$ref": "#/definitions/project-dependency"
                                }
                            ]
                        }
                    },
                    "dependencies-dev": {
                        "type": "array",
                        "description": "The list with development dependencies.",
                        "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "oneOf": [
                                {
                                    "$ref": "#/definitions/project-dependency"
                                }
                            ]
                        }
                    },
                    "name": {
                        "type": "string",
                        "description": "The name of the project."
                    },
                    "paths": {
                        "type": "object",
                        "description": "The paths for this project",
                        "oneOf": [
                            {
                                "$ref": "#/definitions/paths"
                            }
                        ]
                    },
                    "pch": {
                        "type": "object",
                        "oneOf": [
                            {
                                "$ref": "#/definitions/pch"
                            }
                        ]
                    },
                    "source": {
                        "type": "object",
                        "oneOf": [
                            {
                                "$ref": "#/definitions/source"
                            }
                        ]
                    },
                    "subsystem": {
                        "type": "string",
                        "description": "The project's subsystem"
                    },
                    "type": {
                        "type": "string",
                        "description": "The type of the project."
                    }
                }
            }
        }
    },
    "definitions": {
        "source": {
            "type": "object",
            "description": "The project's source",
            "additionalProperties": false,
            "properties": {
                "extensions": {
                    "type": "array",
                    "description": "A list with extensions to add to this filter.",
                    "items": {
                        "type": "string"
                    }
                },
                "files": {
                    "type": "array",
                    "description": "A list with files to add.",
                    "items": {
                        "type": "string"
                    }
                },
                "name": {
                    "type": "string",
                    "description": "The name of this source definition. This is used to create filters in the IDE."
                },
                "paths": {
                    "type": "array",
                    "description": "A list with directories to include source files from.",
                    "items": {
                        "type": "string"
                    }
                },
                "sources": {
                    "type": [
                        "array",
                        "boolean"
                    ],
                    "description": "A list with sources that should act as sub filters.",
                    "items": {
                        "type": "object"
                    }
                }
            }
        },
        "paths": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "exclude": {
                    "type": "array",
                    "description": "An array with paths to exclude.",
                    "items": {
                        "type": "string"
                    }
                },
                "executable": {
                    "type": "array",
                    "description": "An array with paths of where to find executables.",
                    "items": {
                        "type": "string"
                    }
                },
                "include": {
                    "type": "array",
                    "description": "An array with paths of where to find include files.",
                    "items": {
                        "type": "string"
                    }
                },
                "library": {
                    "type": "array",
                    "description": "An array with paths of where to find libraries.",
                    "items": {
                        "type": "string"
                    }
                },
                "reference": {
                    "type": "array",
                    "description": "An array with paths of where to find reference files.",
                    "items": {
                        "type": "string"
                    }
                },
                "source": {
                    "type": "array",
                    "description": "An array with paths of where to find source files.",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "pch": {
            "type": "object",
            "description": "The precompiled header for this project",
            "additionalProperties": false,
            "required": [
                "header",
                "source"
            ],
            "properties": {
                "header": {
                    "type": "string",
                    "description": "The path that represents the precompiled header."
                },
                "memory": {
                    "type": "integer",
                    "description": "The amount of bytes that is used for the compiler's memory."
                },
                "name": {
                    "type": "string",
                    "description": "The name of the precompiled header."
                },
                "source": {
                    "type": "string",
                    "description": "The path to the source file that compiles the precompiled header."
                }
            }
        },
        "project-dependency": {
            "type": "object",
            "required": [
                "name2",
                "version"
            ],
            "properties": {
                "name": {
                    "type": "string",
                    "description": "The name of the dependency."
                },
                "version": {
                    "type": "string",
                    "description": "The version of the dependency."
                }
            }
        }
    }
}