
Could not put it in planet/util because it depends on planet/util at phase 1. Re-exported the other "this-package" macros from planet/version. Modified this-package-in to take multiple suffix identifiers and to treat the suffix "main" specially, and generate (planet owner/name:X:Y) instead of (planet owner/name:X:Y/main).
27 lines
676 B
Racket
27 lines
676 B
Racket
#lang racket/base
|
|
|
|
(provide this-package-version
|
|
this-package-version-name
|
|
this-package-version-owner
|
|
this-package-version-maj
|
|
this-package-version-min
|
|
this-package-version-symbol
|
|
this-package-in)
|
|
|
|
(require
|
|
planet/util
|
|
(for-syntax
|
|
racket/base
|
|
racket/require-transform
|
|
syntax/parse
|
|
planet/syntax))
|
|
|
|
(define-syntax this-package-in
|
|
(make-require-transformer
|
|
(syntax-parser
|
|
[(~and src (_ (~or (~datum main) suffix:id) ...))
|
|
(expand-import
|
|
#`(combine-in
|
|
#,@(for/list ([suf (in-list (attribute suffix))])
|
|
(make-planet-require-spec #'src suf))))])))
|