json-model-compiler 2.0b11__tar.gz → 2.0b26__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. {json_model_compiler-2.0b11/site → json_model_compiler-2.0b26}/BACKLOG.md +107 -37
  2. {json_model_compiler-2.0b11/json_model_compiler.egg-info → json_model_compiler-2.0b26}/PKG-INFO +1 -1
  3. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/SPEC.md +5 -1
  4. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/TUTO.md +11 -10
  5. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/about.sh +1 -0
  6. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/docker/Dockerfile +25 -13
  7. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/docker/Makefile +35 -13
  8. json_model_compiler-2.0b26/docker/jmc +42 -0
  9. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/analyze.py +191 -88
  10. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/clang.py +13 -8
  11. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/jmc.pod +31 -3
  12. json_model_compiler-2.0b26/json_model/irep.py +787 -0
  13. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/java.py +9 -8
  14. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/javascript.py +10 -11
  15. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/language.py +99 -56
  16. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/model.py +16 -10
  17. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/optim.py +43 -5
  18. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/perl.py +26 -8
  19. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/plpgsql.py +11 -9
  20. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/python.py +10 -6
  21. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/recurse.py +2 -0
  22. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/c/main.c +20 -6
  23. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/java/pom.xml +3 -3
  24. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/js/index.js +1 -1
  25. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/js/package.json +1 -1
  26. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/pl/ignore.txt +0 -1
  27. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/pl/lib/JSON/JsonModel.pm +1 -1
  28. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/support.py +21 -3
  29. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/script.py +42 -10
  30. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/utils.py +48 -5
  31. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/xstatic.py +279 -107
  32. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26/json_model_compiler.egg-info}/PKG-INFO +1 -1
  33. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model_compiler.egg-info/SOURCES.txt +6 -1
  34. json_model_compiler-2.0b26/models/cypress.model.json +90 -0
  35. json_model_compiler-2.0b26/models/diploma-arrete.model.json +17 -0
  36. json_model_compiler-2.0b26/models/diploma-export.model.json +20 -0
  37. json_model_compiler-2.0b26/models/fresq.model.json +79 -0
  38. json_model_compiler-2.0b26/models/jmc-ir.model.json +134 -0
  39. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-model-v2.model.json +7 -6
  40. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-model.model.json +7 -6
  41. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-04-mongodb.model.json +1 -1
  42. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-2019-09.model.json +3 -3
  43. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-2020-12-fuzzy.model.json +9 -9
  44. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-2020-12-tight.model.json +1 -1
  45. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-2020-12.model.json +3 -3
  46. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-next.model.json +3 -3
  47. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/l10n.model.json +3 -3
  48. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/openapi-311.model.json +5 -5
  49. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/pyproject.toml +2 -2
  50. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26/site}/BACKLOG.md +107 -37
  51. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/site/SPEC.md +5 -1
  52. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/site/TUTO.md +11 -10
  53. json_model_compiler-2.0b11/docker/jmc +0 -26
  54. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/.gitignore +0 -0
  55. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/.gitmodules +0 -0
  56. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/API.md +0 -0
  57. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/DESIGN.md +0 -0
  58. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/DEV.md +0 -0
  59. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/DOC.md +0 -0
  60. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/HOWTO.md +0 -0
  61. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/INTEGRATION.md +0 -0
  62. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/MANIFEST.in +0 -0
  63. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/Makefile +0 -0
  64. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/PUBS.md +0 -0
  65. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/README.md +0 -0
  66. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/docker/.dockerignore +0 -0
  67. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/docker/.gitignore +0 -0
  68. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/docker/README.md +0 -0
  69. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/README.md +0 -0
  70. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/__init__.py +0 -0
  71. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/convert.py +0 -0
  72. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/clang_entry.c +0 -0
  73. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/clang_free.c +0 -0
  74. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/clang_init.c +0 -0
  75. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/clang_pcre2_fun.c +0 -0
  76. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/clang_re2_fun.c +0 -0
  77. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/java_free.java +0 -0
  78. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/java_init.java +0 -0
  79. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/javascript_exe.js +0 -0
  80. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/javascript_foot.js +0 -0
  81. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/javascript_free.js +0 -0
  82. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/javascript_head.js +0 -0
  83. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/javascript_init.js +0 -0
  84. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/javascript_main.js +0 -0
  85. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/perl_entry.pl +0 -0
  86. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/perl_exe.pl +0 -0
  87. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/perl_free.pl +0 -0
  88. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/perl_init.pl +0 -0
  89. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/perl_main.pl +0 -0
  90. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/perl_pkg.pl +0 -0
  91. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/plpgsql_entry.sql +0 -0
  92. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/python_entry.py +0 -0
  93. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/python_exe.py +0 -0
  94. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/python_free.py +0 -0
  95. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/python_init.py +0 -0
  96. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/data/python_main.py +0 -0
  97. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/export.py +0 -0
  98. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/mtypes.py +0 -0
  99. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/objmerge.py +0 -0
  100. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/resolver.py +0 -0
  101. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/Makefile +0 -0
  102. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/__init__.py +0 -0
  103. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/c/Makefile +0 -0
  104. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/c/json-model.c +0 -0
  105. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/c/json-model.h +0 -0
  106. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/java/.gitignore +0 -0
  107. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/java/Makefile +0 -0
  108. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/java/README.md +0 -0
  109. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/java/env.bash +0 -0
  110. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/java/json_model/Checker.java +0 -0
  111. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/java/json_model/GSON.java +0 -0
  112. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/java/json_model/JSON.java +0 -0
  113. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/java/json_model/JSONP.java +0 -0
  114. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/java/json_model/Jackson.java +0 -0
  115. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/java/json_model/Main.java +0 -0
  116. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/java/json_model/ModelChecker.java +0 -0
  117. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/java/json_model/Path.java +0 -0
  118. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/java/json_model/Report.java +0 -0
  119. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/java/json_model/Runtime.java +0 -0
  120. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/js/README.md +0 -0
  121. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/js/main.js +0 -0
  122. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/pl/.gitignore +0 -0
  123. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/pl/Changes +0 -0
  124. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/pl/LICENSE +0 -0
  125. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/pl/MANIFEST +0 -0
  126. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/pl/Makefile.PL +0 -0
  127. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/pl/README +0 -0
  128. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/pl/t/00-load.t +0 -0
  129. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/pl/t/manifest.t +0 -0
  130. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/pl/t/pod-coverage.t +0 -0
  131. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/pl/t/pod.t +0 -0
  132. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/pl/xt/boilerplate.t +0 -0
  133. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/sql/META.json +0 -0
  134. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/sql/Makefile +0 -0
  135. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/sql/json_model--2.0.sql +0 -0
  136. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/sql/json_model.control +0 -0
  137. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/runtime/types.py +0 -0
  138. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model/url_cache.py +0 -0
  139. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model_compiler.egg-info/dependency_links.txt +0 -0
  140. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model_compiler.egg-info/entry_points.txt +0 -0
  141. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model_compiler.egg-info/requires.txt +0 -0
  142. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/json_model_compiler.egg-info/top_level.txt +0 -0
  143. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/ansiblelint-meta.model.json +0 -0
  144. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/everything.model.json +0 -0
  145. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/geo-easy.model.json +0 -0
  146. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/geo.model.json +0 -0
  147. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-model-latest.model.json +0 -0
  148. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-model-moschin.model.json +0 -0
  149. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-model-no-merge.model.json +0 -0
  150. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-model-v1.model.json +0 -0
  151. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-model-v2-en.model.json +0 -0
  152. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-01-fuzzy.model.json +0 -0
  153. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-01-nesting.model.json +0 -0
  154. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-01.model.json +0 -0
  155. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-02-fuzzy.model.json +0 -0
  156. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-02-nesting.model.json +0 -0
  157. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-02.model.json +0 -0
  158. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-03-fuzzy.model.json +0 -0
  159. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-03-nesting.model.json +0 -0
  160. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-03.model.json +0 -0
  161. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-04-fuzzy.model.json +0 -0
  162. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-04-nesting.model.json +0 -0
  163. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-04.model.json +0 -0
  164. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-06-fuzzy.model.json +0 -0
  165. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-06.model.json +0 -0
  166. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-07-fuzzy.model.json +0 -0
  167. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-07.model.json +0 -0
  168. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-2019-09-fuzzy.model.json +0 -0
  169. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-next-fuzzy.model.json +0 -0
  170. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-tight.model.json +0 -0
  171. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-tighter-loose.model.json +0 -0
  172. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-draft-tighter.model.json +0 -0
  173. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/json-schema-linter.model.json +0 -0
  174. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/jsound.model.json +0 -0
  175. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/lazygit.model.json +0 -0
  176. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/openapi-311-fuzzy.model.json +0 -0
  177. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/openapi-311-models.model.json +0 -0
  178. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/person.model.json +0 -0
  179. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/person2.model.json +0 -0
  180. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/models/pgxn.model.json +0 -0
  181. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/package.json +0 -0
  182. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/setup.cfg +0 -0
  183. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/site/API.md +0 -0
  184. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/site/DOC.md +0 -0
  185. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/site/DOCKER.md +0 -0
  186. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/site/HOWTO.md +0 -0
  187. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/site/PUBS.md +0 -0
  188. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/site/README.md +0 -0
  189. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/site/cover.md +0 -0
  190. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/site/favicon.ico +0 -0
  191. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/site/index.html +0 -0
  192. {json_model_compiler-2.0b11 → json_model_compiler-2.0b26}/site/json_logo.svg +0 -0
