schema_directory.json 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "description": "Schema for the CMake codemodel directory object",
  4. "type": "object",
  5. "oneOf": [
  6. {
  7. "$comment": "The top level codemodelVersion field was only added in version 2.9, so we can't differentiate between earlier versions",
  8. "anyOf": [
  9. {
  10. "$ref": "#/definitions/codemodelV2_0"
  11. },
  12. {
  13. "$ref": "#/definitions/codemodelV2_4"
  14. },
  15. {
  16. "$ref": "#/definitions/codemodelV2_5"
  17. }
  18. ]
  19. },
  20. {
  21. "$ref": "#/definitions/codemodelV2_9"
  22. }
  23. ],
  24. "definitions": {
  25. "codemodelVersionV2_9": {
  26. "type": "object",
  27. "required": [
  28. "major",
  29. "minor"
  30. ],
  31. "properties": {
  32. "major": {
  33. "type": "integer",
  34. "const": 2
  35. },
  36. "minor": {
  37. "type": "integer",
  38. "minimum": 9
  39. }
  40. },
  41. "additionalProperties": false
  42. },
  43. "backtraceGraph": {
  44. "type": "object",
  45. "required": [
  46. "nodes",
  47. "commands",
  48. "files"
  49. ],
  50. "properties": {
  51. "nodes": {
  52. "type": "array",
  53. "items": {
  54. "type": "object",
  55. "required": [
  56. "file"
  57. ],
  58. "properties": {
  59. "file": {
  60. "type": "integer",
  61. "minimum": 0,
  62. "description": "0-based index into the backtrace files array"
  63. },
  64. "line": {
  65. "type": "integer",
  66. "minimum": 1,
  67. "description": "This is present when the node represents a line within the file. The line number is a 1-based value."
  68. },
  69. "command": {
  70. "type": "integer",
  71. "minimum": 0,
  72. "description": "This is present when the node represents a command invocation. It is a 0-based index into the backtrace commands array."
  73. },
  74. "parent": {
  75. "type": "integer",
  76. "minimum": 0,
  77. "description": "This is present when the node is not the bottom of the call stack. It is a 0-based index of another node in the backtrace nodes array."
  78. }
  79. },
  80. "additionalProperties": false
  81. }
  82. },
  83. "commands": {
  84. "type": "array",
  85. "description": "Each list item is a string specifying a command name",
  86. "items": {
  87. "type": "string"
  88. }
  89. },
  90. "files": {
  91. "type": "array",
  92. "description": "Each list item is a string specifying the path to a file, represented with forward slashes. If the file is inside the top level source directory, the path is specified relative to that directory. Otherwise, the path is absolute.",
  93. "items": {
  94. "type": "string"
  95. }
  96. }
  97. },
  98. "additionalProperties": false
  99. },
  100. "paths": {
  101. "type": "object",
  102. "required": [
  103. "source",
  104. "build"
  105. ],
  106. "properties": {
  107. "source": {
  108. "type": "string",
  109. "description": "Path to the source directory. If it is inside the top level source directory, the path will be relative to that directory. For the top level source directory, this will simply be '.'. Paths outside the top level source directory will be absolute."
  110. },
  111. "build": {
  112. "type": "string",
  113. "description": "Path to the build directory. If it is inside the top level build directory, the path will be relative to that directory. For the top level build directory, this will simply be '.'. Paths outside the top level build directory will be absolute."
  114. }
  115. },
  116. "additionalProperties": false
  117. },
  118. "installerComponent": {
  119. "type": "string",
  120. "description": "Specifies the component selected by the corresponding install command invocation"
  121. },
  122. "installerDestination": {
  123. "type": "string",
  124. "description": "The install destination path. May be absolute or relative to the install prefix"
  125. },
  126. "installerPaths": {
  127. "type": "array",
  128. "description": "Paths (files or directories) to be installed",
  129. "items": {
  130. "oneOf": [
  131. {
  132. "type": "string",
  133. "description": "Path from which a file/directory is installed, also specifying the install path"
  134. },
  135. {
  136. "type": "object",
  137. "properties": {
  138. "from": {
  139. "type": "string",
  140. "description": "Path from which a file/directory is installed"
  141. },
  142. "to": {
  143. "type": "string",
  144. "description": "Path to which the file/directory is installed under the destination"
  145. }
  146. },
  147. "required": [
  148. "from",
  149. "to"
  150. ]
  151. }
  152. ]
  153. }
  154. },
  155. "installerItemTypesV2_0": {
  156. "type": "string",
  157. "enum": [
  158. "file",
  159. "directory",
  160. "target",
  161. "export",
  162. "script",
  163. "code",
  164. "importedRuntimeArtifacts",
  165. "runtimeDependencySet"
  166. ]
  167. },
  168. "installerItemTypesV2_4": {
  169. "type": "string",
  170. "enum": [
  171. "fileSet"
  172. ]
  173. },
  174. "installerItemTypesV2_5": {
  175. "type": "string",
  176. "enum": [
  177. "cxxModuleBmi"
  178. ]
  179. },
  180. "installerTypeV2_0": {
  181. "$ref": "#/definitions/installerItemTypesV2_0",
  182. "description": "Type of installation rule"
  183. },
  184. "installerTypeV2_4": {
  185. "anyOf": [
  186. {
  187. "$ref": "#/definitions/installerItemTypesV2_0"
  188. },
  189. {
  190. "$ref": "#/definitions/installerItemTypesV2_4"
  191. }
  192. ],
  193. "description": "Type of installation rule"
  194. },
  195. "installerTypeV2_5": {
  196. "anyOf": [
  197. {
  198. "$ref": "#/definitions/installerItemTypesV2_0"
  199. },
  200. {
  201. "$ref": "#/definitions/installerItemTypesV2_4"
  202. },
  203. {
  204. "$ref": "#/definitions/installerItemTypesV2_5"
  205. }
  206. ],
  207. "description": "Type of installation rule"
  208. },
  209. "installerIsExcludeFromAll": {
  210. "type": "boolean",
  211. "description": "Present when install is called with EXCLUDE_FROM_ALL option"
  212. },
  213. "installerIsForAllComponents": {
  214. "type": "boolean",
  215. "description": "Present when install(SCRIPT|CODE) is called with ALL_COMPONENTS option"
  216. },
  217. "installerIsOptional": {
  218. "type": "boolean",
  219. "description": "Present when install is called with OPTIONAL option"
  220. },
  221. "installerTargetId": {
  222. "type": "string",
  223. "description": "Uniquely identifying string for the target to be installed"
  224. },
  225. "installerTargetIndex": {
  226. "type": "integer",
  227. "minimum": 0,
  228. "description": "0-based index into the codemodel targets array"
  229. },
  230. "installerTargetIsImportLibrary": {
  231. "type": "boolean",
  232. "description": "Present for Windows DLL import library or AIX linker import file"
  233. },
  234. "installerTargetInstallNamelink": {
  235. "type": "string",
  236. "enum": [
  237. "skip",
  238. "only"
  239. ],
  240. "description": "How to handle symlinks for VERSION/SOVERSION target properties"
  241. },
  242. "installerExportName": {
  243. "type": "string",
  244. "description": "Name of the export for export type"
  245. },
  246. "installerExportTargets": {
  247. "type": "array",
  248. "items": {
  249. "type": "object",
  250. "properties": {
  251. "id": {
  252. "type": "string",
  253. "description": "String uniquely identifying the target"
  254. },
  255. "index": {
  256. "type": "integer",
  257. "minimum": 0,
  258. "description": "0-based index into the codemodel targets array"
  259. }
  260. },
  261. "additionalProperties": false,
  262. "required": [
  263. "id",
  264. "index"
  265. ]
  266. }
  267. },
  268. "installerRuntimeDependencySetName": {
  269. "type": "string",
  270. "description": "Name of the runtime dependency set"
  271. },
  272. "installerRuntimeDependencySetType": {
  273. "type": "string",
  274. "enum": [
  275. "library",
  276. "framework"
  277. ],
  278. "description": "Type of runtime dependency set"
  279. },
  280. "installerScriptFile": {
  281. "type": "string",
  282. "description": "Path to the script file on disk"
  283. },
  284. "installerBacktrace": {
  285. "type": "integer",
  286. "minimum": 0,
  287. "description": "0-based index into the backtraceGraph nodes array"
  288. },
  289. "installerFileSetNameV2_4": {
  290. "type": "string",
  291. "description": "Name of the file set"
  292. },
  293. "installerFileSetTypeV2_4": {
  294. "type": "string",
  295. "description": "Type of the file set"
  296. },
  297. "installerFileSetDirectoriesV2_4": {
  298. "type": "array",
  299. "items": {
  300. "type": "string"
  301. },
  302. "description": "File set's base directories"
  303. },
  304. "installerFileSetTargetV2_4": {
  305. "type": "object",
  306. "required": [
  307. "id",
  308. "index"
  309. ],
  310. "properties": {
  311. "id": {
  312. "type": "string",
  313. "description": "String uniquely identifying the target"
  314. },
  315. "index": {
  316. "type": "integer",
  317. "minimum": 0,
  318. "description": "0-based index into the codemodel targets array"
  319. }
  320. },
  321. "additionalProperties": false
  322. },
  323. "installerCxxModuleBmiTargetV2_5": {
  324. "type": "object",
  325. "properties": {
  326. "id": {
  327. "type": "string"
  328. },
  329. "index": {
  330. "type": "integer",
  331. "minimum": 0
  332. }
  333. },
  334. "additionalProperties": false
  335. },
  336. "installersV2_0": {
  337. "type": "array",
  338. "items": {
  339. "type": "object",
  340. "required": [
  341. "component",
  342. "type"
  343. ],
  344. "properties": {
  345. "component": {
  346. "$ref": "#/definitions/installerComponent"
  347. },
  348. "destination": {
  349. "$ref": "#/definitions/installerDestination"
  350. },
  351. "paths": {
  352. "$ref": "#/definitions/installerPaths"
  353. },
  354. "type": {
  355. "$ref": "#/definitions/installerTypeV2_0"
  356. },
  357. "isExcludeFromAll": {
  358. "$ref": "#/definitions/installerIsExcludeFromAll"
  359. },
  360. "isForAllComponents": {
  361. "$ref": "#/definitions/installerIsForAllComponents"
  362. },
  363. "isOptional": {
  364. "$ref": "#/definitions/installerIsOptional"
  365. },
  366. "targetId": {
  367. "$ref": "#/definitions/installerTargetId"
  368. },
  369. "targetIndex": {
  370. "$ref": "#/definitions/installerTargetIndex"
  371. },
  372. "targetIsImportLibrary": {
  373. "$ref": "#/definitions/installerTargetIsImportLibrary"
  374. },
  375. "targetInstallNamelink": {
  376. "$ref": "#/definitions/installerTargetInstallNamelink"
  377. },
  378. "exportName": {
  379. "$ref": "#/definitions/installerExportName"
  380. },
  381. "exportTargets": {
  382. "$ref": "#/definitions/installerExportTargets"
  383. },
  384. "runtimeDependencySetName": {
  385. "$ref": "#/definitions/installerRuntimeDependencySetName"
  386. },
  387. "runtimeDependencySetType": {
  388. "$ref": "#/definitions/installerRuntimeDependencySetType"
  389. },
  390. "scriptFile": {
  391. "$ref": "#/definitions/installerScriptFile"
  392. },
  393. "backtrace": {
  394. "$ref": "#/definitions/installerBacktrace"
  395. }
  396. },
  397. "additionalProperties": false
  398. }
  399. },
  400. "installersV2_4": {
  401. "type": "array",
  402. "items": {
  403. "type": "object",
  404. "required": [
  405. "component",
  406. "type"
  407. ],
  408. "properties": {
  409. "component": {
  410. "$ref": "#/definitions/installerComponent"
  411. },
  412. "destination": {
  413. "$ref": "#/definitions/installerDestination"
  414. },
  415. "paths": {
  416. "$ref": "#/definitions/installerPaths"
  417. },
  418. "type": {
  419. "$ref": "#/definitions/installerTypeV2_0"
  420. },
  421. "isExcludeFromAll": {
  422. "$ref": "#/definitions/installerIsExcludeFromAll"
  423. },
  424. "isForAllComponents": {
  425. "$ref": "#/definitions/installerIsForAllComponents"
  426. },
  427. "isOptional": {
  428. "$ref": "#/definitions/installerIsOptional"
  429. },
  430. "targetId": {
  431. "$ref": "#/definitions/installerTargetId"
  432. },
  433. "targetIndex": {
  434. "$ref": "#/definitions/installerTargetIndex"
  435. },
  436. "targetIsImportLibrary": {
  437. "$ref": "#/definitions/installerTargetIsImportLibrary"
  438. },
  439. "targetInstallNamelink": {
  440. "$ref": "#/definitions/installerTargetInstallNamelink"
  441. },
  442. "exportName": {
  443. "$ref": "#/definitions/installerExportName"
  444. },
  445. "exportTargets": {
  446. "$ref": "#/definitions/installerExportTargets"
  447. },
  448. "runtimeDependencySetName": {
  449. "$ref": "#/definitions/installerRuntimeDependencySetName"
  450. },
  451. "runtimeDependencySetType": {
  452. "$ref": "#/definitions/installerRuntimeDependencySetType"
  453. },
  454. "scriptFile": {
  455. "$ref": "#/definitions/installerScriptFile"
  456. },
  457. "backtrace": {
  458. "$ref": "#/definitions/installerBacktrace"
  459. },
  460. "fileSetName": {
  461. "$ref": "#/definitions/installerFileSetNameV2_4"
  462. },
  463. "fileSetType": {
  464. "$ref": "#/definitions/installerFileSetTypeV2_4"
  465. },
  466. "fileSetDirectories": {
  467. "$ref": "#/definitions/installerFileSetDirectoriesV2_4"
  468. },
  469. "fileSetTarget": {
  470. "$ref": "#/definitions/installerFileSetTargetV2_4"
  471. }
  472. },
  473. "additionalProperties": false
  474. }
  475. },
  476. "installersV2_5": {
  477. "type": "array",
  478. "items": {
  479. "type": "object",
  480. "required": [
  481. "component",
  482. "type"
  483. ],
  484. "properties": {
  485. "component": {
  486. "$ref": "#/definitions/installerComponent"
  487. },
  488. "destination": {
  489. "$ref": "#/definitions/installerDestination"
  490. },
  491. "paths": {
  492. "$ref": "#/definitions/installerPaths"
  493. },
  494. "type": {
  495. "$ref": "#/definitions/installerTypeV2_5"
  496. },
  497. "isExcludeFromAll": {
  498. "$ref": "#/definitions/installerIsExcludeFromAll"
  499. },
  500. "isForAllComponents": {
  501. "$ref": "#/definitions/installerIsForAllComponents"
  502. },
  503. "isOptional": {
  504. "$ref": "#/definitions/installerIsOptional"
  505. },
  506. "targetId": {
  507. "$ref": "#/definitions/installerTargetId"
  508. },
  509. "targetIndex": {
  510. "$ref": "#/definitions/installerTargetIndex"
  511. },
  512. "targetIsImportLibrary": {
  513. "$ref": "#/definitions/installerTargetIsImportLibrary"
  514. },
  515. "targetInstallNamelink": {
  516. "$ref": "#/definitions/installerTargetInstallNamelink"
  517. },
  518. "exportName": {
  519. "$ref": "#/definitions/installerExportName"
  520. },
  521. "exportTargets": {
  522. "$ref": "#/definitions/installerExportTargets"
  523. },
  524. "runtimeDependencySetName": {
  525. "$ref": "#/definitions/installerRuntimeDependencySetName"
  526. },
  527. "runtimeDependencySetType": {
  528. "$ref": "#/definitions/installerRuntimeDependencySetType"
  529. },
  530. "scriptFile": {
  531. "$ref": "#/definitions/installerScriptFile"
  532. },
  533. "backtrace": {
  534. "$ref": "#/definitions/installerBacktrace"
  535. },
  536. "fileSetName": {
  537. "$ref": "#/definitions/installerFileSetNameV2_4"
  538. },
  539. "fileSetType": {
  540. "$ref": "#/definitions/installerFileSetTypeV2_4"
  541. },
  542. "fileSetDirectories": {
  543. "$ref": "#/definitions/installerFileSetDirectoriesV2_4"
  544. },
  545. "fileSetTarget": {
  546. "$ref": "#/definitions/installerFileSetTargetV2_4"
  547. },
  548. "cxxModuleBmiTarget": {
  549. "$ref": "#/definitions/installerCxxModuleBmiTargetV2_5"
  550. }
  551. },
  552. "additionalProperties": false
  553. }
  554. },
  555. "codemodelV2_0": {
  556. "required": [
  557. "backtraceGraph",
  558. "paths",
  559. "installers"
  560. ],
  561. "properties": {
  562. "backtraceGraph": {
  563. "$ref": "#/definitions/backtraceGraph"
  564. },
  565. "paths": {
  566. "$ref": "#/definitions/paths"
  567. },
  568. "installers": {
  569. "$ref": "#/definitions/installersV2_0"
  570. }
  571. },
  572. "additionalProperties": false
  573. },
  574. "codemodelV2_4": {
  575. "required": [
  576. "backtraceGraph",
  577. "paths",
  578. "installers"
  579. ],
  580. "properties": {
  581. "backtraceGraph": {
  582. "$ref": "#/definitions/backtraceGraph"
  583. },
  584. "paths": {
  585. "$ref": "#/definitions/paths"
  586. },
  587. "installers": {
  588. "$ref": "#/definitions/installersV2_4"
  589. }
  590. },
  591. "additionalProperties": false
  592. },
  593. "codemodelV2_5": {
  594. "required": [
  595. "backtraceGraph",
  596. "paths",
  597. "installers"
  598. ],
  599. "properties": {
  600. "backtraceGraph": {
  601. "$ref": "#/definitions/backtraceGraph"
  602. },
  603. "paths": {
  604. "$ref": "#/definitions/paths"
  605. },
  606. "installers": {
  607. "$ref": "#/definitions/installersV2_5"
  608. }
  609. },
  610. "additionalProperties": false
  611. },
  612. "codemodelV2_9": {
  613. "required": [
  614. "codemodelVersion",
  615. "backtraceGraph",
  616. "paths",
  617. "installers"
  618. ],
  619. "properties": {
  620. "codemodelVersion": {
  621. "$ref": "#/definitions/codemodelVersionV2_9"
  622. },
  623. "backtraceGraph": {
  624. "$ref": "#/definitions/backtraceGraph"
  625. },
  626. "paths": {
  627. "$ref": "#/definitions/paths"
  628. },
  629. "installers": {
  630. "$ref": "#/definitions/installersV2_5"
  631. }
  632. },
  633. "additionalProperties": false
  634. }
  635. }
  636. }