27 lines
965 B
Racket
27 lines
965 B
Racket
|
#lang racket/base
|
||
|
;;; SPDX-License-Identifier: LGPL-3.0-or-later
|
||
|
;;; SPDX-FileCopyrightText: Copyright © 2021-2023 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))
|
||
|
|
||
|
(define (pre-installer _collects-path our-path)
|
||
|
(define output-directory (build-path our-path "schemas"))
|
||
|
(delete-directory/files output-directory #:must-exist? #f)
|
||
|
(batch-compile #:inputs (list (build-path our-path "private/schemas/**.prs"))
|
||
|
#:output-directory output-directory
|
||
|
#:plugins (list schema-compiler-plugin)))
|
||
|
|
||
|
(define-runtime-path our-path "..")
|
||
|
(define (regenerate!)
|
||
|
(void (pre-installer 'not-bothering-to-figure-this-out-since-we-do-not-need-it
|
||
|
our-path)))
|
||
|
|
||
|
(module+ main
|
||
|
(regenerate!))
|