@@ -2,30 +2,38 @@
2
2
 
3
3
  ## Current Tasks
4
4
 
5
- - [x] pr: howto entry about python dyn code
6
- - [x] pr: add about project page which include some stats
7
- - [x] pr: howto entry about python projects
8
- - [x] pr: restructure web site, avoid some duplication
9
- - [x] pr: python static api
10
- - [x] pr: python dynamic api
11
- - [x] pr: js api
12
- - [x] pr: c api
13
- - [x] tests: fix generated json model schema test by switching to jschon
14
- - [x] pr: plpgsql api
15
- - [x] pr: perl api
16
- - [x] pr: java api
17
- - [x] pr: js howto
18
- - [x] c-backend: add inlining and branch hints
19
- - [x] c-frontend: fix --version display
20
- - [x] py-frontend: fix line display for jsonl and test vectors
21
- - [x] java-frontend: improve check interface and calls
22
- - [x] js-frontend: fix line numbering for jsonl
23
- - [x] py-frontend: fix line numbering for jsonl
24
- - [x] js-frontend: do several iterations to measure the loop overhead
25
- - [ ] python: fix venv installation issue with `pl/JSON` directory?
5
+ - [x] models: write model for json IR
6
+ - [x] static: fix value path in some object variants
7
+ - [x] static: add a max threshold/ratio for may property unrolling
8
+ - [x] perf: add jsb version to final summary
9
+ - [x] command: add `--no-predef` option for testing
10
+ - [x] command: remove inline-or option and implementation
11
+ - [x] command: allow to pass options with environment variable `JMC_OPTS`
12
+ - [x] docker: environment control for perf tests
13
+ - [x] command: `jmc -C -o foo.json` generates python instead of json
14
+ - [ ] optim: improve xor-to-or with references
15
+ - [ ] perf: compute performance overhead globally instead of per run
16
+ - [ ] perf: experiment object matching with various mandatory/optional properties
17
+ - [ ] static: close may/must? merge with open?
18
+ - [ ] optim: and to merge optimization for open object models
19
+ - [ ] static: add a dynamic test for different strategies in object checking
20
+ - [ ] tests: add ir optimized output
21
+ - [ ] tests: add pytest ir tests
22
+ - [ ] tests: add generated ir model check
23
+ - [ ] tests: drop language outputs for IR only?!
24
+ - [ ] tests: check generated IR with IR model
25
+ - [ ] backend: refactor ir optimizations
26
+ - [ ] command: add direct ir to lang conversion
27
+ - [ ] backend: improve and extend IR optimizations?
28
+ - [ ] artifact: make work with dind
29
+ - [ ] static: recognize already compile objects and reuse function esp under no no-reporting?
30
+ - [ ] tests: check how clang compares to gcc
31
+ - [ ] tests: add non regression tests to docker build
26
32
  - [ ] tests: fix sql test errors from `Makefile`
