Skip to content

Commit

Permalink
[bndbuild] Start to work on a JsonSchema file for IDE integration or …
Browse files Browse the repository at this point in the history
…validation
  • Loading branch information
Krusty/Benediction committed Nov 19, 2024
1 parent a536cfe commit 7f2a63e
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions cpclib-bndbuild/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/cpcsdk/rust.cpclib/tree/master/cpclib-bndbuild/schema.json",
"$defs": {
"ListOfFiles": {
"type": ["object", "array", "string"]
},

"Constraint": {
"type": "string"
},

"Task": {
"type": "string"
},

"ListOfTasks": {
"type": "array",
"item": "#/$defs/Task"
},

"OneOrSeveralTasks": {
"anyOf": [{ "$ref": "#/$defs/ListOfTasks" }, { "$ref": "#/$defs/Task" }]
},

"Rule": {
"type": "object",
"description": "The description of a rule",

"patternProperties": {
"^(tgt)|(target)|(build)$": {
"$ref": "#/$defs/ListOfFiles",
"description": "The list of targets"
},

"^(dep)|(dependency)|(requires)$": {
"$ref": "#/$defs/ListOfFiles",
"description": "The list of targets"
},

"^(cmd)|(command)|(launch)|(run)$": {
"$ref": "#/$defs/OneOrSeveralTasks",
"description": "The list of tasks to handle"
},

"^help$": {
"type": "string",
"description": "Help about the current rule."
},

"^phony$": {
"type": "string"
},

"^constraint$": {
"$ref": "#/$defs/Constraint"
}
},
"additionalProperties": false
}
},
"title": "Bndbuild validation schema",
"description": "Bndbuild configuration file",
"type": "array",
"items": { "$ref": "#/$defs/Rule" },
"minItems": 0
}

0 comments on commit 7f2a63e

Please sign in to comment.