2021-05-27 08:36:35 +00:00
|
|
|
#lang racket/base
|
2021-06-04 14:20:14 +00:00
|
|
|
;;; SPDX-License-Identifier: LGPL-3.0-or-later
|
2024-03-10 11:43:06 +00:00
|
|
|
;;; SPDX-FileCopyrightText: Copyright © 2021-2024 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
2021-05-27 08:36:35 +00:00
|
|
|
|
|
|
|
(provide pre-installer)
|
|
|
|
|
|
|
|
(require racket/runtime-path)
|
|
|
|
(require preserves-schema/bin/preserves-schema-rkt)
|
|
|
|
(require (only-in racket/file delete-directory/files))
|
|
|
|
|
2021-06-03 21:22:46 +00:00
|
|
|
(require (only-in "../schema-compiler.rkt"
|
|
|
|
schema-compiler-plugin
|
|
|
|
schema-compiler-plugin-mode))
|
2021-06-02 04:57:48 +00:00
|
|
|
|
2021-05-27 08:36:35 +00:00
|
|
|
(define (pre-installer _collects-path syndicate-path)
|
2021-07-01 07:40:52 +00:00
|
|
|
(define output-directory (build-path syndicate-path "schemas"))
|
2021-06-01 08:02:41 +00:00
|
|
|
(delete-directory/files output-directory #:must-exist? #f)
|
2021-06-03 21:22:46 +00:00
|
|
|
(parameterize ((schema-compiler-plugin-mode 'meta))
|
2023-02-04 16:02:29 +00:00
|
|
|
(batch-compile #:inputs (list
|
|
|
|
(build-path syndicate-path "private/protocols/schemas/**.prs")
|
|
|
|
(build-path syndicate-path "private/schemas/**.prs")
|
|
|
|
)
|
2021-06-09 13:06:58 +00:00
|
|
|
#:additional-modules (hash '(EntityRef) 'syndicate/entity-ref)
|
2021-06-03 21:22:46 +00:00
|
|
|
#:output-directory output-directory
|
|
|
|
#:plugins (list schema-compiler-plugin))))
|
2021-05-27 08:36:35 +00:00
|
|
|
|
|
|
|
(define-runtime-path syndicate-path "..")
|
|
|
|
(define (regenerate!)
|
|
|
|
(void (pre-installer 'not-bothering-to-figure-this-out-since-we-do-not-need-it
|
|
|
|
syndicate-path)))
|
|
|
|
|
|
|
|
(module+ main
|
|
|
|
(regenerate!))
|