27
- - [ ] pr: web api
28
- - [ ] pr: remove wip cover page from web site
33
+ - [ ] service: json to lang conversion API
34
+ - [ ] api: web interface with caching and security
35
+ - [ ] web-frontend: dev as a use case for jm
36
+ - [ ] service: minimal website with editor
29
37
  - [ ] tests: fix test with generated json model meta schema
30
38
  - [ ] java: joy/johnzon bugs `mv-16/or_0b` JSONP, 100E99 <> 10E100; other JSONP issues, maybe int/float
31
39
  - [ ] tests: test generated JSON schema with test vectors.
@@ -42,11 +50,9 @@
42
50
  - [ ] pr: submit jsonschema-benchmark java PR
43
51
  - [ ] pr: submit jsonschema-benchmark PL/pgSQL PR
44
52
  - [ ] frontends: reject json with duplicated props
45
- - [ ] pr: howto entry about javascript projects/code
46
- - [ ] pr: howto entry about C executable/code
47
- - [ ] api: web interface with caching and security
48
53
  - [ ] c-backend: header file for generated code?
49
54
  - [ ] tests: perl _uninitialized value $tag_0 in hash element at `./mv-18/dis_01.pl:171._
55
+ - [ ] command: allow to pass some options from rc file?
50
56
 
51
57
  ## Re Do
52
58
 
@@ -92,7 +98,6 @@
92
98
  - [ ] static: fix double reports, eg constraint type and constraints or object props and object
93
99
  - [ ] py-backend: fix failure verbosity `ref/json-model.py.check` vs others
94
100
  - [ ] static: keep deeper names?
95
- - [ ] ts-backend: js sharing?
96
101
  - [ ] optim: allow more substitutions _after_ transformations? when/where to trigger optims?
97
102
  - [ ] py-backend: heterogeneous enum (`enum_05`) improved implementation with `ConstSet`
98
103
  - [ ] py-backend: heterogeneous disjunction with `ConstMap`?
@@ -104,7 +109,6 @@
104
109
  - [ ] python: how to keep looseness after inlining?
105
110
  - [ ] static: multi-type object disjunction?
106
111
  - [ ] tests: fix `./rwt/json-schema-draft-next-fuzzy.x.c unused variable res`
107
- - [ ] tests: allow options for specific tests from pytest
108
112
  - [ ] tests: improve schema tests by allowing more cases
109
113
  - [ ] static: improve failure reporting of extended regex
110
114
  - [ ] design: add `$URI-REF` or similar? `$PATH`?
@@ -114,8 +118,6 @@
114
118
  - [ ] tests: put generated exe in `/dev/shm` instead of locally from `Makefile`?
115
119
  - [ ] static: improve constraint failing message (length, unique…)
116
120
  - [ ] schema: inline external references to generate working schemas in more cases? (openapi-311)
117
- - [ ] mongodb-backend: generate bson stuff, as an option to schema generation?
118
- - [ ] php-backend: should it stoop so low?
119
121
  - [ ] perf: geo, ansible meta, openapi
120
122
  - [ ] c-backend: multithreading? one one value??
121
123
  - [ ] pr: deb and rpm packaging? github package distribution?
@@ -200,7 +202,7 @@
200
202
  - [ ] extend: accepting any extension?! eg opened objects?
201
203
  - [ ] extend: variants, see `models/json-schema-*`
202
204
  - [ ] extend: pg storage, extension
203
- - [ ] extend: mongodb storage ?
205
+ - [ ] extend: json schema for mongodb storage
204
206
  - [ ] perf: schema validation on yac data
205
207
  - [ ] perf: open data, eg RNCP and FRESQ
206
208
  - [ ] frontend: loop load/valid for perf
@@ -218,18 +220,27 @@
218
220
  - [ ] perf: two phase check, without collection and with collection if needed.
219
221
  - [ ] perf: no reasons/path collection and run with collection only when bad.
220
222
  - [ ] schema: handle includes? inline?!
221
- - [ ] js/ts-backend: look at JSON Schema implementations?
222
- - [ ] dyn-backend: is dynamic mergeable in xstatic, beyond using `eval`?
223
+ - [ ] go-backend: encoding/json vs various faster replacements…
224
+ - [ ] ruby-backend: for rails people?
223
225
  - [ ] rust-backend: see [json crate](https://docs.rs/json/latest/json/).
224
226
  - [ ] cpp-backend: see [json](https://github.com/nlohmann/json) and `re2`. json lib popularity?
225
227
  - [ ] cpp-backend: also see [simdjson](https://github.com/simdjson/simdjson)?
226
228
  - [ ] kotlin-backend: see [serialization](https://kotlinlang.org/docs/serialization.html).
227
- - [ ] go-backend: encoding/json vs various faster replacements…
228
- - [ ] ruby-backend: for rails people?
229
- - [ ] pl-backend: for CGI people?
229
+ - [ ] mongodb-backend: generate bson stuff, as an option to schema generation?
230
+ - [ ] ts-backend: js sharing ?
231
+ - [ ] swift-backend: …
232
+ - [ ] dart-backend: …
233
+ - [ ] php-backend: …
234
+ - [ ] c#-backend: …
235
+ - [ ] haskell-backend: …
236
+ - [ ] ocaml-backend: …
237
+ - [ ] scala-backend: …
238
+ - [ ] vb-backend: ?
239
+ - [ ] julia-backend: ?
240
+ - [ ] lua-backend: ?
241
+ - [ ] dyn-backend: is dynamic mergeable in xstatic, beyond using `eval`?
230
242
  - [ ] feature: add model predef for URI, URI-REF and the like
231
243
  - [ ] design: URI vs URL?
232
- - [ ] service: json to lang conversion API :-)
233
244
  - [ ] design: documentation use case, with added _markdown description_
234
245
  - [ ] pr: validation must be optimized for the valid case, as it is the most likely.
235
246
  - [ ] case: use trafo in geo to have either 2 or 3 vectors, no mix.
@@ -563,3 +574,62 @@
563
574
  - [x] design: check `$BOOL` vs `$BOOLEAN` support
564
575
  - [x] pr: complete spec
565
576
  - [x] design: force static information on `@` constraints for optimizations
577
+ - [x] pr: howto entry about python dyn code
578
+ - [x] pr: add about project page which include some stats
579
+ - [x] pr: howto entry about python projects
580
+ - [x] pr: restructure web site, avoid some duplication
581
+ - [x] pr: python static api
582
+ - [x] pr: python dynamic api
583
+ - [x] pr: js api
584
+ - [x] pr: c api
585
+ - [x] tests: fix generated json model schema test by switching to jschon
586
+ - [x] pr: plpgsql api
587
+ - [x] pr: perl api
588
+ - [x] pr: java api
589
+ - [x] pr: js howto
590
+ - [x] c-backend: add inlining and branch hints
591
+ - [x] c-frontend: fix --version display
592
+ - [x] py-frontend: fix line display for jsonl and test vectors
593
+ - [x] java-frontend: improve check interface and calls
594
+ - [x] js-frontend: fix line numbering for jsonl
595
+ - [x] py-frontend: fix line numbering for jsonl
596
+ - [x] js-frontend: do several iterations to measure the loop overhead
597
+ - [x] python: fix venv installation issue with `pl/JSON` directory
598
+ - [x] pr: improve tuto docker launch
599
+ - [x] pl-backend: add function declarations, needed for some recursions
600
+ - [x] pl-backend: work around reference issues
601
+ - [x] command: add `--schema-version` to force schema version output
602
+ - [x] pr: remove _wip_ cover page from web site
603
+ - [x] model: filter out all comments from transformations
604
+ - [x] c-backend: improve overhead estimation accuracy
605
+ - [x] static: optimize function mapping by skipping intermediate functions if possible
606
+ - [x] docker: add subdirs to java classpath
607
+ - [x] artifact: reduce task granularity
608
+ - [x] artifact: add bench docker image base on docker-cli
609
+ - [x] java-backend: update dependency versions
610
+ - [x] static: detect discriminator on object part of or/xor
611
+ - [x] static: accept discriminator with a list of constants
612
+ - [x] optim: fix infinite recursion in `inline_or`
613
+ - [x] optim: improve xor-to-or to handle more cases
614
+ - [x] optim: add `-[-no]-inline-or` option
615
+ - [x] artifact: fix selection of docker image between `benchmark.sh` and `run.sh`
616
+ - [x] optim: turn off `--inline-or` by default, which can impact compile perf too much
617
+ - [x] tests: allow options for specific tests from pytest
618
+ - [x] tests: cleanup current status, back to 100\%
619
+ - [x] pr: update tuto scripts to match current status
620
+ - [x] artifact: add test case stats
621
+ - [x] static: detect discriminators from references
622
+ - [x] static: detect partial discriminators
623
+ - [x] static: detect partial discriminators with other stuff
624
+ - [x] docker: generate image for current branch
625
+ - [x] artifact: improve docker image tagging
626
+ - [x] backend: intermediate represention json code generation
627
+ - [x] backend: optimize some output patterns on IR
628
+ - [x] backend: generate output source code from symbolic json code
629
+ - [x] xstatic: skip IR if not needed
630
+ - [x] command: add `--ir-optimize` option
631
+ - [x] command: activate ir optimization by default
632
+ - [x] backend: IR handling of ConstMap
633
+ - [x] static: skip model function to call obj function directly on references
634
+ - [x] backend: apply skip functions also for all pmap/cmap/cc through IR
635
+ - [x] optim: direct mandatory-only attributes objects with expected count checked ahead
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: json_model_compiler
3
- Version: 2.0b11
3
+ Version: 2.0b26
4
4
  Summary: JSON Model Tools
5
5
  Author: Fabien Coelho, Claire Yannou-Medrala
6
6
  License-Expression: CC0-1.0
@@ -447,7 +447,7 @@ A reference is a string which begins with the `$` character.
447
447
 
448
448
  Implementation should detect external reference cycles which are errors and should be rejected.
449
449
 
450
- ## Model Transformations
450
+ ## (Experimental) Model Transformations
451
451
 
452
452
  Symbol `%` at the root of the model defines a model transformation object, which
453
453
  may include symbol renamings, model importations and model editions.
@@ -527,6 +527,10 @@ may include symbol renamings, model importations and model editions.
527
527
  These additions and editions are performed _after_ property renamings and imports,
528
528
  and _before_ merge pre-processing.
529
529
 
530
+ What is the _right_ balance between features, syntax and ease-of-use for a type transformation
531
+ language is an on-going investigation: should it allow renaming, moving or copying attributes?
532
+ Should it allow to remove definitions? Should imports allow to define a namespace?
533
+
530
534
  ## Static Typing Lattice
531
535
 
532
536
  In the above specification, there are several requirements for having _one_ known type
@@ -32,17 +32,18 @@ seems more familiar. The docker image include the necessary environment run dire
32
32
  C, Python, JS, Perl and Java codes, which explains its size.
33
33
  Running the PL/pgSQL code requires a working Postgres server, which is _not_ discussed here.
34
34
 
35
- ### Docker Image Installation
35
+ ### First Installation Option: Docker Image
36
36
 
37
37
  For the wary user, download and start the `zx80/jmc` docker image, from your docker
38
38
  desktop client or from a terminal:
39
39
 
40
40
  ```sh
