2021-06-10 19:42:23 +00:00
|
|
|
#lang racket/base
|
|
|
|
;;; SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
;;; SPDX-FileCopyrightText: Copyright © 2021 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
|
|
|
|
|
|
|
(provide pre-installer)
|
|
|
|
|
|
|
|
(require racket/runtime-path)
|
|
|
|
(require preserves-schema/bin/preserves-schema-rkt)
|
|
|
|
(require (only-in racket/file delete-directory/files))
|
|
|
|
|
|
|
|
(require (only-in syndicate/schema-compiler
|
|
|
|
schema-compiler-plugin
|
|
|
|
schema-compiler-plugin-mode))
|
|
|
|
|
|
|
|
(define (pre-installer _collects-path package-path)
|
|
|
|
(define output-directory (build-path package-path "schemas/gen"))
|
|
|
|
(delete-directory/files output-directory #:must-exist? #f)
|
2021-06-17 13:57:55 +00:00
|
|
|
(batch-compile #:inputs (list (build-path package-path "schemas/**.prs"))
|
|
|
|
#:additional-modules (hash '(EntityRef) 'syndicate/entity-ref)
|
|
|
|
#:output-directory output-directory
|
|
|
|
#:plugins (list schema-compiler-plugin)))
|
2021-06-10 19:42:23 +00:00
|
|
|
|
|
|
|
(define-runtime-path package-path "..")
|
|
|
|
(define (regenerate!)
|
|
|
|
(void (pre-installer 'not-bothering-to-figure-this-out-since-we-do-not-need-it
|
|
|
|
package-path)))
|
|
|
|
|
|
|
|
(module+ main
|
|
|
|
(regenerate!))
|