{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://appitool.appibara.com/buildtypes/android/v1.schema.json",
  "title": "appitool Android build type v1 parameters",
  "description": "Schema for buildDefinition.externalParameters and buildDefinition.internalParameters of SLSA provenance with buildType https://appitool.appibara.com/buildtypes/android/v1. New optional fields may be added in v1.",
  "type": "object",
  "required": [
    "externalParameters",
    "internalParameters"
  ],
  "properties": {
    "externalParameters": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "command",
        "distribution",
        "packageName",
        "format",
        "source"
      ],
      "properties": {
        "command": {
          "const": "flow android"
        },
        "distribution": {
          "type": "string",
          "enum": [
            "appstore",
            "adhoc",
            "development"
          ]
        },
        "packageName": {
          "type": "string"
        },
        "format": {
          "type": "string",
          "enum": [
            "aab",
            "apk"
          ]
        },
        "flavor": {
          "type": "string"
        },
        "source": {
          "type": "object",
          "required": [
            "repository"
          ],
          "additionalProperties": false,
          "properties": {
            "repository": {
              "type": "string",
              "format": "uri"
            },
            "ref": {
              "type": "string"
            }
          }
        }
      }
    },
    "internalParameters": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "versionName",
        "versionCode",
        "buildType",
        "gradleTask",
        "signing"
      ],
      "properties": {
        "versionName": {
          "type": "string"
        },
        "versionCode": {
          "type": "string"
        },
        "buildType": {
          "type": "string",
          "enum": [
            "release",
            "debug"
          ]
        },
        "gradleTask": {
          "type": "string"
        },
        "signing": {
          "type": "string",
          "enum": [
            "match",
            "gradle"
          ]
        },
        "releaseTag": {
          "type": "string"
        }
      }
    }
  }
}