41
41
  docker pull zx80/jmc:latest
42
- docker run --name awesome_jmc --user $UID:$GID -v .:/app/workspace --rm -it --entrypoint /bin/bash zx80/jmc
42
+ # for linux, consider adding: --user $(id -u):$(id -g)
43
+ docker run --name awesome_jmc -v .:/app/workspace --rm -it --entrypoint /bin/bash zx80/jmc
43
44
  ```
44
45
 
45
- This should give your a shell prompt open in the current directory with your permissions.
46
+ This should give your a shell prompt open in the current directory with your own permissions.
46
47
  Check that the `jmc` command is available and works:
47
48
 
48
49
  ```sh
@@ -53,7 +54,7 @@ jmc --man # show manual page
53
54
 
54
55
  Type `exit` when you want to stop playing with the application.
55
56
 
56
- ### Python Virtual Environment Installation
57
+ ### Second Installation Option: Python Virtual Environment
57
58
 
58
59
  For the advanced user, create a Python virtual environment with the JSON Model Compiler
59
60
  and JSON Schema Utils (for JSON Schema importations).
@@ -211,7 +212,7 @@ with file `Person-2.model.json`:
211
212
  "birth": "$DATE",
212
213
  "?friends": [ "$Name" ]
213
214
  },
214
- "PI": "=3.141592653589793238462643"
215
+ "Pi": "=3.141592653589793238462643"
215
216
  },
