{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/bleep/latest.json",
  "title": "Bleep build file",
  "description": "",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/oyvindberg/bleep/master/schema.json",
    "sourceSha256": "69d8c7967a5a4cf2446ea79accf8b6ab1aaccd0fa5cebd7880615d0c4f090281",
    "fileMatch": [
      "bleep.yaml",
      "bleep.yml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "$version": {
      "type": "string"
    },
    "jvm": {
      "type": "object",
      "$ref": "#/$defs/Jvm"
    },
    "projects": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/Project"
      }
    },
    "scripts": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/Script"
      }
    },
    "templates": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/Project"
      }
    },
    "resolvers": {
      "description": "Additional Maven/Ivy repositories for dependency resolution. Supports private repos with artifactregistry://, github://, gitlab:// schemes.",
      "oneOf": [
        {
          "$ref": "#/$defs/Repository"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Repository"
          }
        }
      ]
    },
    "remote-cache": {
      "type": "object",
      "description": "Remote build cache configuration for S3-compatible storage. Credentials go in ~/.config/bleep/config.yaml or BLEEP_REMOTE_CACHE_S3_ACCESS_KEY_ID/BLEEP_REMOTE_CACHE_S3_SECRET_ACCESS_KEY env vars.",
      "properties": {
        "uri": {
          "type": "string",
          "description": "S3 bucket URI (e.g., s3://my-cache/builds) or S3-compatible endpoint (e.g., <http://localhost:9000/bucket/prefix)>"
        },
        "region": {
          "type": "string",
          "description": "AWS region (default: us-east-1)",
          "default": "us-east-1"
        }
      },
      "required": [
        "uri"
      ]
    }
  },
  "$defs": {
    "ModuleName": {
      "type": "string"
    },
    "TemplateId": {
      "type": "string"
    },
    "TestFrameworkName": {
      "type": "string"
    },
    "PlatformName": {
      "type": "string",
      "enum": [
        "jvm",
        "js",
        "native"
      ]
    },
    "Option": {
      "type": "string"
    },
    "Options": {
      "oneOf": [
        {
          "$ref": "#/$defs/Option"
        },
        {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Option"
          }
        }
      ]
    },
    "AnnotationProcessing": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "default": false,
          "description": "Enable annotation processing for Java sources"
        }
      }
    },
    "ProjectName": {
      "type": "string"
    },
    "SourceLayout": {
      "type": "string",
      "enum": [
        "none",
        "java",
        "normal",
        "cross-pure",
        "cross-full",
        "sbt-matrix"
      ]
    },
    "CompileOrder": {
      "description": "defaulted to 'java->scala'",
      "type": "string",
      "enum": [
        "java->scala",
        "scala->java"
      ]
    },
    "SbtScope": {
      "type": "string",
      "enum": [
        "main",
        "test",
        "it"
      ]
    },
    "RelPath": {
      "type": "string",
      "pattern": "^\\.\\.?/.*$"
    },
    "Dependency": {
      "anyOf": [
        {
          "$ref": "#/$defs/DependencyShort"
        },
        {
          "$ref": "#/$defs/DependencyLong"
        }
      ]
    },
    "DependencyShort": {
      "type": "string",
      "pattern": "^[^:]+:{1,3}[^:]+:[^:]+$"
    },
    "DependencyLong": {
      "type": "object",
      "required": [
        "module"
      ],
      "properties": {
        "module": {
          "$ref": "#/$defs/DependencyShort"
        },
        "forceJvm": {
          "type": "boolean"
        },
        "for3Use213": {
          "type": "boolean"
        },
        "for213Use3": {
          "type": "boolean"
        },
        "attributes": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "configuration": {
          "type": "string"
        },
        "exclusions": {
          "description": "organization in key and module name(s) in value. example: {\"org.scala-sbt\" : \"util-logging_2.13\"}, or {\"org.scala-sbt\" : [\"util-logging_2.13\", \"util-cache_2.13\"]}",
          "type": "object",
          "additionalProperties": {
            "oneOf": [
              {
                "$ref": "#/$defs/ModuleName"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/$defs/ModuleName"
                }
              }
            ]
          }
        },
        "publication": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "type": {
              "type": "string"
            },
            "ext": {
              "type": "string"
            },
            "classifier": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "transitive": {
          "type": "boolean"
        },
        "isSbtPlugin": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "Java": {
      "type": "object",
      "properties": {
        "options": {
          "$ref": "#/$defs/Options"
        },
        "annotationProcessing": {
          "$ref": "#/$defs/AnnotationProcessing"
        },
        "ecjVersion": {
          "type": "string",
          "description": "ECJ (Eclipse Compiler for Java) version. If set, uses ECJ instead of javac."
        }
      }
    },
    "Kotlin": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string",
          "description": "Kotlin version (e.g., \"2.0.0\", \"2.1.0\")"
        },
        "options": {
          "$ref": "#/$defs/Options"
        },
        "jvmTarget": {
          "type": "string",
          "description": "JVM bytecode target version (e.g., \"11\", \"17\", \"21\")"
        }
      }
    },
    "Scala": {
      "type": "object",
      "properties": {
        "version": {
          "oneOf": [
            {
              "type": "string",
              "enum": [
                "dev"
              ]
            },
            {
              "type": "string"
            }
          ]
        },
        "options": {
          "$ref": "#/$defs/Options"
        },
        "setup": {
          "$ref": "#/$defs/CompileSetup"
        },
        "strict": {
          "type": "boolean"
        },
        "compilerPlugins": {
          "oneOf": [
            {
              "$ref": "#/$defs/Dependency"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Dependency"
              }
            }
          ]
        }
      }
    },
    "Platform": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/$defs/PlatformName"
        },
        "mainClass": {
          "type": "string"
        },
        "jsVersion": {
          "type": "string"
        },
        "jsKind": {
          "type": "string",
          "enum": [
            "none",
            "commonjs",
            "esmodule"
          ]
        },
        "jsSplitStyle": {
          "type": "object",
          "properties": {
            "splitStyle": {
              "type": "string",
              "enum": [
                "FewestModules",
                "SmallestModules",
                "SmallModulesFor"
              ]
            },
            "packages": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "splitStyle"
          ],
          "allOf": [
            {
              "if": {
                "properties": {
                  "splitStyle": {
                    "const": "SmallModulesFor"
                  }
                }
              },
              "then": {
                "required": [
                  "packages"
                ]
              }
            }
          ]
        },
        "jsEmitSourceMaps": {
          "type": "boolean"
        },
        "jsJsdom": {
          "type": "boolean"
        },
        "jsNodeVersion": {
          "type": "string"
        },
        "jvmOptions": {
          "$ref": "#/$defs/Options"
        },
        "jvmRuntimeOptions": {
          "$ref": "#/$defs/Options"
        },
        "nativeVersion": {
          "type": "string"
        },
        "nativeBuildTarget": {
          "type": "string",
          "enum": [
            "application",
            "library-dynamic",
            "library-static"
          ]
        },
        "nativeLinkerReleaseMode": {
          "type": "string",
          "enum": [
            "release-fast",
            "release-size",
            "release-full"
          ]
        },
        "nativeLTO": {
          "type": "string",
          "enum": [
            "none",
            "thin",
            "full"
          ]
        },
        "nativeGc": {
          "type": "string"
        },
        "nativeMultithreading": {
          "type": "boolean"
        },
        "nativeOptimize": {
          "type": "boolean"
        },
        "nativeEmbedResources": {
          "type": "boolean"
        },
        "nativeUseIncrementalCompilation": {
          "type": "boolean"
        }
      },
      "then": {
        "required": [
          "jsSplitStyle"
        ]
      },
      "if": {
        "properties": {
          "name": {
            "const": "js"
          },
          "jsKind": {
            "const": "esmodule"
          }
        },
        "required": [
          "name",
          "jsKind"
        ],
        "type": "object"
      },
      "dependentRequired": {
        "jsSplitStyle": [
          "jsKind"
        ]
      }
    },
    "CompileSetup": {
      "type": "object",
      "properties": {
        "order": {
          "$ref": "#/$defs/CompileOrder"
        },
        "addLibraryToBootClasspath": {
          "description": "Defaulted to true",
          "type": "boolean"
        },
        "addCompilerToClasspath": {
          "description": "Defaulted to false",
          "type": "boolean"
        },
        "addExtraJarsToClasspath": {
          "description": "Defaulted to false",
          "type": "boolean"
        },
        "manageBootClasspath": {
          "description": "Defaulted to true",
          "type": "boolean"
        },
        "filterLibraryFromClasspath": {
          "description": "Defaulted to true",
          "type": "boolean"
        }
      }
    },
    "Jvm": {
      "type": "object",
      "properties": {
        "name": {
          "description": "a combination of JVM and version in this format `graalvm-java17:22.1.0`",
          "type": "string"
        },
        "index": {
          "description": "the default index is the coursier index, located at <https://github.com/coursier/jvm-index/raw/master/index.json> . If you need to use a JVM which is not there, you can specify another index here",
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    },
    "Project": {
      "type": "object",
      "properties": {
        "extends": {
          "oneOf": [
            {
              "$ref": "#/$defs/TemplateId"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/TemplateId"
              }
            }
          ]
        },
        "cross": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/Project"
          }
        },
        "folder": {
          "description": "path of project relative to build root. can be omitted if it is just the project name",
          "$ref": "#/$defs/RelPath"
        },
        "dependsOn": {
          "oneOf": [
            {
              "$ref": "#/$defs/ProjectName"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/ProjectName"
              }
            }
          ]
        },
        "source-layout": {
          "description": "selects a standardized set of source directories",
          "$ref": "#/$defs/SourceLayout"
        },
        "sbt-scope": {
          "description": "changes src/scala to source/main/scala and so on",
          "$ref": "#/$defs/SbtScope"
        },
        "sources": {
          "description": "additional set of source directories. you should set `sbt-scope` and `source-layout` first",
          "oneOf": [
            {
              "$ref": "#/$defs/RelPath"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/RelPath"
              }
            }
          ]
        },
        "resources": {
          "description": "additional set of resource directories. you should set `sbt-scope` and `source-layout` first",
          "oneOf": [
            {
              "$ref": "#/$defs/RelPath"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/RelPath"
              }
            }
          ]
        },
        "sourcegen": {
          "description": "additional set of source directories. you should set `sbt-scope` and `source-layout` first",
          "oneOf": [
            {
              "$ref": "#/$defs/Script"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Script"
              }
            }
          ]
        },
        "dependencies": {
          "oneOf": [
            {
              "$ref": "#/$defs/Dependency"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Dependency"
              }
            }
          ]
        },
        "java": {
          "$ref": "#/$defs/Java"
        },
        "scala": {
          "$ref": "#/$defs/Scala"
        },
        "kotlin": {
          "$ref": "#/$defs/Kotlin"
        },
        "platform": {
          "$ref": "#/$defs/Platform"
        },
        "isTestProject": {
          "type": "boolean"
        },
        "testFrameworks": {
          "oneOf": [
            {
              "$ref": "#/$defs/TestFrameworkName"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/TestFrameworkName"
              }
            }
          ]
        },
        "libraryVersionSchemes": {
          "description": "Version scheme to use for specific modules. Same syntax as a normal dependency, but the version need to be one of these values: \"early-semver\", \"pvp\", \"semver-spec\", \"always\", and \"strict\".",
          "oneOf": [
            {
              "$ref": "#/$defs/Dependency"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Dependency"
              }
            }
          ]
        },
        "ignoreEvictionErrors": {
          "description": "Controls how dependency eviction conflicts are handled. 'yes' ignores all eviction errors, 'warn' converts them to warnings, 'no' fails on eviction errors. Default is 'no'.",
          "type": "string",
          "enum": [
            "yes",
            "warn",
            "no"
          ]
        },
        "publish": {
          "$ref": "#/$defs/PublishConfig"
        }
      }
    },
    "ScriptMain": {
      "type": "object",
      "properties": {
        "project": {
          "type": "string"
        },
        "main": {
          "type": "string"
        },
        "sourceGlobs": {
          "description": "additional set of directories to watch. These are relative to the project folder of the script project. All source and resource folders for the project are already added",
          "oneOf": [
            {
              "$ref": "#/$defs/RelPath"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/RelPath"
              }
            }
          ]
        }
      },
      "required": [
        "project",
        "main"
      ]
    },
    "Script": {
      "anyOf": [
        {
          "$ref": "#/$defs/ScriptMain"
        }
      ]
    },
    "PublishDeveloper": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Developer identifier"
        },
        "name": {
          "type": "string",
          "description": "Developer display name"
        },
        "url": {
          "type": "string",
          "description": "Developer URL (e.g. GitHub profile)"
        }
      },
      "required": [
        "id",
        "name",
        "url"
      ]
    },
    "PublishLicense": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "License name (e.g. MIT, Apache-2.0)"
        },
        "url": {
          "type": "string",
          "description": "License URL"
        },
        "distribution": {
          "type": "string",
          "description": "Distribution method (e.g. repo)"
        }
      },
      "required": [
        "name"
      ]
    },
    "PublishConfig": {
      "type": "object",
      "description": "Publishing configuration. Presence marks a project as publishable. All fields merge through templates.",
      "properties": {
        "enabled": {
          "type": "boolean",
          "default": true,
          "description": "Set to false to opt out of publishing while inheriting other publish fields from a template"
        },
        "groupId": {
          "type": "string",
          "description": "Maven groupId (required for publishing)"
        },
        "description": {
          "type": "string",
          "description": "Project description for POM"
        },
        "url": {
          "type": "string",
          "description": "Project homepage URL for POM"
        },
        "organization": {
          "type": "string",
          "description": "Organization name for POM"
        },
        "developers": {
          "description": "Project developers for POM",
          "oneOf": [
            {
              "$ref": "#/$defs/PublishDeveloper"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/PublishDeveloper"
              }
            }
          ]
        },
        "licenses": {
          "description": "Project licenses for POM",
          "oneOf": [
            {
              "$ref": "#/$defs/PublishLicense"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/PublishLicense"
              }
            }
          ]
        },
        "sonatypeProfileName": {
          "type": "string",
          "description": "Sonatype staging profile name (defaults to groupId)"
        },
        "sonatypeCredentialHost": {
          "type": "string",
          "description": "Sonatype API host (defaults to central.sonatype.com)"
        }
      }
    },
    "Repository": {
      "description": "A Maven, Ivy, or local repository for dependency resolution",
      "oneOf": [
        {
          "type": "string",
          "description": "Maven repository URI (simple form)"
        },
        {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "maven",
                "ivy",
                "maven-folder"
              ]
            },
            "name": {
              "type": "string",
              "description": "Resolver name for referencing in publish commands and auth config"
            },
            "uri": {
              "type": "string",
              "description": "Repository URI (for maven and ivy types). Supports artifactregistry://, github://, gitlab:// schemes"
            },
            "path": {
              "type": "string",
              "description": "Local path (for maven-folder type)"
            }
          },
          "required": [
            "type"
          ]
        }
      ]
    }
  },
  "required": [
    "$version",
    "projects"
  ]
}
