(pathname-directory-pathname
(merge-pathnames* path parent-path)))
+(defun protobuf-mangle-name (input-file)
+ (let ((directory (pathname-directory input-file)))
+ (format nil "~{~A-~}~A-~A"
+ (if (eq (first directory) :absolute)
+ (rest directory)
+ directory)
+ (pathname-name input-file)
+ (pathname-type input-file))))
+
+(defun protobuf-lispize-pathname (input-file)
+ (make-pathname
+ :name (protobuf-mangle-name input-file)
+ :type "lisp"
+ :defaults input-file))
+
(defmethod input-files ((op proto-to-lisp) (component protobuf-file))
"The input file is just the .proto file."
(declare (ignorable op))
stored where .fasl files are stored"
(declare (ignorable op))
(let* ((base-pathname (component-pathname component))
- (lisp-file (make-pathname
- :name (format nil "~A.proto" (pathname-name base-pathname))
- :type "lisp"
- :defaults base-pathname)))
+ (lisp-file (protobuf-lispize-pathname base-pathname)))
(values (list lisp-file
(make-pathname :type "proto-imports"
:defaults lisp-file))
(let* ((base-path (asdf::merge-pathnames* import path))
(proto-file (make-pathname :name import-name :type "proto"
:defaults base-path))
- (lisp-file (asdf::lispize-pathname
- (if output-path
- (make-pathname :name import-name
- :directory (pathname-directory output-path))
- base-path)))
+ (lisp-file (if output-path
+ (asdf::lispize-pathname
+ (make-pathname :name (asdf::protobuf-mangle-name base-path)
+ :directory (pathname-directory output-path)))
+ (asdf::protobuf-lispize-pathname base-path)))
(imports-file (make-pathname :type "proto-imports"
:defaults lisp-file))
(fasl-file (compile-file-pathname lisp-file))