216
217
  "@": "$Person"
217
218
  }
@@ -236,10 +237,10 @@ for instance with file `pi.json`:
236
237
  3.141592653589793238462643
237
238
  ```
238
239
 
239
- We can check that its content conforms to PI definition inside the `Person-2` model:
240
+ We can check that its content conforms to Pi definition inside the `Person-2` model:
240
241
 
241
242
  ```sh
242
- jmc --name PI Person-2 pi.json # PASS
243
+ jmc --name Pi Person-2 pi.json # PASS
243
244
  ```
244
245
 
245
246
  ## Reusing Definitions
@@ -736,7 +737,7 @@ class Person(pydantic.BaseModel):
736
737
  birth: datetime.date
737
738
  friends: list[Name]|None = None
738
739
 
739
- PI: float = 3.141592653589793238462643
740
+ Pi: float = 3.141592653589793238462643
740
741
 
741
742
  type Root = Person
742
743
  ```
@@ -779,7 +780,7 @@ $defs:
779
780
  - name
780
781
  - birth
781
782
  additionalProperties: false
782
- PI:
783
+ Pi:
783
784
  const: 3.141592653589793
784
785
  $ref: '#/$defs/Person'
785
786
  ```
@@ -796,7 +797,7 @@ jmc -E Person-2 | jsu-model
796
797
  "#": "JSON Model generated from a JSON Schema with json-schema-utils",
797
798
  "$": {
798
799
  "Name": "/^\\w+( \\w+)*$/",
799
- "PI": "=3.141592653589793",
800
+ "Pi": "=3.141592653589793",
800
801
  "Person": {
801
802
  "?friends": [ "$Name" ],
802
803
  "_birth": "$DATE",
@@ -36,6 +36,7 @@ cloc --md \
36
36
  json_model/url_cache.py \
37
37
  json_model/utils.py \
38
38
  json_model/xstatic.py \
39
+ json_model/irep.py \
39
40
  | sed -n -e '/^$/,$p' | head -4
40
41
 
41
42
  cat <<EOF
@@ -3,6 +3,8 @@
3
3
  #
4
4
  FROM ubuntu:24.04
5
5
  LABEL description="JSON Model Compiler"
6
+ ARG JMC=main
7
+ ARG JSU=main
6
8
 
7
9
  # system update, installs, cleanup
8
10
  RUN apt update ; \
@@ -63,30 +65,40 @@ RUN npm install re2
63
65
  # pip install json-model-compiler json-schema-utils
64
66
  # npm install json_model_runtime
65
67
 
66
- RUN git clone https://github.com/clairey-zx81/json-model.git
68
+ RUN git clone -b $JMC https://github.com/clairey-zx81/json-model.git
67
69
  RUN /app/venv/bin/pip install -e ./json-model
68
70
  RUN npm install file:./json-model/json_model/runtime/js
69
- RUN ls -la node_modules
70
- # RUN rm -rf ./json-model # not if editable (-e above)
71
+ # RUN ls -la node_modules
72
+ # RUN rm -rf ./json-model # no, editable
71
73
 
72
- RUN git clone https://github.com/zx80/json-schema-utils.git
74
+ RUN git clone -b $JSU https://github.com/zx80/json-schema-utils.git
73
75
  RUN /app/venv/bin/pip install -e ./json-schema-utils
74
- # RUN rm -rf ./json-schema-utils
76
+ # RUN rm -rf ./json-schema-utils # no, editable
75
77
 
76
78
  # java runtime, direct download with hardcoded version
77
79
  ENV java=/app/json-model/json_model/runtime/java
80
+ ENV gson=2.13.2
81
+ ENV jackson=2.20.0
82
+ ENV jackson_ann=2.20
83
+ ENV jakarta=2.1.3
84
+ ENV johnzon=2.0.2
78
85
  RUN for artifact in \
79
- com.google.code.gson:gson:2.13.1 \
80
- com.fasterxml.jackson.core:jackson-core:2.19.2 \
81
- com.fasterxml.jackson.core:jackson-databind:2.19.2 \
82
- com.fasterxml.jackson.core:jackson-annotations:2.19.2 \
83
- jakarta.json:jakarta.json-api:2.0.2 \
84
- org.apache.johnzon:johnzon-core:2.0.2 \
86
+ com.google.code.gson:gson:$gson \
87
+ com.fasterxml.jackson.core:jackson-core:$jackson \
88
+ com.fasterxml.jackson.core:jackson-databind:$jackson \
89
+ com.fasterxml.jackson.core:jackson-annotations:$jackson_ann \
90
+ jakarta.json:jakarta.json-api:$jakarta \
91
+ org.apache.johnzon:johnzon-core:$johnzon \
85
92
  ; \
86
93
  do \
87
94
  mvn dependency:copy -Dartifact=$artifact -DoutputDirectory=$java ; \
88
95
  done
89
- ENV CLASSPATH=.:/app/workspace:/usr/share/java/gnu-getopt.jar:$java/json-model.jar:$java/gson-2.13.1.jar:$java/jackson-core-2.19.2.jar:$java/jackson-databind-2.19.2.jar:$java/jackson-annotations-2.19.2.jar:$java/jakarta.json-api-2.0.2.jar:$java/johnzon-core-2.0.2.jar
96
+ ENV CLASSPATH=.:/app/workspace:/app/workspace/java:/app/workspace/tmp
97
+ ENV CLASSPATH=$CLASSPATH:$java/json-model.jar
98
+ ENV CLASSPATH=$CLASSPATH:/usr/share/java/gnu-getopt.jar
99
+ ENV CLASSPATH=$CLASSPATH:$java/gson-$gson.jar
100
+ ENV CLASSPATH=$CLASSPATH:$java/jackson-core-$jackson.jar:$java/jackson-databind-$jackson.jar:$java/jackson-annotations-$jackson_ann.jar
101
+ ENV CLASSPATH=$CLASSPATH:$java/jakarta.json-api-$jakarta.jar:$java/johnzon-core-$johnzon.jar
90
102
  RUN make -C $java jar
91
103
 
92
104
  # convenient shell and vi environment
@@ -102,6 +114,6 @@ RUN mkdir /app/workspace
102
114
  WORKDIR /app/workspace
103
115
  ENV TMPDIR=/tmp
104
116
  ENV JSON_MODEL_CACHEDIR=/tmp
105
- ENV PERLLIB=/app/json-model/json_model/runtime/pl
117
+ ENV PERLLIB=/app/json-model/json_model/runtime/pl/lib
106
118
  ENV PATH=$PATH:.
107
119
  ENTRYPOINT ["/app/venv/bin/jmc"]
@@ -5,6 +5,20 @@
5
5
  SHELL = /bin/bash
6
6
  .ONESHELL:
7
7
 
8
+ # settings, build for current branch
9
+ BRANCH = $(shell git branch --show-current)
10
+ GITVERS = $(shell git rev-parse --short=8 HEAD)
11
+ VERSION = $(shell ./jmc --version)
12
+
13
+ ifeq ($(BRANCH), main)
14
+ TAG = latest
15
+ else
16
+ TAG = test
17
+ endif
18
+
19
+ # for jmc wrapper
20
+ export JMC = $(BRANCH)
21
+
8
22
  #
9
23
  # CLEAN
10
24
  #
@@ -27,10 +41,15 @@ docker.cleaner:
27
41
  # DOCKER
28
42
  #
29
43
  NOCACHE = --no-cache
44
+ JMC = $(BRANCH)
45
+ JSU = main
46
+
30
47
  .PHONY: docker.build
31
48
  docker.build: .build
32
- .build: Dockerfile
33
- docker build $(NOCACHE) -t jmc -f Dockerfile . && touch $@
49
+
50
+ .build: Dockerfile jmc
51
+ docker build $(NOCACHE) --build-arg JMC=$(JMC) --build-arg JSU=$(JSU) \
52
+ -t jmc -f Dockerfile . && touch $@
34
53
 
35
54
  .PHONY: docker.run
36
55
  docker.run: .build
@@ -43,19 +62,22 @@ docker.status:
43
62
  docker container ps -a
44
63
  docker image ls -a
45
64
 
65
+ .PHONY: versions
66
+ versions:
67
+ @ \
68
+ echo " - tag: $(TAG)"; \
69
+ echo " - branch: $(BRANCH)"; \
70
+ echo " - gitvers: $(GITVERS)"; \
71
+ echo " - version: $(VERSION)"
72
+
73
+ .PHONY: docker.tag
46
74
  docker.tag: .build
47
- # tag latest
48
- docker tag jmc zx80/jmc:latest
49
- # tag package version
50
- gitvers=$$(git rev-parse --short=8 HEAD)
51
- docker tag jmc zx80/jmc:$$gitvers
52
- # git commit
53
- version=$$(./jmc --version| tr -d '\012\015')
54
- docker tag jmc zx80/jmc:$$version
75
+ docker tag jmc zx80/jmc:$(TAG)
76
+ docker tag jmc zx80/jmc:$(BRANCH)
77
+ docker tag jmc zx80/jmc:$(GITVERS)
78
+ docker tag jmc zx80/jmc:$$(JMC=$(BRANCH) ./jmc --version)
55
79
 
56
80
  .PHONY: docker.push
57
81
  docker.push: docker.tag
58
82
  # if needed: docker login
59
- docker push zx80/jmc:latest
60
- version=$$(./jmc --version| tr -d '\012\015')
61
- docker push zx80/jmc:$$version
83
+ docker push -a zx80/jmc
@@ -0,0 +1,42 @@
1
+ #! /bin/bash
2
+ #
3
+ # run jmc command in docker, with some extensions
4
+ #
5
+ # env:
6
+ # - JMC: jmc docker tag to run
7
+ # - JMC_ENV: names of environment variables to export
8
+ # - WORKDIR: working directory to use
9
+
10
+ docker_image="zx80/jmc:${JMC:-latest}"
11
+ docker_root=(docker run --name awesome_jmc_$$ -v "${WORKDIR:-.}:/app/workspace" --rm)
12
+
13
+ # export environment variables to docker
14
+ for var in $JMC_ENV ; do
15
+ if [ "${!var}" ] ; then
16
+ docker_root+=(-e "$var=${!var}")
17
+ else
18
+ echo "### skipping empty or non existing environment variable $var" >&2
19
+ fi
20
+ done
21
+
22
+ docker_user=("${docker_root[@]}")
23
+ docker_user+=(--user "$(id -u):$(id -g)")
24
+
25
+ if [ "$#" -ge 1 -a "$1" = "help" ] ; then
26
+ echo "$0 [ help | run | exec | shell | root ] …"
27
+ elif [ "$#" -ge 1 -a "$1" = "shell" ] ; then
28
+ shift 1
29
+ exec "${docker_user[@]}" -i --entrypoint /bin/bash "$docker_image" "$@"
30
+ elif [ "$#" -ge 1 -a "$1" = "root" ] ; then
31
+ shift 1
32
+ exec "${docker_root[@]}" -i --entrypoint /bin/bash "$docker_image" "$@"
33
+ elif [ "$#" -ge 1 -a "$1" = "exec" ] ; then
34
+ exe=$2
35
+ shift 2
36
+ exec "${docker_user[@]}" --entrypoint "$exe" "$docker_image" "$@"
37
+ elif [ "$#" -ge 1 -a "$1" = "run" ] ; then
38
+ shift 1
39
+ exec "${docker_user[@]}" "$docker_image" "$@"
40
+ else
41
+ exec "${docker_user[@]}" "$docker_image" "$@"
42
+ fi